SteemConnect Python Client v0.0.2

in #utopian-io6 years ago (edited)

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".)

Screen Shot 2018-04-26 at 4.26.29 PM.png

Response of the URL mentioned.


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.

sc-python-client.gif

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

Sort:  

nice work mate 👊

Thanks for the contribution. It has been approved.

Very cool that you added a Flask example, will be very useful I'm sure!


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

Well done..
While I have just a ton of ideas, you have time to implement yours:)

Whats the status with remindMe bot? :)

Same.. Not any..
My schedule is filled to the top.. :(
Also nothing new on b bot, kehrwoche or tax thing.
Not even time for a witness update..

#remindme: 2018-04-26 18:00:00 UTC

You wanted to be reminded

#remindme: in two weeks

Hey @emrebeyler! Thank you for the great work you've done!

We're already looking forward to your next contribution!

Fully Decentralized Rewards

We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.

Utopian Witness!

Vote for Utopian Witness! We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

Want to chat? Join us on Discord https://discord.me/utopian-io

@emrebeyler Sir learn a lot of things. Carry on. God bless you.

Please don't spam my posts with comments. I will flag you next time.

Nice one mate, i just made a tutorial of SteemConnect v2 for javascript.
Have a good day mate ^^

Im learning alot with all your Dev posts, please keep it up!

Thnx for your time doing and sharing such a good info.

Brilliant!!!thanks for sharing such a nice information with neat and clean explaination!!!

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 61682.60
ETH 2986.38
USDT 1.00
SBD 2.51