Skip to main content

av-tweet-ingestion

Ingestion of tweets using Twitter's RecentAPI and upload to S3.

Installation

pip install av-tweet-ingestion

Usage example - Twitter Recent API


Setup Environmental Variables

BEARER_TOKEN="<twitter_bearer_token>"

S3_ACESS_KEY="<acess_key>"

S3_SECRET_KEY="<secret_key>"

S3_BUCKET_NAME="<bucket_name>"

S3_LANDING_LAYER="<landing_zone>"


Define Query

Build query to request tweets.

https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query


query_params = {

'query': 'from: elonmusk',

'user.fields':'id,location,name,public_metrics,created_at',

'tweet.fields': 'author_id',

# 'expansions':'geo.place_id,author_id,entities.mentions.username,in_reply_to_user_id,referenced_tweets.id.author_id',

'max_results':'10'

}


Ingest

Imports

from ingestion.apis import RecentAPI
from ingestion.ingestors import BatchIngestor
from ingestion.writers import S3Writer

BatchIngestor(query_params, # Query

1, # Number of pages to ingest

RecentAPI, # Titter's API to call

'test/RecentAPI', # Set address to save data

S3Writer).ingest() # Writer to be used

Contributing

  1. Fork it (https://github.com/andreveit/av-tweet-ingestion/fork)

  2. Create your feature branch (git checkout -b feature/fooBar)

  3. Commit your changes (git commit -am 'Add some fooBar')

  4. Push to the branch (git push origin feature/fooBar)

  5. Create a new Pull Request

Metadata

Release files for av-tweet-ingestion 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for av-tweet-ingestion 1.0.5
File Size Uploaded Provenance Actions
av-tweet-ingestion-1.0.5.tar.gz 5.5 kB Without provenance Details for av-tweet-ingestion-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for av-tweet-ingestion 1.0.5
File Interpreter ABI Platform Actions
av_tweet_ingestion-1.0.5-py3-none-any.whl Python 3 none any Details for av_tweet_ingestion-1.0.5-py3-none-any.whl

Total release size: 12.8 kB

Release files / av-tweet-ingestion-1.0.5.tar.gz

Download URL av-tweet-ingestion-1.0.5.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8870f210ec2a63009be59ab8fe15777f99dd2e474e345ca519b66c9e988caad1
BLAKE2b-256 checksum
How to use checksums
f27e7d6e86059fa2fe573c03cc8d1f7c2621f2871b68960484648c38b90b5f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / av_tweet_ingestion-1.0.5-py3-none-any.whl

Download URL av_tweet_ingestion-1.0.5-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2758a47004f42b5aa300112836af51c215dfe5fed2d622a170db8a441127ca02
BLAKE2b-256 checksum
How to use checksums
0365d701c1d710fe8a5328c5008ad749029ff59a0e1f0964c5822c067349cff4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for av-tweet-ingestion 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page