smallstep-python
smallstep-python is a Python library at allows you to interface with the Smallstep API.
We use openapi-python-client to generate a low level Python client that is located in smallstep/api_client/. See the smallstep/README.md for more information on using this generated library. We built a wrapper library on top of smallstep/api_client that is located in api.py. This adds a handful of helper features. At this time smallstep/api.py only supports a few API endpoints. See smallstep/api.py for details.
Requirements
- Python 3.9
- Smallstep Account
- A very strong desire to allow a cute snake to manage your Smallstep account
Installation
We publish this package to https://pypi.org/project/smallstep-python/ and it can be installed via pip.
pip install smallstep-python
Development
Configuration
Create a .env file in the project root and add the following lines:
# Not needed unless you are using our run anywhere offering
# SMALLSTEP_API_HOST="https://gateway.smallstep.com/api"
SMALLSTEP_API_TOKEN="your_smallstep_api_token"
Adjust them to your needs. See config.py for configuration details. We use Pydantic Settings for easy settings management. Below is the order of precedence for configuration settings:
- Arguments passed to the Settings class initialiser.
- Environment variables, e.g. SMALLSTEP_MY_CONFIG_SETTING as described above.
- Variables loaded from a dotenv (.env) file.
- Variables loaded from the secrets directory.
- The default field values for the Settings model.
See the Pydantic Settings field value priority section for more information.
With Poetry
Install Poetry on your system with this.
Run this from the repo directory:
poetry install
Enter the Poetry shell with this:
poetry shell
pre-commit install
With venv
export VIRTUAL_ENV=${PWD}/.venv
python3 -m venv $VIRTUAL_ENV
export PATH="$VIRTUAL_ENV/bin:$PATH"
pip install wheel
pip install -r requirements.txt
. .venv/bin/activate
pre-commit install
Adding packages
Add packages to Poetry and then run pre-commit which will generate a requirements.txt file for you.
Development:
poetry add --group=dev rich
pre-commit
Production:
poetry add rich
pre-commit
License
Copyright 2023 Smallstep Labs Inc.
Metadata
Release files for smallstep-python 0.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 | Provenance | Actions |
|---|---|---|---|---|
| smallstep_python-0.1.1.tar.gz | 68.4 kB | Without provenance | Details for smallstep_python-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smallstep_python-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for smallstep_python-0.1.1-py3-none-any.whl |
Total release size: 266.6 kB
Release files / smallstep_python-0.1.1.tar.gz
| Download URL | smallstep_python-0.1.1.tar.gz |
|---|---|
| Size | 68.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e486b0ab7287c2806aca8812c3f2489c6991d61e5cd819cfc7cdb9ce8f378b13
|
|
BLAKE2b-256 checksum How to use checksums |
460e05652c704791b8bbb447dd92d7185237d3bab084448fbd053ef41c902260
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / smallstep_python-0.1.1-py3-none-any.whl
| Download URL | smallstep_python-0.1.1-py3-none-any.whl |
|---|---|
| Size | 198.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76ae5406812562d55c1de3c4a1852aa3e80c0784ba6bf6110aba0f7e28ea7c9d
|
|
BLAKE2b-256 checksum How to use checksums |
47efcb9413e869d788dfcfd44d6aa080020d13c6a79eb2d4e3899af6ccffcb9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for smallstep-python 0.1.1
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.