I have introduced the steemconnect-python-client last week and it got amazing feedbacks and today, we have a new version fully support SteemConnect api.
New Features
1. Revoking the access token
This method revokes the passed access token. You may need to revoke tokens if
- the user don't want to authorize with your application any more
- if the token is compromised or behaving malicious
- you want to disable all tokens for the application
etc.
Usage:
client.revoke_token("access_token")
2. Updating user metadata
This method uses the /me endpoint listed at sc2 api. You can update the users' profile with this helper method:
metadata = {
"profile": {
"name": "Emre",
"location": "Istanbul, Turkey",
"about": "Developer, STEEM witness.",
"profile_image": "http://foo.bar/image.png"
}
}
resp = self.c.update_user_metadata(metadata)
Note: This method requires client.access_token.
3. Hot Signing Links
hot_sign() method creates a SteemConnect specific URL which you can redirect users and expect them
to broadcast operations are not supported in the api. (transfer, create_delegation, etc.)
It has an optional redirect_uri parameter. If you pass that information, SteemConnect will redirect
the user to that URL after the operation succeeds.
Example usage:
url = self.c.hot_sign(
"transfer",
{
"to": "emreberyler",
"amount": "0.001 SBD",
"memo": "Donation",
},
redirect_uri="http://localhost"
)
This will generate this URL, (which sends 1 SBD to me with a memo as "Donation".)
With this change, steem-connect-python client supports everything for SteemConnect and it's fully compatible with steemconnect-js-sdk.
Bonus
I have also added a simple Flask application to demonstrate login logic with SteemConnect.
Roadmap
Library is on a mature state at the moment. All endpoints are supported. I am not %100 happy with the wrapping on operations type for /broadcast api.
I will probably work on that for the next release.
How to contribute
Contribution process is same with any other open-source project. You can checkout open issues at Github and can start working on it. Just make sure, you will comment on the related issue before starting working on it.
Also, run unit tests before creating a pull request and make sure it's all green.
How to update to 0.0.2?
$ (sudo) pip install -U steemconnect
Related Commits
Posted on Utopian.io - Rewarding Open Source Contributors