detoxio.ai - Assessment Findings to Platform syncup api client
Project description
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.
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
File details
Details for the file dtx_assessment_api-0.10.0.tar.gz
.
File metadata
- Download URL: dtx_assessment_api-0.10.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.8 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13519582f1d07824def520b258f6c34dc74df11de70ac3980a019ff854d89101 |
|
MD5 | 1f54d85480501c136b8b06ca1e228279 |
|
BLAKE2b-256 | d61cec5192e7b6788078d2d60c0b15aeb38138fe149b27f1eaec102ea47da3cc |
File details
Details for the file dtx_assessment_api-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: dtx_assessment_api-0.10.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.8 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32dc91df70ddb2b49f193b4a333de13f8996eca69c415e6a42c560c398d3bc7a |
|
MD5 | ca7ff98b5db0cd921bd788d6038af2dc |
|
BLAKE2b-256 | a092782c4f866529d367c0109d08eef2b74b324a2c7b0df2c3725944f6b06bf3 |