steem-connect is the first python client of the SteemConnect
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
steemconnect
LICENSE.txt
README.md
setup.cfg
setup.py
test.py

README.md

Join and Contact us on Discord


steemconnect

The first python client of the SteemConnect

Getting Started

  • For general information about SteemConnect V2 and setting up your app please see this post from @noisy

How to configure SteemConnect v2 and use it with your application ann-introducing-python-social-auth-steemconnect-library-integrate-steemconnect-v2-in-your-python-app-in-5-minutes-design-pack-as

  • check this repository if you are looking for a python or django example that uses this library.

Django application - django_steemconnect Coogger-python | upvote bot

Installation

pip install steem-connect

update

pip install steem-connect - U

How to use it ?

First let's include the library in our project

from steemconnect.client import Client
from steemconnect.steemconnect import SteemConnect
from steemconnect.operations import Vote
from steemconnect.operations import CustomJson
from steemconnect.operations import Unfollow
from steemconnect.operations import Follow
from steemconnect.operations import Mute
from steemconnect.operations import Reblog
from steemconnect.operations import DeleteComment
from steemconnect.operations import ClaimRewardBalance
from steemconnect.operations import Comment
from steemconnect.operations import CommentOptions

c = Client(client_id:str, redirect_url:str, code=False, scope=None)
# scope is None : default scopes = "login,offline,vote,comment,delete_comment,comment_options,custom_json,claim_reward_balance"
# if code is True,you can get refresh_token using ,get_refresh_token()
c.get_authorize_url()
c.get_refresh_token(code:str, app_secret:str)
c.me(access_token:str)

Vote

The Vote() method will cast a vote on the specified post or comment from the current user:

vote = Vote(voter:str, author:str, permlink:str, weight:int)
response = SteemConnect(token="your_access_token", data=vote.operation).run
if response.status_code == 200:
    print("Your post upvoted")

Parameters:

  • voter: The Steem username of the current user.
  • author: The Steem username of the author of the post or comment.
  • permlink: The link to the post or comment on which to vote. This is the portion of the URL after the last "/". For example the "permlink" for this post: https://steemit.com/steem/@ned/announcing-smart-media-tokens-smts would be "announcing-smart-media-tokens-smts".
  • weight: The weight of the vote. 100 equale a 100% vote.

CustomJson

custom_json = CustomJson(required_posting_auths:str, custom_json_id:str, structure:json, required_auths:list)
response = SteemConnect(token="your_access_token", data=custom_json.operation).run
if response.status_code == 200:
    print("Your operation is success")

Follow

follow = Follow(follower:str,following:str)
response = SteemConnect(token="your_access_token", data=follow.operation).run
if response.status_code == 200:
    print("Your operation is success")

Unfollow

unfollow = Unfollow(follower:str,following:str)
response = SteemConnect(token="your_access_token", data=unfollow.operation).run
if response.status_code == 200:
    print("Your operation is success")

Mute

mute = Mute(follower:str,following:str)
response = SteemConnect(token="your_access_token", data=mute.operation).run
if response.status_code == 200:
    print("Your operation is success")

Reblog

reblog = Reblog(account:str, author:str, permlink:str)
response = SteemConnect(token="your_access_token", data=reblog.operation).run
if response.status_code == 200:
    print("Your operation is success")

Comment

comment = Comment(parent_author:str, parent_permlink:str,author:str,permlink:str,title:str,body:str,json_metadata:dict)
response = SteemConnect(token="your_access_token", data=comment.operation).run
if response.status_code == 200:
    print("Your operation is success")

Comment with Comment_options

comment_class = Comment(parent_permlink:str, author:str, permlink:str, title:str, body:str, json_metadata:dict)
comment_options = CommentOptions(
    comment_class = comment_class
    beneficiaries,
    max_accepted_payout:int, # default 100000.000
    percent_steem_dollars:int, # default 10000
    allow_votes:bool, # default True
    allow_curation_rewards:bool #default True
)

"""beneficiaries ex :
[
  {"account":"coogger.wallet","weight":500},
  {"account":"coogger.pay","weight":500},
  {"account":"hakancelik","weight":500}
]"""

response = SteemConnect(token="your_access_token", data=comment_options.operation).run
if response.status_code == 200:
    print("Your operation is success")

DeleteComment

delete_comment = DeleteComment(author:str, permlink:str)
response = SteemConnect(token="your_access_token", data=delete_comment.operation).run
if response.status_code == 200:
    print("Your operation is success")

ClaimRewardBalance

claim_reward_balance = ClaimRewardBalance(account:str, reward_steem:str, reward_sbd:str, reward_vests:str)
response = SteemConnect(token="your_access_token", data=claim_reward_balance.operation).run
if response.status_code == 200:
    print("Your operation is success")