mpt-curl
Python replacement for ~/bin/mpt-curl built on mpt-api-python-client.
For GET requests to collection endpoints, pages are fetched automatically and streamed to stdout as a single JSON object ({"data":[...], "$meta":{...}}).
The first request is sent as-is. Auto-paging starts only if the response has $meta.pagination; further pages use limit=1000 by default. With total in pagination, paging follows it; otherwise it continues while each page is full. Disabled when the URL contains limit= or offset=.
Install
pip install mpt-curl
Configuration
Uses the active account from mpt-cli accounts (~/.swocli/accounts.json, is_active: true), same as the shell wrapper.
Override with environment variables:
MPT_API_BASE_URLMPT_API_TOKEN
Usage
# List agreements (auto-paged)
mpt-curl /commerce/agreements
# Same with /public/v1 or /v1 prefix — resolved like the shell script
mpt-curl /public/v1/commerce/agreements
mpt-curl /v1/commerce/agreements
mpt-curl /commerce/agreements
# Filter with RQL
mpt-curl '/commerce/agreements?and(eq(status,Active))'
# Single page (limit= or offset= in URL disables auto-paging)
mpt-curl '/commerce/agreements?limit=10'
# POST (-d alone implies POST, like curl)
mpt-curl /commerce/orders -d '{"type":"Change","agreement":{"id":"AGR-123"}}'
mpt-curl -X POST /commerce/orders -d '{"type":"Change","agreement":{"id":"AGR-123"}}'
# PUT with body
mpt-curl -X PUT /commerce/orders/ORD-123 -d '{"status":"Processing"}'
Options
| Flag | Description |
|---|---|
-X METHOD |
HTTP method (default: GET, or POST when -d is given) |
-d DATA |
Request body (JSON) |
-H NAME:VALUE |
Extra header |
--no-page |
Disable automatic paging |
--page-size N |
Page size for auto-paging (default: 1000) |
--compact |
Compact JSON output |
-v |
Log requests, status, and paging to stderr (gray when stderr is a TTY) |
-vv |
Also include response headers |
Automatic paging is also disabled when the URL already contains limit= or offset=.
Development
From a checkout:
uv sync --group dev
uv run pytest
Metadata
Release files for mpt-curl 1.0.10
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 |
|---|---|---|---|---|
| mpt_curl-1.0.10.tar.gz | 36.6 kB | Without provenance | Details for mpt_curl-1.0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mpt_curl-1.0.10-py3-none-any.whl | Python 3 | none | any | Details for mpt_curl-1.0.10-py3-none-any.whl |
Total release size: 47.0 kB
Release files / mpt_curl-1.0.10.tar.gz
| Download URL | mpt_curl-1.0.10.tar.gz |
|---|---|
| Size | 36.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3c7c72265950bbb693b08461330d281d7c9aa2d37036e718f0cdb5a3e06ad79
|
|
BLAKE2b-256 checksum How to use checksums |
a4f41afd2888376217f3c4ef2590ac853466c074703f171434f0ba4773301b9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mpt_curl-1.0.10-py3-none-any.whl
| Download URL | mpt_curl-1.0.10-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
083d0f73cb0315226736552e1468be0ba9376c5689fe323ff95c4945ae33b94f
|
|
BLAKE2b-256 checksum How to use checksums |
0af59ca0ab0cf01d2868283de3618368da1c0118c3b1bb113b11a74aa7302ad7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mpt-curl 1.0.10
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.