dtx-assessment-client-py is a Python library that provides an API client for interacting with the Detoxio Assessment API. This client simplifies the process of sending assessment findings and managing assessment data within the Detoxio platform.
Installation
To install dtx-assessment-client-py, you can use pip:
pip install dtx-assessment-client-py
Alternatively, you can clone the repository and install it manually:
git clone https://github.com/yourusername/dtx-assessment-client-py.git
cd dtx-assessment-client-py
pip install .
Usage
Below are examples of how to use the dtx-assessment-client-py library to interact with the Detoxio Assessment API.
Creating a Client
First, you need to create an instance of the AssessmentFindingClient. You will need the base URL of your API endpoint and an API key for authentication.
from dtx_assessment_api.finding_client import AssessmentFindingClient
# Replace with your API base URL and API key
base_url = "https://api.example.com/"
api_key = "your_api_key_here"
# Initialize the client
client = AssessmentFindingClient(base_url, api_key)
Posting an Assessment Finding
To post an assessment finding, you need to create an AssessmentFinding object and then use the post method of the client.
from dtx_assessment_api.finding import AssessmentFinding, AssessmentRun, AssessmentTarget
# Example data for creating an AssessmentFinding
run = AssessmentRun(run_id="run-1234")
target = AssessmentTarget(target_id="target-5678", target_type="example_target_type")
finding = AssessmentFinding(run=run, target=target, finding_id="finding-91011")
# Post the assessment finding
response = client.post(finding)
print("Response Status Code:", response.status_code)
print("Response Body:", response.text)
Configuration
You can configure the client by passing different parameters during initialization. Ensure that you have the correct base URL and a valid API key. The client handles authentication via Bearer tokens.
client = AssessmentFindingClient(base_url="https://api.example.com/", api_key="your_api_key_here")
Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
Steps to Contribute
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your fork.
- Submit a pull request to the main repository.
Please ensure your code follows the project's coding standards and includes appropriate tests.
Metadata
Release files for dtx-assessment-api 0.10.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 | Actions |
|---|---|---|---|---|
| dtx_assessment_api-0.10.1.tar.gz | 7.8 kB | Without provenance | Details for dtx_assessment_api-0.10.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtx_assessment_api-0.10.1-py3-none-any.whl | Python 3 | none | any | Details for dtx_assessment_api-0.10.1-py3-none-any.whl |
Total release size: 16.1 kB
Release files / dtx_assessment_api-0.10.1.tar.gz
| Download URL | dtx_assessment_api-0.10.1.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2fb8741fb72b294a1d6cf5ebe512774a389d4d19427dd02bb50ed3e56fa5f697
|
|
BLAKE2b-256 checksum How to use checksums |
c863c4376fac832b3fddf96449adb0e0bd50ebb0532c973e53318e23d454b58f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.11.8 Linux/6.8.0-1017-azure
|
Release files / dtx_assessment_api-0.10.1-py3-none-any.whl
| Download URL | dtx_assessment_api-0.10.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78230ff8c90116f6f64252c6fcd54fdabfcb4bf48c4df1711283666383fbb819
|
|
BLAKE2b-256 checksum How to use checksums |
d815e17d49cb95803681ab725a2ded70853b6f26adb6a0f918abc55e4c4969fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.11.8 Linux/6.8.0-1017-azure
|
Security for dtx-assessment-api 0.10.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.