SPDX Model Python Bindings
Project description
spdx-python-model
Generated Python code for SPDX Spec version 3
All bindings in this repository are generated using shacl2code at the time the package is built.
NOTE: The bindings are pretty low level, intended for more directly manipulating SPDX files. While they are fully functions, they lack higher level helper functions that may be useful for creating SPDX documents. If you want a higher level approach, please see the SPDX Python Tools (however this repo doesn't yet support SPDX 3)
Installation (PyPi)
python3 -m pip install spdx-python-model
Installation (Git)
If you would like to pull the bindings directly from Git instead of using a released version from PyPi, the following command can be used:
python3 -m pip install git+https://github.com/spdx/spdx-python-model.git@main
Note that this will pull the latest version from the main branch. If you want
a specific commit, replace main with the git commit SHA
Usage
Each version of the SPDX spec has a module named v{MAJOR}_{MINOR}_{MICRO}
that contains the bindings for that version under the spdx_python_model top
level. For example:
import spdx_python_model
p = spdx_python_model.v3_0_1.Person()
Alternatively, if a shorter name is desired, a specific version can be imported with another name:
from spdx_python_model import v3_0_1 as spdx_3_0
p = spdx_3_0.Person()
Testing
This repository has support for running tests against the bindings using pytest.
To run the tests, first setup a virtual environment and install the development
variant of the package in editable mode:
python3 -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'
Then the tests can be run with:
pytest -vx
Making a new release
To make a new release of this repository, bump the version number found in
src/spdx_python_model/version.py, and merge it into the repo. After this,
make a new release in GitHub with the name v + VERSION, where VERSION
matches the version number specified in version.py (e.g. v1.0.0).
After this, GitHub actions will do the rest to build the package and publish it to PyPi
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spdx_python_model-0.0.5.tar.gz.
File metadata
- Download URL: spdx_python_model-0.0.5.tar.gz
- Upload date:
- Size: 138.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bcf7c6e5e2e8f0b787ed4eb8fb519e2ed776e820cb6d9eb93e44e98eb92ca2d
|
|
| MD5 |
dc596613ce2972d34071c6b48374a811
|
|
| BLAKE2b-256 |
735982a21ae7ccb8f136279e409119ef5299d7e0b18f2fb06f684ad1e99a27aa
|
Provenance
The following attestation bundles were made for spdx_python_model-0.0.5.tar.gz:
Publisher:
publish.yaml on spdx/spdx-python-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spdx_python_model-0.0.5.tar.gz -
Subject digest:
4bcf7c6e5e2e8f0b787ed4eb8fb519e2ed776e820cb6d9eb93e44e98eb92ca2d - Sigstore transparency entry: 1255908526
- Sigstore integration time:
-
Permalink:
spdx/spdx-python-model@4f82f94506776cec4469aac635020472ab052c1b -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/spdx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4f82f94506776cec4469aac635020472ab052c1b -
Trigger Event:
release
-
Statement type:
File details
Details for the file spdx_python_model-0.0.5-py3-none-any.whl.
File metadata
- Download URL: spdx_python_model-0.0.5-py3-none-any.whl
- Upload date:
- Size: 74.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92fcec60ca766522f9de726013609cf76297d2a43c927aacf24ec915c927c9a
|
|
| MD5 |
d5111801db338caebb69d8fe98330542
|
|
| BLAKE2b-256 |
faac9f59885b64c896d089737a387b28d5b1a64bf5c6e8fbc37a337e8d36dc70
|
Provenance
The following attestation bundles were made for spdx_python_model-0.0.5-py3-none-any.whl:
Publisher:
publish.yaml on spdx/spdx-python-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spdx_python_model-0.0.5-py3-none-any.whl -
Subject digest:
a92fcec60ca766522f9de726013609cf76297d2a43c927aacf24ec915c927c9a - Sigstore transparency entry: 1255908643
- Sigstore integration time:
-
Permalink:
spdx/spdx-python-model@4f82f94506776cec4469aac635020472ab052c1b -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/spdx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4f82f94506776cec4469aac635020472ab052c1b -
Trigger Event:
release
-
Statement type: