What is Steem-python
Steem-python is a python framework build by the legendary @furion which has been adopted as the official python framework for Steem.
You can find the project on Git Hub.
Many bots and services use Steem-python to communicate with the Steem blockchain. The other popular library is SteemJS for Javascript.
Installing Python
To use Steem-python you need to have python installed. Most distributions have their own installation of python and it is highly likely it is already installed. I do not recommend using the default version of python and install a localized version of python that has better support and better tools.
We are going to install Anaconda which is the python distribution that is used by most data scientists and machine learning developers. Unless you are also doing machine learning, I would recommend using miniconda as it only installs a minimum amount of modules.
You can find the latest version of mini conda on their website.
At this time, the latest 64 bit Linux version is: Miniconda3-latest-Linux-x86_64.sh
Download miniconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
Set execute permissions
chmod +x Miniconda3-latest-Linux-x86_64.sh
Run installation
./Miniconda3-latest-Linux-x86_64.sh
During the installation, you will be asked to approve the license, the location, and if you want to update your bash profile script. The last question asking to update your bash profile is set to no, I recommend specifying yes
so that the path to the binaries are updated in your bash profile.
Once the installation is finished, log out of SSH and log back in to update your path variable.
Install dependencies
sudo apt install libffi-dev libssl-dev
Install Steem-python
The official steem-python distribution isn't updated very often and I recommend installing @furion's version of Steem-python. In fact the official version of Steem-python is originally @furion's work.
python3 -m pip install -U git+git://github.com/Netherdrake/steem-python
Optional (Install bPython)
bpython is a replacement for the python interactive console. It has syntax highlighting and some additional features like code intelligence. It is really helpful when working interactively with Python.
python3 -m pip install -U bpython
Test installation
If you installed bpython
bpython
If not
python
Enter the following program:
from steem import Steem
steem = Steem()
steem.get_account('ned')
If you see JSON returned, you are good to go!
My recent popular posts
- How curation rewards work and how to be a kick ass curator
- Markdown 101 - How to make kick ass posts on Steemit
- Work ON your business, not in your business! - How to succeed as a small business
- You are not entitled to an audience, you need to earn it!
- How to properly setup SSH Key Authentication - If you are logging into your server with root, you are doing it wrong!
- Building a Portable Game Console
That gives me an idea.
I hope you will not beat me to it:
steem-python the hard way, compiled by hand.. On Debian Wheezy..
:))
Nice post beautiful presented and explained.@themarkmark thanks for dawonload link and total very helpfull information sir
Yes good boss @anak123
Thank you so much @themarkymark. This post has helped a great deal. I feel like I could get better using the python programming lang.
I'm new here. Check out my page and vote me✌
Thanks for this great and vital information, it'll come in handy and very vital to a lot of persons most especially the developers, programmers or coders.
Most especially, I've learnt from this ☝️as I didn't know about this before now.
Thanks for sharing this and
Happy Steeming
owo excellant post sir @themarkmark thanks for install information
I dont have a PC yet! Hopefully i can someday get one with my earnings from this great community
Thanks for sharing this, @furion did talk about the steem pyton in one of his recent posts.
Hello @themarkymark..
I was not interested in this steem-python to tell you honestly..ill just drop by to say..
You already cast my vote as a witness.😀
Thanks ;)
Thanks @themarkymark for that short explanation on python
Hello @themarkymark, I am a new member in steemit and have not understood with the work of this application, what results will I get for my account if I use this application? please guidance his 😊
If you have to ask that, you can safely ignore this post.
Thank you so so much these information was really helpful to me
Thank you
well explined !! thanq :)
This post has received gratitude of 6.16 % from @appreciator thanks to: @themarkymark.
This development will trigger me the more to work hard and earn more on steemit so i can get a system to enable me to use this app. Thumbs up @themarkymark
These posts are so important to get techy guys interested in programming for our beloved platform. Thanks for doing this, I will forward the link to some programmers I know who are looking for a way in.
t.
Downloading steem-python now!!... it sounds very useful to me.
Is there anything that can't be done in Phyton.
Prepare some coffee...? Ok, yes, Python operated...
This post has been deemed resteem & upvote worthy by your friendly @eastcoaststeem ran by Steemian @chelsea88
Thanks
Your post is helpful
@syedazunaira250
Great! Once i'm done with my data science projects and then a couple of MQL4 ones it's time to explore the steem blockchain.
@themakymark is there any platform or discord server for mentoring the programmers for blockchain??
SteemDevs is the programmer's Discord for Steemit.
Few days ago I had a problem, I could not get steem-python work on my Linux computer. (Manjaro) I tried all posted solutions and nothing worked until I saw, this solution you mentioned to someone else few days ago:
This is what finally did it for me. Thanks
Thanks! Can't wait to try it out!
Thanks for posting!
It helped me to resort https://github.com/p-alik/steemBot
Edit: This is good work, thank you for answering my questions/concerns relating to this.
For anyone that attempts this method, I just loaded up a vbox to try it (ubuntu 16.04) and confirm it works. I received some errors with the command
python3 -m install -U git+git://github.com/Netherdrake/steem-python
stating the python3 had no module install. Miniconda installs a pip client so you can simply usepip install git+git://github.com/Netherdrake/steem-python
and you will have the same results but the reason for the error is in the miniconda environment configuration you have to allow it to source to pip first. You should also be able to use theconda install -U git+git://github.com/Netherdrake/steem-python
command and receive the same result (you do not need the -m for conda as you do not need to forward the module into it)A few problems with this tutorial there @themarkymarkOne of the things is that there is still a dependency issue with TOML where it says it requires a version that technically doesn't exist.
Second, and more importantly, is the steem-python library (unless set otherwise with the steem-cli wallet) automatically attempts to connect to depreciated servers.
Now unless these issues have been changed in the past, Idk, 7 days (I had to format my hard drive and reinstall it, 7 days ago and fix these issues) then your tutorial is misleading and will lead to a lot of errors that are going to frustrate first time devs. It is also important to note that steem-python runs on python3.6 (and later) and this important note comes from you using the
python
command when it is more accurate to statepython3.6
as many linux systems (like ubuntu) come with python2.7.X preinstalled and is using it for system dependencies (meaning uninstalling will lead to problems) and defaults thepython
command topython2.7
This can be fixed using the command:
alias python=python3.6
However this fix may lead to issues when the OS goes to run one of the system python scripts as some configurations use the
python
default command instead of the version specific. This can be changed with configurations (and I believe was fixed a few version back in ubuntu but other distros may still have problems)This isn't a criticism or stating that you are incorrect, just stating that there is some information that is potentially crucial for new users (like the ones that will need a tutorial on installing this) and that without it.
These issues are resolved in @furion’s version and conda, but something I would do manually with the official version.
Okay, I didn't realize the TOML issue (or the default node) were changed in furions version, my bad.
Yeah, did it by hand before and helped many people doing it for their witness feeds and it was a huge pain. The nodes are fixed as well in this version but I still set them to my own full node and the ones I choose as api.steemit.com is very buggy.
Sorry the pip was left out in the command so it was looking for install module not pip. I fixed it after I posted it but it didn’t seem to save.
python3 -m pip install
I use that because I want to be sure it is using conda’s python and not system. Conda works as well but wanted to keep it simple.
No worries, I am glad it got fixed to prevent any confusion!
As I said there was a way to bypass this with environment configurations but I thought that would be more confusing to post about. Thanks for making this btw, it will likely help others out a lot!
Yeah didn't want to touch ENVs as I wanted to keep it simple and most people won't be using them.
The git version by furion fixes this issue. I installed it recently.
Plus installing the latest Miniconda3 should have the newest python. Do not remember if i needed to upgrade it after.
I have never used miniconda3 (I am not a big fan of python to begin with so I do not see why I would download more stuff for it 🍌)
But there is some fear, if it updates the default alias, as many systems are configured to call python to run python2.7 scripts so if you are on a misconfigured system (a lot are) then you run the risk of many system errors if this method overrides the default alias.
yes, but it is only for the local user as it is a localized version and not systemwide.
Okay that makes more sense. My apologies
good