Skip to main content

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


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.5.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

pytweetql-0.5.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file pytweetql-0.5.0.tar.gz.

File metadata

  • Download URL: pytweetql-0.5.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11

File hashes

Hashes for pytweetql-0.5.0.tar.gz
Algorithm Hash digest
SHA256 e0ee74c730e47426aeae47945dc994259ce5245e0356f431947cdd7a6da6b770
MD5 c54468f01a0982664d5f6211e08c32fa
BLAKE2b-256 4d44fd29479fcd914149d9db7df6936a94e0ca65d9d890e42bdd158a35f77276

See more details on using hashes here.

File details

Details for the file pytweetql-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pytweetql-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11

File hashes

Hashes for pytweetql-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 211d2ec8ce9a4f9c1ad4c22fc34f911a8ec8f4d80b0c51ead6912cfbf3d90a97
MD5 dc6809ca0fbfdcc03bc13e1339880920
BLAKE2b-256 c365a95badef966be8a9e4d60850509e08fd6f03be65da5ec2750cd7d6a193a5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page