This is a generated library based on the official OWASP Dependency Track OpenAPI spec (/api/openapi.json) using openapi-python-client.
pip install owasp-dependency-track-clientCreate the client
from owasp_dt import Client
client = Client(
base_url="http://localhost:8081/api",
headers={
"X-Api-Key": "YOUR API KEY"
},
verify_ssl=False,
)Call endpoints:
from owasp_dt.api.project import get_projects
projects = get_projects.sync(client=client)
assert len(projects) > 0This library is part of a wider OWASP Dependency Track tool chain:
- OWASP Dependency Track Python API client: https://github.com/mreiche/owasp-dependency-track-python-client
- OWASP Dependency Track CLI: https://github.com/mreiche/owasp-dependency-track-cli
- OWASP Dependency Track Azure DevOps Sync: https://github.com/mreiche/owasp-dependency-track-azure-devops
- Install the requirements:
pip install -r requirements.txt - Start a OWASP DT instance locally (like via. Docker-Compose): https://docs.dependencytrack.org/getting-started/deploy-docker/
- Run
regenerate-api-client.sh [patch-full.json|patch-minimal.json] - Check if bug openapi-generators/openapi-python-client#1256 is still in effect
- Publish this library with the API version tag
cd test
podman|docker compose up- Preconfigured user:
admin:admin2 - Preconfigured API key: see
test/test.env