Mastadon.py is a python api client for mastadon that makes it easy to cross post to mastadon.
from mastodon import Mastodon
Mastodon.create_app(
'pytooterapp',
api_base_url = 'https://mastodon.social',
to_file = 'pytooter_clientcred.secret'
)
from mastodon import Mastodon
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',)
mastodon.log_in(
'[email protected]',
'incrediblygoodpassword',
to_file = 'pytooter_usercred.secret'
)
mastodon.toot('Tooting from Python using #mastodonpy !')