create account

Learn Steem-Python #2- Basic Commands by abhi3700

View this thread on: hive.blogpeakd.comecency.com
· @abhi3700 · (edited)
$37.40
Learn Steem-Python #2- Basic Commands
![learn_steem-python.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512731225/dqbbtwfoijy0avafgeb4.png)


Hi Guys!!...

### Today in this tutorial, we will learn about few basic commands for programming the **Steem blockchain** using *Python* language.

Please, refer to [Part 1](https://utopian.io/utopian-io/@abhi3700/learn-steem-python-1-installation-guide) before going any further, if the required tools are not installed.

## Introduction
This is all about practising the basic commands of **"Steem-Python"**. 


## Basic commands
Import the Steem function from steem library. After importing, we can use the function to access further commands (variables) inside that function.
```python
>>> from steem import Steem
>>> s = Steem()
```
#### All keys
Using all keys, we can query.
```python
>>> s.get_account('abhi3700').keys()
```
![all_keys.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512602920/nwrzuxs3dadupw36eead.png)

#### Id
This represents the 'user id' of the steem account holder. This is assigned whenever the user joins for 1st time and it remains permanent for the 'username'
```python
>>> s.get_account('abhi3700')['id']
143518
```
#### Name
```python
>>> s.get_account('abhi3700')['name']
'abhi3700'
```
#### Owner, Active, Posting, Memo Keys
Here, all the keys required to access account's different features.

![posting_active_owner_memo_keys.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512602979/ejppg7pr5ajiniitijsw.png)

##### Owner
```python
>>> s.get_account('abhi3700')['owner']
{'weight_threshold': 1, 'account_auths': [], 'key_auths': [['**************************************************', 1]]}
```

##### Active 
```python
>>> s.get_account('abhi3700')['active']
{'weight_threshold': 1, 'account_auths': [], 'key_auths': [['**************************************************', 1]]}
```

##### Posting
```python
>>> s.get_account('abhi3700')['posting']
{'weight_threshold': 1, 'account_auths': [['utopian.app', 1]], 'key_auths': [['**************************************************', 1]]}
```
##### Memo
```python
>>> s.get_account('abhi3700')['memo_key']
'**************************************************'
```
#### Public Profile Settings
This shows the meta-data about the user.
![public_profile_settings.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512603030/jjpqzslh5z5qsd4cd734.png)

```python
>>> s.get_account('abhi3700')['json_metadata']
'{"profile":{"name":"Abhijit Roy","about":"A Software Developer, Traveller, Crypto Trader, Blockchain enthusiast","location":"Chandigarh, India","profile_image":"https://firebasestorage.googleapis.com/v0/b/bitinfocoinfree.appspot.com/o/14068548_1125160424216001_2627046384272844500_o.jpg?alt=media&token=8bb1b1f9-36f5-4b9a-8220-4134f01f8542","website":"https://play.google.com/store/apps/details?id=in.topux.bitinfocoin","cover_image":"https://www.ethereum.org/images/assets/1900/Ethereum-homestead-background-4.jpg"}}'
```

#### Proxy
It is null in this case as no proxy server used.
```
>>> s.get_account('abhi3700')['proxy']
''
```
#### Last owner update
It comes from the UNIX command i.e. January 1st 1970. Also birthdays are written in timestamps (time from this date till date).
```
>>> s.get_account('abhi3700')['last_owner_update']
'1970-01-01T00:00:00'
```

#### Last account update
It mainly is when the account settings (public profile) was last updated.
```python
>>> s.get_account('abhi3700')['last_account_update']
'2017-11-26T17:57:18'
```

#### Account creation time
The date, time when the account was created.
```python
>>> s.get_account('abhi3700')['created']
'2017-04-02T08:00:57'
```

#### Recovery account
If your account gets hacked, it can be recovered before any data is manipulated.
```python
>>> s.get_account('abhi3700')['recovery_account']
'steem'
>>> s.get_account('abhi3700')['last_account_recovery']
'1970-01-01T00:00:00'
```
Click [here](https://steemit.com/steem/@someguy123/how-the-steem-account-recovery-works-and-why-your-trustee-can-t-steal-your-account) for details.

#### Post counts
The no. of posts posted by the user.
```python
>>> s.get_account('abhi3700')['post_count']
198
```
#### Can vote
Whether a person can vote or not.
```python
>>> s.get_account('abhi3700')['can_vote']
True
```

#### Voting Power
This depends upon the 'steem power' a user holds. Here, it calculates out of 10,000. 
```python
>>> s.get_account('abhi3700')['voting_power']
9800
```
So, I hold 98 % voting power currently.

#### Last vote time
Last time, I voted.
```python
>>> s.get_account('abhi3700')['last_vote_time']
'2017-12-01T18:30:27'
```
#### Balance
All balances in steem, SBD.
The user account looks like this...
![wallet.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512603104/gmdyplgadjatovjxodpg.png)


```python
>>> s.get_account('abhi3700')['balance']
'0.000 STEEM'

>>> s.get_account('abhi3700')['sbd_balance']
'0.603 SBD'

>>> s.get_account('abhi3700')['savings_sbd_balance']
'0.000 SBD'
```

#### Vesting
Basically, it defines the steem power.
Click [here](https://steemit.com/steemitguide/@steemitguide/steemitguide-what-exactly-is-vested-steem-why-is-it-important-for-you-know-how-smart-contracts-allocates-power-within-the) for details.
```python
>>> s.get_account('abhi3700')['vesting_shares']
'1038936.179712 VESTS'
>>> s.get_account('abhi3700')['delegated_vesting_shares']
'0.000000 VESTS'
>>> s.get_account('abhi3700')['received_vesting_shares']
'12358.959056 VESTS'
>>> s.get_account('abhi3700')['vesting_withdraw_rate']
'0.000000 VESTS'
>>> s.get_account('abhi3700')['next_vesting_withdrawal']
'1969-12-31T23:59:59'
```
Basically, I have never withdrawn my *steem-power*. The time itself indicates i.e. before Jan 1, 1970 ())
 
#### Bandwidth
It is the power to post, upvote, comment. The more Steem-power one has, the more steem-blockchain's bandwidth is owned by the user.
It is like holding a percent of the network.

```python
# Content post bandwidth
>>> s.get_account('abhi3700')['average_bandwidth']
'46792401000'

>>> s.get_account('abhi3700')['lifetime_bandwidth']
'677875000000'

>>> s.get_account('abhi3700')['last_bandwidth_update']
'2017-12-06T20:42:42'

**************************************************************************************************
# Market bandwidth
>>> s.get_account('abhi3700')['average_market_bandwidth']
1660341514

>>> s.get_account('abhi3700')['lifetime_market_bandwidth']
'24130000000'

>>> s.get_account('abhi3700')['last_market_bandwidth_update']
'2017-12-06T20:42:42'
```

#### Last post date
The date, time for last post.
```python
>>> s.get_account('abhi3700')['last_post']
'2017-12-03T13:20:21'
```

#### Witness votes
The witnesses I have voted for.
```python
>>> s.get_account('abhi3700')['witness_votes']
['steemed', 'utopian-io']
```
Basically, all the above discussed user properties can be viewed here-(https://steemd.com/@username)
![steemd_user.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512664879/wx2a8i2bsws3ejziszen.png)


That's all.

### Stay tuned for more such tutorials......

## View in [Github](https://github.com/abhi3700/My_Learning_Steem-Python/blob/master/Tutorials/2_Basic_commands.md)


<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@abhi3700/learn-steem-python-2-basic-commands">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorabhi3700
permlinklearn-steem-python-2-basic-commands
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":111191431,"name":"My_Learning-Steem","full_name":"abhi3700/My_Learning-Steem","owner":{"login":"abhi3700","id":16472948,"avatar_url":"https://avatars2.githubusercontent.com/u/16472948?v=4","gravatar_id":"","url":"https://api.github.com/users/abhi3700","html_url":"https://github.com/abhi3700","followers_url":"https://api.github.com/users/abhi3700/followers","following_url":"https://api.github.com/users/abhi3700/following{/other_user}","gists_url":"https://api.github.com/users/abhi3700/gists{/gist_id}","starred_url":"https://api.github.com/users/abhi3700/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhi3700/subscriptions","organizations_url":"https://api.github.com/users/abhi3700/orgs","repos_url":"https://api.github.com/users/abhi3700/repos","events_url":"https://api.github.com/users/abhi3700/events{/privacy}","received_events_url":"https://api.github.com/users/abhi3700/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abhi3700/My_Learning-Steem","description":"An incentivized content creation and curation based Blockchain","fork":false,"url":"https://api.github.com/repos/abhi3700/My_Learning-Steem","forks_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/forks","keys_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/teams","hooks_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/hooks","issue_events_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/issues/events{/number}","events_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/events","assignees_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/assignees{/user}","branches_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/branches{/branch}","tags_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/tags","blobs_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/git/refs{/sha}","trees_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/statuses/{sha}","languages_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/languages","stargazers_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/stargazers","contributors_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/contributors","subscribers_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/subscribers","subscription_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/subscription","commits_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/commits{/sha}","git_commits_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/git/commits{/sha}","comments_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/comments{/number}","issue_comment_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/issues/comments{/number}","contents_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/contents/{+path}","compare_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/merges","archive_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/downloads","issues_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/issues{/number}","pulls_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/pulls{/number}","milestones_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/milestones{/number}","notifications_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/labels{/name}","releases_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/releases{/id}","deployments_url":"https://api.github.com/repos/abhi3700/My_Learning-Steem/deployments","created_at":"2017-11-18T09:05:38Z","updated_at":"2017-11-26T17:28:21Z","pushed_at":"2017-12-06T23:14:03Z","git_url":"git://github.com/abhi3700/My_Learning-Steem.git","ssh_url":"git@github.com:abhi3700/My_Learning-Steem.git","clone_url":"https://github.com/abhi3700/My_Learning-Steem.git","svn_url":"https://github.com/abhi3700/My_Learning-Steem","homepage":"","size":794,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","score":14.329059},"pullRequests":[],"platform":"github","type":"tutorials","tags":["utopian-io","steemit","steem","python","steem-python"],"users":["abhi3700","someguy123","steemitguide","username"],"links":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1512731225/dqbbtwfoijy0avafgeb4.png","https://utopian.io/utopian-io/@abhi3700/learn-steem-python-1-installation-guide","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512602920/nwrzuxs3dadupw36eead.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512602979/ejppg7pr5ajiniitijsw.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512603030/jjpqzslh5z5qsd4cd734.png","https://steemit.com/steem/@someguy123/how-the-steem-account-recovery-works-and-why-your-trustee-can-t-steal-your-account","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512603104/gmdyplgadjatovjxodpg.png","https://steemit.com/steemitguide/@steemitguide/steemitguide-what-exactly-is-vested-steem-why-is-it-important-for-you-know-how-smart-contracts-allocates-power-within-the","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512664879/wx2a8i2bsws3ejziszen.png","https://github.com/abhi3700/My_Learning_Steem-Python/blob/master/Tutorials/2_Basic_commands.md"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1512731225/dqbbtwfoijy0avafgeb4.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512602920/nwrzuxs3dadupw36eead.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512602979/ejppg7pr5ajiniitijsw.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512603030/jjpqzslh5z5qsd4cd734.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512603104/gmdyplgadjatovjxodpg.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1512664879/wx2a8i2bsws3ejziszen.png"]}"
created2017-12-06 23:25:18
last_update2017-12-11 13:11:12
depth0
children4
last_payout2017-12-13 23:25:18
cashout_time1969-12-31 23:59:59
total_payout_value27.021 HBD
curator_payout_value10.374 HBD
pending_payout_value0.000 HBD
promoted0.010 HBD
body_length7,336
author_reputation1,411,436,389,304
root_title"Learn Steem-Python #2- Basic Commands"
beneficiaries
0.
accountarie.steem
weight46
1.
accountcnts
weight10
2.
accountfreedom
weight658
3.
accountknowledges
weight48
4.
accountnetuoso
weight6
5.
accounttransisto
weight70
6.
accountutopian-io
weight536
7.
accountxeldal
weight27
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id22,610,167
net_rshares11,501,131,465,524
author_curate_reward""
vote details (31)
@cossjourney ·
Great stuff and good detailled explanations with examples.
Now I have to find how I can use all this.. thanks !
properties (22)
authorcossjourney
permlinkre-abhi3700-learn-steem-python-2-basic-commands-20171209t234651255z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2017-12-09 23:46:51
last_update2017-12-09 23:46:51
depth1
children0
last_payout2017-12-16 23:46: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_length111
author_reputation21,865,275,894
root_title"Learn Steem-Python #2- Basic Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,937,829
net_rshares0
@flauwy ·
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorflauwy
permlinkre-abhi3700-learn-steem-python-2-basic-commands-20171207t221914183z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/1.0.0"}
created2017-12-07 22:19:36
last_update2017-12-07 22:19:36
depth1
children0
last_payout2017-12-14 22:19:36
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_length172
author_reputation296,259,911,900,510
root_title"Learn Steem-Python #2- Basic Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,710,918
net_rshares0
@utopian-1up ·
$0.16
<div class="pull-left">

![1up-logo.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512204274/pbwgsxljk7f8ql2slbs9.png)



</div>

<div class="text-justify">

<br>

You've got a <code>1UP</code> from the @utopian-1up curation trail. __22 Utopians__ have upvoted your quality contribution to the open source community. 

<code>[Join](https://steemit.com/utopian-io/@flauwy/steemy-ep-46-how-to-create-and-follow-a-curation-trail-with-steemauto) 1UP for better posts and high curation rewards.</code>

_1UP is neither organized nor endorsed by Utopian.io!_

</div>
👍  
properties (23)
authorutopian-1up
permlinkre-abhi3700-learn-steem-python-2-basic-commands-20171207t092828428z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.1.0"}
created2017-12-07 09:28:48
last_update2017-12-07 09:28:48
depth1
children0
last_payout2017-12-14 09:28:48
cashout_time1969-12-31 23:59:59
total_payout_value0.122 HBD
curator_payout_value0.039 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length570
author_reputation2,324,758,056,093
root_title"Learn Steem-Python #2- Basic Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,648,863
net_rshares44,357,498,029
author_curate_reward""
vote details (1)
@utopian-io ·
### Hey @abhi3700 I am @utopian-io. I have just upvoted you!
#### Achievements
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-abhi3700-learn-steem-python-2-basic-commands-20171208t102406227z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-08 10:24:06
last_update2017-12-08 10:24:06
depth1
children0
last_payout2017-12-15 10:24:06
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_length1,006
author_reputation152,955,367,999,756
root_title"Learn Steem-Python #2- Basic Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,758,805
net_rshares0