EtuDataProc
EtuDataProc is a Python library designed to simplify interaction with a queue service API. It provides methods for authentication, sending codes to the queue, retrieving results, checking queue positions, and canceling tasks. This README serves as a guide to using the QueueClient library effectively.
Installation
Install the current version with PyPI:
pip install etudataproc
Or from Github:
pip install https://github.com/sesh00/etudataproc/archive/main.zip
Usage
Importing the QueueClient
To use QueueClient in your Python code, import it as follows:
from etudataproc import QueueClient
Initializing the QueueClient
You can initialize a QueueClient object by providing the base URL of the queue service and optionally the authentication token.
queue_client = QueueClient(base_url="https://your-queue-service-url.com", token="your-auth-token")
Authentication
You can authenticate with the queue service using your username and password.
queue_client.authenticate(username="your-username", password="your-password")
Sending Code to the Queue
To send a code to the queue, use the send_code() method.
code = "your-code-to-be-sent"
queue_client.send_code(code)
Retrieving Result
To retrieve the result of a task from the queue, use the get_result() method.
result = queue_client.get_result()
Checking Queue Position
You can check your position in the queue using the get_queue_position() method.
position = queue_client.get_queue_position()
Canceling Task
To cancel a task in the queue, use the cancel_task() method.
queue_client.cancel_task()
queue_client.cancel_task()
Error Handling
If authentication or token-related errors occur, QueueClient raises an Exception with an appropriate error message. Ensure to handle these exceptions appropriately in your code.
Example
Here's a simple example demonstrating the usage of QueueClient:
from etudataproc import QueueClient
queue_client = QueueClient(base_url="https://your-queue-service-url.com")
queue_client.authenticate(username="your-username", password="your-password")
code = "your-code-to-be-sent"
queue_client.send_code(code)
result = queue_client.get_result()
print("Task Result:", result)
position = queue_client.get_queue_position()
print("Queue Position:", position)
queue_client.cancel_task()
Contributing
Contributions to EtuDataProc are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.
License
The module is available as open source under the terms of the MIT License
Metadata
Release files for etudataproc 0.1.2
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 | Actions |
|---|---|---|---|---|
| etudataproc-0.1.2.tar.gz | 4.1 kB | Without provenance | Details for etudataproc-0.1.2.tar.gz |
Release files / etudataproc-0.1.2.tar.gz
| Download URL | etudataproc-0.1.2.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54ecf85606796357c2a3da9efc8a488366f2cd4e380275f86d93b4695f23cb21
|
|
BLAKE2b-256 checksum How to use checksums |
2eb64537d2cee951b3a450ad0fcf44b399e35ee757fe761d91602bbe00c0172e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Security for etudataproc 0.1.2
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.