create account

RE: Altcoin Portfolio The Pythonic Way - Have FUN & LEARN a New Skill! by veleje

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @bitinformant/altcoin-portfolio-the-pythonic-way-have-fun-and-learn-a-new-skill

· @veleje · (edited)
Thank you (from Python beginner) for your example and I hope more will be coming :-) This one was very useful for me. 

I was just wondering how to get certain data from coinmarketcap. I knew I can loop through the dictionaries inside that json and print out data like this: (example is for STEEM)

print(data[19]['symbol'], data[19]['price_usd'])

But I was wondering, how to make sure to always get data for say STEEM, because when STEEM  changes rank and ends on say 18th place, upper line of code will return data for different crypto currency. 

Well, you just showed me, how to elegantly solve this by creating list of id's I want data for and then get the info with:

if name in ids:

Cool, solves the problem currencies changing their 'rank', their position. 

Thanks, very appreciated!
properties (22)
authorveleje
permlinkre-bitinformant-altcoin-portfolio-the-pythonic-way-have-fun-and-learn-a-new-skill-20170729t191751641z
categorybitcoin
json_metadata{"tags":["bitcoin"],"app":"steemit/0.1"}
created2017-07-29 19:17:51
last_update2017-07-29 20:31:03
depth1
children2
last_payout2017-08-05 19:17:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length794
author_reputation490,220,361,761
root_title"Altcoin Portfolio The Pythonic Way - Have FUN & LEARN a New Skill!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id10,146,004
net_rshares0
@bitinformant ·
Glad the example was helpful to you. Full Steem ahead :)

Did you figure out how to add the pie chart?
properties (22)
authorbitinformant
permlinkre-veleje-re-bitinformant-altcoin-portfolio-the-pythonic-way-have-fun-and-learn-a-new-skill-20170730t133818050z
categorybitcoin
json_metadata{"tags":["bitcoin"],"app":"steemit/0.1"}
created2017-07-30 13:38:18
last_update2017-07-30 13:38:18
depth2
children1
last_payout2017-08-06 13:38:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length102
author_reputation46,840,471,722
root_title"Altcoin Portfolio The Pythonic Way - Have FUN & LEARN a New Skill!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id10,219,886
net_rshares0
@veleje ·
Sorry, haven't touched computer since. I'm not ready for matplotlib yet anyway, maybe in a year, :-) 
I'm old & slow learner with not enough free time...
properties (22)
authorveleje
permlinkre-bitinformant-re-veleje-re-bitinformant-altcoin-portfolio-the-pythonic-way-have-fun-and-learn-a-new-skill-20170731t021637969z
categorybitcoin
json_metadata{"tags":["bitcoin"],"app":"steemit/0.1"}
created2017-07-31 02:16:39
last_update2017-07-31 02:16:39
depth3
children0
last_payout2017-08-07 02:16:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length153
author_reputation490,220,361,761
root_title"Altcoin Portfolio The Pythonic Way - Have FUN & LEARN a New Skill!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id10,274,897
net_rshares0