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

  1. Instantiate the Requestrepo class:
from requestrepo import Requestrepo  # Requestrepo, RequestRepo and requestrepo are accepted imports

client = Requestrepo() # if token is not provided via the constructor or REQUESTREPO_TOKEN environment variable, a new one will be generated and printed to stderr
client = Requestrepo("your-token-here")

or

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")

client.await_requests()

Example 2: Synchronous request retrieval

from requestrepo import Requestrepo

client = Requestrepo(token="your_api_token")

# Get the latest request (blocks until one is received)
new_request = client.get_request()
print("Latest Request:", new_request)

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.1.tar.gz (4.9 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.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: requestrepo-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 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.1.tar.gz
Algorithm Hash digest
SHA256 14797772f6d8e165c47bc250f30cc62e0340144feba57a364e2148ba534d4acc
MD5 d08bb9a0afe4301e4f3b499735d2921a
BLAKE2b-256 9d81139c85348593738ad7eae13aa87c21f3cc999c5b69681431d18e700d7e79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: requestrepo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c0761910ac0355e1a196069dafd089f495af852960220e453904f2def385463
MD5 a5a24212d574181d801ad71ad9d43cbf
BLAKE2b-256 23b74bcc0b473d52ef5d1084396521d9ab67b200d95bc0cb20de541409999ba2

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