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
Company logo API (console)
Example 1 - google.com
# Company logo example
ritetag-api -t {token} company_logo google.com
Looking for logo - google.com
Used 0.14% of API credits. The limit resets on 2021-06-01.
Downloading logo - google.com
Image is saved google_com.svg - google.com
Downloading square logo - google.com
Image is saved google.com - google_com_square.png
Example 2 - notfound.test with Generate fallback
# Company logo example
ritetag-api -t {token} company_logo -g 1 company_logo notfound.test
Looking for logo - notfound.test
Used 0.14% of API credits. The limit resets on 2021-06-01.
Logo is generated.
Downloading logo - notfound.test
Image is saved notfound_test.png - notfound.test
Downloading square logo - notfound.test
Image is saved notfound.test - notfound_test_square.png
Example 3 - notfound.test without Generate fallback
# Company logo example
ritetag-api -t {token} company_logo -g 0 company_logo notfound.test
Looking for logo - notfound.test
Used 0.14% of API credits. The limit resets on 2021-06-01.
Downloading logo - notfound.test
Error Logo not found - notfound.test
Downloading square logo - notfound.test
Error Logo not found - notfound.test
Metadata
Release files for ritetag 1.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ritetag-1.3.3.tar.gz | 24.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ritetag-1.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.9 kB
Release files / ritetag-1.3.3.tar.gz
| Download URL | ritetag-1.3.3.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1216d87ac67abb3c6042efd000e536d30c131a50b382e5d291bde4b62fae892b
|
|
BLAKE2b-256 checksum How to use checksums |
8c067e6f7d67816833c01a086a11b557bcd4deb5369fa9c68cefed6142c70ea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|
Release files / ritetag-1.3.3-py3-none-any.whl
| Download URL | ritetag-1.3.3-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4258c4861caa3125e4d23959ac2200bb1c7c2a17b2f612382dba04c678392a9e
|
|
BLAKE2b-256 checksum How to use checksums |
fac90a39035d30fc1042d0f6d0b7fdc6a7226eea6d163109445f302acc4fe69e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|
Security for ritetag 1.3.3
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.