What is this?
A client library which connects any Python app to a Metaport server using the CycloneDX SBOM standard for data interchange.
How to use
Introduction
The library will automatically generate an SBOM for your app, submit it to Metaport and subsequently delete it. Data can be sent using the HTTP or Email transports. See the docs site for example requests.
When installed in a Python project, the library provides a single executable metaport. It's designed to be invoked on a schedule via cron from within an application's production environment or as part of a CI/CD pipeline.
This library supports traditional Pip, Poetry, and Pipfile based projects.
Vulnerabilities will be reported by this agent to your Metaport server by invoking the following commands (and in this order):
poetry auditpip-audit
If neither command is available, no vulnerability data will be sent when using --classic=1. If however vulnerability data is required, consider running a side-by-side instance of DependencyTrack, and configuring Metaport with it for dependencies and vulnerabilities (and without passing --classic=1).
Requirements
This package requires Python 3.12+. If used as part of a CI/CD setup, it can be installed as a throwaway dependency via Poetry's --dev switch ala poetry add --dev, or as a permanent dependency of your application.
Install
- Poetry
As part of production apps:
poetry add metaport-agent-python
- Pip
pip install metaport-agent-python
- Environment Variables
There are some environment variables which need to be set before the lib will operate correctly. Please see the docs site for more detailed installation and configuration instructions and examples.
Supported Frameworks and CMS's
Yours not listed? Contributions are very welcome. Please file an issue and issue a Merge Request, it's a one-line file change!
The following frameworks do not currently share life-cycle information:
- Flask
- Quart
- Pyramid
- Bottle
- Django CMS
- Pylons
- FastAPI
- Tornado
- CherryPy
- web2py
- Falcon
- Sanic
- Starlette
- Molten
- Klein
- wheezy
- turbogears
Development Setup
Virtual Environment
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Linux/macOS:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install development dependencies
pip install -r requirements-dev.txt
Using Poetry
# Install Poetry if not already installed
pip install poetry
# Install dependencies
poetry install
# Install dev-dependencies
./venv/bin/poetry install --extras dev
# Activate virtual environment
poetry shell
Metadata
Release files for metaport-agent-python 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metaport_agent_python-1.1.1.tar.gz | 41.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metaport_agent_python-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 92.7 kB
Release files / metaport_agent_python-1.1.1.tar.gz
| Download URL | metaport_agent_python-1.1.1.tar.gz |
|---|---|
| Size | 41.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e715fe77c8d7a94fc234080b1f4026efef92e217dd63de2f792fd4929b80de0
|
|
BLAKE2b-256 checksum How to use checksums |
b0645fe099be69a22e258c4bef3dbfefa77b32a53bc0835d63e42942d73aa06d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / metaport_agent_python-1.1.1-py3-none-any.whl
| Download URL | metaport_agent_python-1.1.1-py3-none-any.whl |
|---|---|
| Size | 51.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e28ffbba23f5d140f73d1cf509c6ec1ec1328a69a72751b79297e1bb36d79185
|
|
BLAKE2b-256 checksum How to use checksums |
08e1846199e8f829d56b6a33822ba5b6ad48e34aa9c47e6b8a66b96f584b71cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|