Python bindings to automate requestrepo.com
Project description
requestrepo Python client
Python bindings to automate requestrepo.com
Installation
pip install requestrepo
Basic Usage
Instantiate the Requestrepo class:
from requestrepo import Requestrepo # Requestrepo, RequestRepo and requestrepo are accepted imports
client = Requestrepo() # new token printed to console
client = Requestrepo("your-token-here")
or via environment variables:
REQUESTREPO_TOKEN=token python your_script.py
Examples
Example 1: Async request retrieval via on_request
from requestrepo import Requestrepo
def on_request(request_data: dict):
print("New Request Received:", request_data)
client = Requestrepo(token="your-token-here")
print(client.subdomain) # abcd1234
print(client.domain) # abcd1234.requestrepo.com
client.await_requests()
Example 2: Synchronous request retrieval
from requestrepo import Requestrepo
client = Requestrepo(token="your_api_token")
print(client.subdomain) # abcd1234
print(client.domain) # abcd1234.requestrepo.com
# Get the latest request (blocks until one is received)
new_request = client.get_request()
print("Latest Request:", new_request)
Example 3: Retrieve old requests
You can iterate over all requests that are stored on the server:
from requestrepo import Requestrepo
client = Requestrepo(token="your_api_token")
for request in client.get_old_requests():
print("Request:", request)
client.delete_all_requests() # clear all requests on the server
Contributing
Contributions are welcome! Please submit a pull request or open an issue if you have any ideas or suggestions.
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file requestrepo-0.0.8.tar.gz.
File metadata
- Download URL: requestrepo-0.0.8.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
146ef206c4382d6e3e06f94452bf540e8f3b3f5829a04588fd6f1c847b4c3931
|
|
| MD5 |
3449db784df28b92a0a3abdff13230f1
|
|
| BLAKE2b-256 |
c4feb56449a0b98d0424753e659b6d5b5e16f7850f8df35136d8c8e5c9678c3c
|
File details
Details for the file requestrepo-0.0.8-py3-none-any.whl.
File metadata
- Download URL: requestrepo-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49b4d94c92a97950cf82b058bdfe88ac06537f9b7e41bdb64ea0e996449cfce5
|
|
| MD5 |
8c0294e464b7b7e7a980d3e8f3e09861
|
|
| BLAKE2b-256 |
a32d087e4686b8657bfd1dbc23ae14aa504422812e3ed8dc597927a046e4db3b
|