Easy parsing of Twitter GraphQL API responses
Project description
pytweetql
pytweetql is a simple Python package designed for developers who work with the Twitter GraphQL API
Currently it is built to parse tweet, user, and list GET responses from the Twitter GraphQL API. The function to call is based on the GraphQL endpoint. So for the UserTweets endpoint, you would import the parsing
module and use the parse_user_tweets()
function.
How it Works
from pytweetql import parsing
# Given a response from GraphQL
response = {'data': {.....}}
# To pull data from a tweet response
tweets = parsing.parse_user_tweets(response=response)
# Will return a list of tweet classes, one for each tweet parsed
print(tweets.tweets)
# To pull data from a user response
users = parsing.parse_users_by_screen_name(response=response)
# Will return a list of user classes, one for each user parsed
print(users.users)
# To pull data from a list response
lists = parsing.parse_create_list(response=response)
# Will return a list of list classes, one for each list parsed
print(lists.lists)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytweetql-0.8.0.tar.gz
(12.8 kB
view details)
Built Distribution
pytweetql-0.8.0-py3-none-any.whl
(19.4 kB
view details)
File details
Details for the file pytweetql-0.8.0.tar.gz
.
File metadata
- Download URL: pytweetql-0.8.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92455335b11d01b3d806268b702b2cd5a74a4429443c0060794de302387e5de5 |
|
MD5 | 6e2462387b356f94802019c7f0480838 |
|
BLAKE2b-256 | 36cb80a97f8d69774daa864b0aff5004fbc30c8e437fab8e4263c11bf67e208f |
File details
Details for the file pytweetql-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: pytweetql-0.8.0-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b1aeb910622f5e98d68d32f4dee99e0fe32e0b85b34c6444e8f6d9a066629c |
|
MD5 | 7273462e7db3ab1e31edc2155b039d91 |
|
BLAKE2b-256 | b4176e8534aa6b2c2d2bb6e0fe792fefffcc1e8ab69db77abd2d834cd7cefa1a |