RiteTag API client.
Project description
RiteTag API client
Python API client
Documentation
Installation
pip install --user ritetag
Usage
In The Code
from ritetag import RiteTagApi
access_token = 'token'
client = RiteTagApi(access_token)
def limit_80_percentage_reached(limit):
message = 'Used {}% of API credits. The limit resets on {}'.format(limit.usage, limit.reset)
print(message)
# The callback function is triggered when 80% of the API limit is reached
client.on_limit(80, limit_80_percentage_reached)
stats = client.hashtag_stats(['jobs', 'hello'])
for data in stats:
print('#{}: {} tweets per hour'.format(data.hashtag, data.tweets))
output:
#jobs: 642 tweets per hour
#hello: 25 tweets per hour
In The Console
ritetag-api -h
usage: ritetag-api [-h] [-t ACCESS_TOKEN] [-m MAX_HASHTAGS] [-p {auto,end}]
[-f FILENAME] [-ci CTA_ID]
{hashtag_stats,auto_hashtags,hashtag_suggestions,hashtag_history,emojis_suggestion,auto_emojify,company_logo,list_of_cta,shorten_link}
[hashtags [hashtags ...]]
RiteTag API console client.
positional arguments:
{hashtag_stats,auto_hashtags,hashtag_suggestions,hashtag_history,emojis_suggestion,auto_emojify,company_logo,list_of_cta,shorten_link}
action
hashtags hashtags
optional arguments:
-h, --help show this help message and exit
-t ACCESS_TOKEN, --access_token ACCESS_TOKEN
access token
-m MAX_HASHTAGS, --max_hashtags MAX_HASHTAGS
-p {auto,end}, --hashtag_position {auto,end}
-f FILENAME, --filename FILENAME
-ci CTA_ID, --cta_id CTA_ID
export ACCESS_TOKEN={access_token}
ritetag-api hashtag_stats jobs hello
or
ritetag-api -t {access_token} hashtag_stats jobs hello
output:
Used 19.89% of API credits. The limit resets on 2020-04-01.
==== Stats of #jobs ====
tweets: 642
retweets: 62
exposure: 1984429
mentions: 9.03427%
links: 35.04673%
images: 35.04673%
color: HOT_NOW
media count: 3490073
==== Stats of #hello ====
tweets: 25
retweets: 4
exposure: 32567
mentions: 32.0%
links: 32.0%
images: 32.0%
color: HOT_NOW
media count: 18896544
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
ritetag-1.0.1.tar.gz
(9.6 kB
view details)
File details
Details for the file ritetag-1.0.1.tar.gz.
File metadata
- Download URL: ritetag-1.0.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43ebb870ba8954ebde0cb509d4fdf74f6603163877561441baa5154ac7368b5
|
|
| MD5 |
9f8881b23b68891b8e146a8d94e3bd7a
|
|
| BLAKE2b-256 |
80b047ff5eb58bcb9bd92bb819d83e7ccbde6d4f127292edae3e3c452bfb27ad
|