Skip to main content

twitter_user_emulator

A simple Python package that wraps scweet and gpt-2-simple to allow easy tweet generation based on any existing Twitter account.

The idea of this project is to let anyone unfamiliar with GPT-2 to create their own Twitter bot emulating an existing account (e.g., Deep Leffen, Deep Slacks Bot, Deep Bumpaah Bot) in a single API call. The library handles all boilerplate code and basic hyperparameter tuning involved, allowing the user to spend that time curating tweets they want instead.

Install

twitter_user_emulator can be installed via PyPi:

pip3 install twitter_user_emulator

To enable GPU usage for faster training (recommended), a version of Tensorflow 2.X (min 2.5.1) must be installed on your system.

Usage

An example API call:

from twitter_user_emulator import emulator

emulator.emulate_user(user="bumpaah", start_date="2020-01-01", end_date="2021-01-01", out_tweets=2000)

This piece of code will download and train a gpt-2 model to generate 2000 tweets based on all the tweets user @bumpaah made between 2020-01-01 and 2021-01-01.

The model will fail to train if there are not enough tweets as input. Please try to pick a time range with at least 500 tweets.

Colab Notebook

A notebook tutorial that goes over the underlying logic of this implementation can be found here.

License

MIT

Disclaimer

This repo has no affiliation with OpenAI or Twitter.

Metadata

Release files for twitter-user-emulator 0.0.2

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

Source distribution (sdist)

Source distribution for twitter-user-emulator 0.0.2
File Size Uploaded Provenance Actions
twitter_user_emulator-0.0.2.tar.gz 4.5 kB Without provenance Details for twitter_user_emulator-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for twitter-user-emulator 0.0.2
File Interpreter ABI Platform Actions
twitter_user_emulator-0.0.2-py3-none-any.whl Python 3 none any Details for twitter_user_emulator-0.0.2-py3-none-any.whl

Total release size: 10.8 kB

Release files / twitter_user_emulator-0.0.2.tar.gz

Download URL twitter_user_emulator-0.0.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eae51ac65e8131ee11b753e8932144de6411ca797535dc011b94983fcad4dac0
BLAKE2b-256 checksum
How to use checksums
31666db53f69204ab48d89c873a0133547828f9df8827c085e0134befa8efe0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release files / twitter_user_emulator-0.0.2-py3-none-any.whl

Download URL twitter_user_emulator-0.0.2-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a8c1f46fb78534bff9f5a287fcc6edbbae1708686ed5221128873bc198347fe
BLAKE2b-256 checksum
How to use checksums
935f137f30ba3cedeba1d94ae57ffa026b417a377631fd27d8c87212ce0a4b2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Security for twitter-user-emulator 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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