Skip to main content

Tweettr - thin attrdict like wrapper around (a few) Tweet objects

PyPI PyPI - Downloads MIT license GitHub issues Github Sponsors

Tweettr gives you a convenient attribute interface to (some) tweet objects without any copying overhead. And if your editor or IDE understands type annotations it let's you do attribute auto completion.

It also add a way to provide emoji parsing with a similar interface to .entities.hashtags. :sparkling_heart:

So when you receive a json object from the twitter streaming api you can access it in a nicer way:

# json blob returned from twitter streaming api
{
  "id": 11223344556677889900,
  "id_str": "11223344556677889900",
  "created_at": "Sun Feb 16 13:16:19 +0000 2020",
  "user": {
    "id": 11223344556677889900,
    "id_str": "11223344556677889900",
    "screen_name": "AAAAAAAA",
    # ...
  },
  "entities": {
    "hashtags": [{
        "indices": [12, 21],
        "text": "MyHashTag"
      }]
  },
  "text": "Hello World #MyHashTag",
  "favorite_count": 0,
  "favorited": false,
  "timestamp_ms": "1500000000000",
  "truncated": false,
  # ...
}

becomes:

>>> import tweettr
>>> tweet = tweettr.Tweet(json_blob)
>>> tweet.user.id
11223344556677889900
>>> tweet.user.screen_name
'AAAAAAAA'
>>> tweet.emojis  # extract emojis like HashTags and Urls...
[Emoji(...), Emoji(...)]
>>> ...  # etc, etc... 

Release files for tweettr 0.1.0

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

Source distribution (sdist)

Source distribution for tweettr 0.1.0
File Size Uploaded
tweettr-0.1.0.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tweettr 0.1.0
File Interpreter ABI Platform
tweettr-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / tweettr-0.1.0.tar.gz

Download URL tweettr-0.1.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e7334eeb8808f485e49317ea467be39571c9408bc1ffc96d5008722a9bd5ae29
BLAKE2b-256 checksum
How to use checksums
1b4652e7774c4329e1c0680f161981898eb40ae4c2ea0c34359e37e8e521267c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200102 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

Release files / tweettr-0.1.0-py3-none-any.whl

Download URL tweettr-0.1.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
055b1d6a6d50fd2a4bfa3052f1b5bb517cf4672ad4b639fff1e1f8742bb53681
BLAKE2b-256 checksum
How to use checksums
c20a020e21028a83e1e0a9a69e6567b3765175b0343c70eb875156e1f09ed8e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200102 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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