Skip to content

minamorl/staccato

Repository files navigation

logo staccato

Twitter API wrapper for Python 3

PyPI version

Circle CI

Installation

pip install staccato

Example

import staccato

# oauth1 authentication.
api = staccato.startup()
api.auth(consumer_key, consumer_secret, access_token_key, access_token_secret)

# update status
response = api.statuses_update(status="Hello, world!")

# response object is simply JSON-parsed value.
print(response)

# And you can also do this...
api.statuses_destroy(response['id'])

# Userstream. (>=0.1.2)
for parsed in api.user_stream():
  print(parsed) # Decoded json data

PIN-based auth (>=0.0.6)

api = staccato.startup()
api.auth(consumer_key, consumer_secret)

url = api.generate_auth_url()
print(url)
pin = raw_input()

print(api.pin_auth(pin))

response = api.statuses_update(status="Hello, world!")
print(response)
api.statuses_destroy(response['id'])

TODO:

  • utility function of POST media/upload (chunked) for user convinience.

About

Twitter API wrapper for Python3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages