tree: e7561dd0127b37e23bbca822e95ea6c82e1fb6b1 [search]
  1. sourcelume/
  2. tests/
  3. pyproject.toml
  4. README.md
  5. uv.lock
plugins/sourcelume-python-plugin/README.md

Apache Sourcelume Python Plugin (sourcelume-python-plugin)

The sourcelume-python-plugin extracts metadata directly from a Python project's pyproject.toml (coordinates, organization, developers, license), generates canonical Sourcelume 0.0.1 Provenance Records, validates them against the registry schema, and publishes them to the registry.

Goals

GoalDescription
sourcelume generateGenerates a provenance-record.json spec file from project metadata.
sourcelume validateValidates the spec against the registry's /records/validate endpoint.
sourcelume publishSubmits the generated spec to the registry (POST /records).

Quickstart & Usage

1. Installation

Install the plugin locally using uv:

cd plugins/sourcelume-python-plugin
uv sync

2. Command-Line Execution

Run commands using uv run to ensure they are executed within the managed virtual environment:

# Generate the record
uv run sourcelume generate .

# Validate the record
uv run sourcelume validate . --registry-url http://localhost:8082

# Publish the record
uv run sourcelume publish . --registry-url http://localhost:8082 --token "$REGISTRY_TOKEN"

Configuration

The following configuration options are supported via CLI flags:

ParameterCLI FlagDescription
registry_url--registry-urlURL of the Sourcelume Registry. Default: http://localhost:8082.
token--tokenBearer token for authentication.
username--usernameRegistry username for HTTP Basic Auth.
password--passwordRegistry password for HTTP Basic Auth.
allow_conflict--allow-conflictIf true, treats HTTP 409 (Conflict) as success.

Building and Testing

Development

cd plugins/sourcelume-python-plugin

# Run tests
uv run pytest

License

Licensed under the Apache License, Version 2.0.