Skip to main content

Code Coverage Status Test PyPI version

OWASP Dependency Track Python API client

This is a generated library based on the official OWASP Dependency Track OpenAPI spec using openapi-python-client including some sanity patches.

Usage

pip install owasp-dependency-track-client

Create the client

from owasp_dt import Client

client = Client(
    base_url="http://localhost:8080/api",
    # base_url="http://localhost:8080/api/v2",  # For v2 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) > 0

OWASP Dependency Track CLI

Looking for a CLI? Check out https://github.com/mreiche/owasp-dependency-track-cli

Development

Update the library

  1. Install the requirements: pip install -e ".[test] or uv sync --extra test
  2. Start an OWASP DT instance locally (see Start the test environment): https://docs.dependencytrack.org/getting-started/deploy-docker/
  3. Run regenerate-api-client.sh
  4. Check if bugs are still in effect
  5. Publish this library with the API version tag

Start the test environment

cd test
podman|docker compose up
  • Preconfigured user: admin:admin2
  • Preconfigured API key: see test/test.env

Clean database init

  • Prepare test/docker-compose.yml
init-keys:
  volumes:
    # Comment out init dir
    # - './init:/init:ro'

apiserver:
  environment:
    # Comment in proxy env variables
    HTTP_PROXY: "http://localhost"
    HTTPS_PROXY: "http://localhost"

postgres:
  volumes:
    # Comment out init.sql
    # - "./init/init.sql:/docker-entrypoint-initdb.d/init.sql"
  • Delete the volumes first

    podman volume rm test_postgres-data
    podman volume rm test_apiserver-data
    
  • Start the stack

  • Perform login and change password to admin2

  • Create an Administrators API key and update test/test.env

  • Dump the data

    podman exec test_postgres_1 bash -c "pg_dump -U \$POSTGRES_USER -d \$POSTGRES_DB > /tmp/init.sql"
    podman cp test_postgres_1:/tmp/init.sql "$(pwd)/test/init/init.sql"
    
  • Remove all data from tables

    • dex_workflow_run
    • dex_workflow_history*
  • Save the KEK key

    podman cp test_apiserver_1:/data/.dependency-track/keys/secret-management-kek.json "$(pwd)/test/init/secret-management-kek.json"
    
  • Revert changes in test/docker-compose.yml

  • Restart the stack

Metadata

Release files for owasp-dependency-track-client 5.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for owasp-dependency-track-client 5.3.0
File Size Uploaded Provenance Actions
owasp_dependency_track_client-5.3.0.tar.gz 213.3 kB Without provenance Details for owasp_dependency_track_client-5.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for owasp-dependency-track-client 5.3.0
File Interpreter ABI Platform Actions
owasp_dependency_track_client-5.3.0-py3-none-any.whl Python 3 none any Details for owasp_dependency_track_client-5.3.0-py3-none-any.whl

Total release size: 877.9 kB

Release files / owasp_dependency_track_client-5.3.0.tar.gz

Download URL owasp_dependency_track_client-5.3.0.tar.gz
Size 213.3 kB
Tags Source
SHA-256 checksum
How to use checksums
98c96c82a54c473c00ddf95711fd53177fe0442797f60bfe60cec50edfb0b86f
BLAKE2b-256 checksum
How to use checksums
1ce0878bad93d3f2e58335c32416289d96ab65d3c6bfc4bb6e73e9de01aeb35c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / owasp_dependency_track_client-5.3.0-py3-none-any.whl

Download URL owasp_dependency_track_client-5.3.0-py3-none-any.whl
Size 664.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caa4fb71ba0d40b1cad9eee08a8d3721ccff433edc7b1950d45075be097f1b34
BLAKE2b-256 checksum
How to use checksums
92f6a7d496242c3712262f4247a54f8a98c1782fd69f35e3a5717b0e7b898b50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for owasp-dependency-track-client 5.3.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page