Modern Python SDK for the Nginx Proxy Manager API.
Project description
nginx-proxy-manager-sdk
A modern Python SDK for the Nginx Proxy Manager API.
Features
- Typed, Pythonic client interface with resource-oriented APIs
- Automatic login when you pass email/password credentials
- Defensive validation for domain names and advanced nginx config snippets
- Pre-configured packaging, testing, linting, documentation, and CI/CD workflows
- Friendly local workflows for
uv, virtualenv,pytest, andpre-commit
Installation
pip install nginx-proxy-manager-sdk
For local development with uv:
uv venv
source .venv/bin/activate
uv pip install -e .[dev]
pre-commit install
Or with the standard library tooling:
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[dev]
pre-commit install
Quick start
from nginx_proxy_manager_sdk import NginxProxyManagerClient
with NginxProxyManagerClient(
"http://127.0.0.1:81",
email="admin@example.com",
password="your-password",
) as client:
hosts = client.proxy_hosts.list()
host = client.proxy_hosts.create(
domain_names=["app.example.com"],
forward_scheme="http",
forward_host="127.0.0.1",
forward_port=3000,
certificate_id="new",
ssl_forced=True,
allow_websocket_upgrade=True,
)
Authentication
Managed credentials
When you pass email and password, the client automatically fetches a bearer token on the first authenticated request.
Pre-issued token
client = NginxProxyManagerClient(
"http://127.0.0.1:81",
token="eyJhbGciOi...",
)
Manual login and refresh
client = NginxProxyManagerClient(
"http://127.0.0.1:81",
email="admin@example.com",
password="secret",
)
token_data = client.login()
refreshed = client.refresh_token()
Resource APIs
Proxy hosts
client.proxy_hosts.list(expand=["owner", "certificate"], query="example.com")
client.proxy_hosts.get(1)
client.proxy_hosts.update(1, forward_port=4000, ssl_forced=True)
client.proxy_hosts.enable(1)
client.proxy_hosts.disable(1)
client.proxy_hosts.delete(1)
Certificates
client.certificates.list()
client.certificates.get(1)
client.certificates.create(
provider="letsencrypt",
domain_names=["*.example.com"],
meta={
"dns_challenge": True,
"dns_provider": "cloudflare",
"dns_provider_credentials": "dns_cloudflare_api_token = xxxxx",
"propagation_seconds": 30,
},
)
client.certificates.renew(1)
client.certificates.test_http(["app.example.com"])
client.certificates.delete(1)
API documentation
The MkDocs site includes API reference pages generated from package docstrings.
mkdocs serve
Local development workflows
A Makefile is included for common tasks:
make installmake lintmake testmake docsmake build
Equivalent direct commands:
pytestfor unit testsblack src testsfor formattingflake8 src testsfor lintingpre-commit run --all-filesto run repository hookspython -m buildto produce wheel and sdist artifacts
Publishing
Build artifacts locally:
python -m build
Upload manually if needed:
twine upload dist/*
GitHub Actions also includes a trusted-publishing workflow for PyPI releases triggered by GitHub Releases.
Project details
Release history Release notifications | RSS feed
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 nginx_proxy_manager_sdk-0.1.0.tar.gz.
File metadata
- Download URL: nginx_proxy_manager_sdk-0.1.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1a833507f82f8b5af5e1f7b267fcb9d314f1282723e3c17fdea9ff735f7c74e
|
|
| MD5 |
ea9c7ad045eda0fdcb79f4ddb8e624d3
|
|
| BLAKE2b-256 |
dca0e8ed80726845c04c9dd5021a900858ce9def827b46663eeed8768e6cb378
|
Provenance
The following attestation bundles were made for nginx_proxy_manager_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on jasongi/nginx-proxy-manager-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nginx_proxy_manager_sdk-0.1.0.tar.gz -
Subject digest:
c1a833507f82f8b5af5e1f7b267fcb9d314f1282723e3c17fdea9ff735f7c74e - Sigstore transparency entry: 1134823256
- Sigstore integration time:
-
Permalink:
jasongi/nginx-proxy-manager-sdk-python@b2d497260b130579d2c988efcaadd812a247dcab -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/jasongi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b2d497260b130579d2c988efcaadd812a247dcab -
Trigger Event:
release
-
Statement type:
File details
Details for the file nginx_proxy_manager_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nginx_proxy_manager_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7491e27ac5649da7810bbfa2ee5b6cc33e270f680c260b651749f46ad7062e97
|
|
| MD5 |
916f860ce6869cb51db8f3d8437d3b60
|
|
| BLAKE2b-256 |
ad09b298e4e77ca2ef6cc927c7ec3a7c53867c51629fee6e1d40cff4744eb3f9
|
Provenance
The following attestation bundles were made for nginx_proxy_manager_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on jasongi/nginx-proxy-manager-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nginx_proxy_manager_sdk-0.1.0-py3-none-any.whl -
Subject digest:
7491e27ac5649da7810bbfa2ee5b6cc33e270f680c260b651749f46ad7062e97 - Sigstore transparency entry: 1134823289
- Sigstore integration time:
-
Permalink:
jasongi/nginx-proxy-manager-sdk-python@b2d497260b130579d2c988efcaadd812a247dcab -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/jasongi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b2d497260b130579d2c988efcaadd812a247dcab -
Trigger Event:
release
-
Statement type: