Installation
Install the package from PyPi with pip3 install redisgetapi.
Usage
The redis-get-api package comes handy when you want to use api endpoints that have restricted rate limits. It does
exactly that by enforcing rate limits while preserving persistence in the local redis database for the required time limit.
For instance if you are building upon twitter, and you intend to search tweets, you are only allowed say 450 requests within any
15 minutes (900 seconds) interval. This package will fetch the first result and cache it for the next 15 minutes when you are not allowed to hit the twitter API
directly.
Requirements and parameters
You must install redis to use this application. You can use the application as a commandline interface for testing purposes, or within your scipt. The default parameters for redis host and port are 'localhost' and 6379 respectively. The other parameters are
the url to be fetched and the expiry in seconds.
Specific use case
Let the parameters be:
url = 'http://some/url/with/{your_api_key}/and/some/end_point/'
port = 6379 # unless you have your redis-server in a different port, this is the default
host = localhost
expiry = 300 # this is 5 minutes in seconds
Call the application as follows
from redisgetapi.fetch import RedisEndPoint, cli_call, script_call # there are more functions there
Then you can define the function in your script as follows:
def NgrokUrl(url,host,port,expire):
return script_call(url,host,port,expire)
print(NgrokUrl(url,host,port,expire))
NB: The default variable in which redisgetapi is holding the response is 'res'
Metadata
Release files for redisgetapi 0.0.1
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 | |
|---|---|---|---|---|
| redisgetapi-0.0.1.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| redisgetapi-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / redisgetapi-0.0.1.tar.gz
| Download URL | redisgetapi-0.0.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2160d7ae8a73de49c064f50513b2db941fa2cc569c61fff651b8fadbea1414be
|
|
BLAKE2b-256 checksum How to use checksums |
3a823747232b97c7cc948befac17ac3d54691b6a51c8621d0fb2e0896c21012e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / redisgetapi-0.0.1-py3-none-any.whl
| Download URL | redisgetapi-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd6487d8722841b38a28488c8747e9df765d5c16f92852251c4c1411479bf0a7
|
|
BLAKE2b-256 checksum How to use checksums |
295866a712394f006a5cfe63967c7f1a057e6390084442ca6f46862be58cd81a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for redisgetapi 0.0.1
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.