Skip to main content

Black Duck SCA API client

Standalone Python client library for Black Duck BDSCA and BDBA APIs.

This package provides a typed, composable API client for common Black Duck BDSCA workflows such as:

  • project and version management
  • BOM and component queries
  • vulnerability and policy queries
  • report generation and download
  • scan orchestration (binary, container, SBOM, BDIO)
  • users, groups, system, jobs, and custom fields

Requirements

  • Python 3.13+

Installation

Using pip or uv

Install from local source:

pip install .
uv pip install .

Or install in editable mode for development:

pip install --editable .
uv sync

Quick Start

1) Initialize client and authenticate

from blackduck.bdsca.client import BDScaClient

HOST = "https://your-blackduck.example.com"
TOKEN = "your-api-token"

client = BDScaClient.from_params(
	host=HOST,
	token=TOKEN,
	max_requests_per_sec=10,
)

# Exchange token for bearer auth and store it in session headers
client.authenticate()

## Call a few common endpoints

# Current user
me = client.users.get_current_user()
print("Current user:", me.user_name)

# System status
health = client.system.liveness_check()
print("Liveness:", health.status)

# List projects (first page)
projects = client.projects.list_projects(limit=10)
for p in projects.items:
	print(p.project_id, p.name)

Client Structure

The top-level BDScaClient exposes domain clients as attributes:

  • client.projects
  • client.projectgroups
  • client.codelocations
  • client.components
  • client.customfields
  • client.jobs
  • client.licenses
  • client.policies
  • client.reports
  • client.scans
  • client.snippets
  • client.system
  • client.users
  • client.usergroups
  • client.vulnerabilities

Error Handling

Client methods usually raise requests exceptions via response.raise_for_status() on non-2xx responses.

Typical pattern:

import requests

try:
	client.authenticate()
	projects = client.projects.list_projects(limit=5)
except requests.HTTPError as exc:
	print("HTTP error:", exc)
except requests.RequestException as exc:
	print("Request error:", exc)

Development

Common tasks with just:

just setup-dev
just lint
just test

Notes

  • Host values with or without scheme are supported; the transport normalizes the host URL.
  • Authentication is explicit: call client.authenticate() before making API calls.
  • The transport includes resilient adapter wiring for retries, throttling, and reauthentication callback support.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blackduck_sca_api_client-0.3.3-cp313-none-any.whl (205.4 kB view details)

Uploaded CPython 3.13

File details

Details for the file blackduck_sca_api_client-0.3.3-cp313-none-any.whl.

File metadata

  • Download URL: blackduck_sca_api_client-0.3.3-cp313-none-any.whl
  • Upload date:
  • Size: 205.4 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for blackduck_sca_api_client-0.3.3-cp313-none-any.whl
Algorithm Hash digest
SHA256 ff76d2edf10c01800820dd54e4ea795a847b2f8bf6b497eec207c9579a3905e9
MD5 86349c007261617e2afad61fa3ec6fb8
BLAKE2b-256 f11c4af58c00b074a56475ea763b6f025d2d718fcb5d46cbd7475b1e6b318da6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.4

1 file

This release

0.3.3 This release

1 file

0.3.2

1 file

0.3.1

1 file

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