Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pabluk/twitter-application-only-auth
A simple Python implementation of the Twitter Application-only authentication
https://github.com/pabluk/twitter-application-only-auth
application-only-authentication oauth2 python twitter
Last synced: about 2 months ago
JSON representation
A simple Python implementation of the Twitter Application-only authentication
- Host: GitHub
- URL: https://github.com/pabluk/twitter-application-only-auth
- Owner: pabluk
- Created: 2013-04-03T22:01:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T21:45:09.000Z (about 2 years ago)
- Last Synced: 2024-10-13T15:45:23.619Z (2 months ago)
- Topics: application-only-authentication, oauth2, python, twitter
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 40
- Watchers: 3
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
twitter-application-only-auth
=============================A simple implementation of the Twitter Application-only authentication
https://developer.twitter.com/en/docs/basics/authentication/overview/application-only
that offers applications the ability to issue authenticated requests on behalf
of the application itself (as opposed to on behalf of a specific user).Tested with Python 2.7 and recent versions of 3.x
[![Build Status](https://github.com/pabluk/twitter-application-only-auth/workflows/Tests%20and%20coverage/badge.svg)](https://github.com/pabluk/twitter-application-only-auth/actions)
[![Coverage Status](https://coveralls.io/repos/github/pabluk/twitter-application-only-auth/badge.svg?branch=master)](https://coveralls.io/github/pabluk/twitter-application-only-auth?branch=master)Install
-------```
pip install twitter-application-only-auth
```Usage
-----```python
import json
from application_only_auth import Client# The consumer secret is an example and will not work for real requests
# To register an app visit https://dev.twitter.com/apps/new
CONSUMER_KEY = "xvz1evFS4wEEPTGEFPHBog"
CONSUMER_SECRET = "L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg"client = Client(CONSUMER_KEY, CONSUMER_SECRET)
# Pretty print of tweet payload
tweet = client.request("https://api.twitter.com/1.1/statuses/show.json?id=316683059296624640")
print(json.dumps(tweet, sort_keys=True, indent=4, separators=(",", ":")))# Show rate limit status for this application
status = client.rate_limit_status()
print(status["resources"]["search"])
```Real-World use cases
--------------------* [Tweet Dump](https://tweetdump.debugstack.com/): dump and inspect your tweet data!
Development
-----------To contribute to this project or to test this library locally you'll need to install these dependencies:
```bash
python3 -m venv venv # for example on a virtual environment
source venv/bin/activate
pip install -r requirements-test.txt
pip install black
```and you can validate your changes running:
```bash
python -m pytest --verbose
black . --line-length=120 --check --diff
```Authors and contributors
------------------------* [Pablo Seminario](https://github.com/pabluk)
* [Rafael Reimberg](https://github.com/rreimberg) for the initial setup.py
* [Chris Hawkins](https://github.com/ChrisHawkins) for Python 3.4 support