Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requestrepo-0.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requestrepo-0.0.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file requestrepo-0.0.3.tar.gz.

File metadata

  • Download URL: requestrepo-0.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.16

File hashes

Hashes for requestrepo-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8c66acb1f9849e2967ec2acea5db169d626bb5e2995a8283adbe2a6b82192712
MD5 f4c4848f26241a58fabc392ab70f01c0
BLAKE2b-256 cd489f35cbb2b727033b4c21fb99208f857735365880d43ac127cf38532635c3

See more details on using hashes here.

File details

Details for the file requestrepo-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: requestrepo-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.16

File hashes

Hashes for requestrepo-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b2f487b77142fea34307e20753a361713e8c9efe445b98fa9f39e828b7ae1ee
MD5 cfcec9242c46783fdb40b53acb59b65a
BLAKE2b-256 26b524baf145670bcd08bf6cdeca437e5dac1fbf47c2c7cef6a552f590c04439

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page