archwhite
3/6/2017 - 10:40 PM

Languages top list

Languages top list

# languages top list
import operator


languages = {
"C"   	: {'pypl_world':7, 'pypl_us':7, 'github':0, 'tiobe': 2, 'libraries': 17},
"Csharp"  : {'pypl_world':4, 'pypl_us':4, 'github':13, 'tiobe': 4, 'libraries': 7},
"Cplusplus" : {'pypl_world':6, 'pypl_us':5, 'github':0, 'tiobe': 3, 'libraries': 19},
"Delphi"	    : {'pypl_world':21, 'pypl_us':22, 'github':0, 'tiobe': 9, 'libraries': 50},
"Go"  : {'pypl_world':18, 'pypl_us':17, 'github':2, 'tiobe': 14, 'libraries': 1},
"Haskell" : {'pypl_world':20, 'pypl_us': 20, 'github':0, 'tiobe': 38, 'libraries': 20},
"Java"    : {'pypl_world':1, 'pypl_us':2, 'github':0, 'tiobe': 1, 'libraries': 5},
"Javascript"  : {'pypl_world':5, 'pypl_us':3, 'github':0, 'tiobe': 7, 'libraries': 2},
"lua" : {'pypl_world':19, 'pypl_us':19, 'github':0, 'tiobe': 28, 'libraries': 42},
"Matlab"  : {'pypl_world':11, 'pypl_us':10, 'github':0, 'tiobe': 17, 'libraries': 78},
"Objective-C" : {'pypl_world':8, 'pypl_us':9, 'github':0, 'tiobe': 19, 'libraries': 11},
"Perl"    : {'pypl_world':17, 'pypl_us':15, 'github':0, 'tiobe': 10, 'libraries': 16},
"PHP" : {'pypl_world':3, 'pypl_us':11, 'github':7, 'tiobe': 6, 'libraries': 3},
"Python"  : {'pypl_world':2, 'pypl_us':1, 'github':14, 'tiobe': 5, 'libraries': 6},
"R"   : {'pypl_world':9, 'pypl_us':6, 'github':0, 'tiobe': 15, 'libraries': 25},
"Ruby"    : {'pypl_world':12, 'pypl_us':12, 'github':6, 'tiobe': 11, 'libraries': 4},
"Rust"	    : {'pypl_world':22, 'pypl_us':21, 'github':3, 'tiobe': 40, 'libraries': 18},
"Scala"   : {'pypl_world':16, 'pypl_us':13, 'github':10, 'tiobe': 29, 'libraries': 13},
"Swift"   : {'pypl_world':10, 'pypl_us':8, 'github':1, 'tiobe': 12, 'libraries': 14},
"TypeScript"  : {'pypl_world':15, 'pypl_us':16, 'github':4, 'tiobe': 25, 'libraries': 12},
"VBA" : {'pypl_world':14, 'pypl_us':14, 'github': 0, 'tiobe': 8, 'libraries': 90},
"CoffeeScript"    : {'pypl_world':99, 'pypl_us':99, 'github':5, 'tiobe': 99, 'libraries': 10},
"Elixir/Erlang"    : {'pypl_world':99, 'pypl_us':99, 'github':8, 'tiobe': 41, 'libraries': 22},
"VisualBasic"    : {'pypl_world':13, 'pypl_us':18, 'github':0, 'tiobe': 16, 'libraries': 90}
}

total_pypl_world = 0
total_pypl_us = 0
total_github = 0
total_tiobe = 0
total_libraries = 0

x = (1 + 22) * 11
print(x)

x = dict()
y = dict()
z = dict()
q = dict()
a = dict()

for l,score in languages.items():
    pypl_world = languages[l]['pypl_world']
    pypl_us = languages[l]['pypl_us']
    github = languages[l]['github']
    tiobe = languages[l]['tiobe']
    libraries = languages[l]['libraries']

    total_pypl_world += pypl_world
    total_pypl_us += pypl_us
    total_github += github
    total_tiobe += tiobe
    total_libraries += libraries

    q[l] = pypl_us + tiobe
    a[l] = pypl_us + libraries
    x[l] = pypl_world + tiobe + libraries
    y[l] = pypl_us + tiobe + libraries
    z[l] = pypl_us + pypl_world + tiobe + github + libraries

sorted_x = sorted(x.items(), key=operator.itemgetter(1), reverse = False)
sorted_y = sorted(y.items(), key=operator.itemgetter(1), reverse = False)
sorted_z = sorted(z.items(), key=operator.itemgetter(1), reverse = False)
sorted_a = sorted(a.items(), key=operator.itemgetter(1), reverse = False)
sorted_q = sorted(q.items(), key=operator.itemgetter(1), reverse = False)

print('sorted_x =', sorted_x[:9])
print('sorted_y =', sorted_y[:9])
print('sorted_z =', sorted_z[:9])
print('sorted_a =', sorted_a[:9])
print('sorted_q =', sorted_q[:9])
# print('total_pypl_world = ', total_pypl_world)
# print('total_pypl_us = ', total_pypl_us)
# print('total_github = ', total_github)
# print('total_tiobe = ', total_tiobe)
# print('total_libraries = ', total_libraries)