Skip to main content

feconfig Python client

A small client for the feconfig JSON API, with no dependencies beyond the standard library. Foton's Python wrapper (foton.py in dtt) uses it to check out modules from feconfig and submit them back; scripts can use it directly.

import feconfig

c = feconfig.Client()                 # server and token from the environment or config files
for m in c.models():
    print(m["name"], m["host"])
co = c.checkout("X2SUSOM0/OM0_M3_COILOUTF_LL")
text = co["text"]                      # foton file text for that module
# ... edit the text, or build a foton.FilterFile from it ...
r = c.submit(text, "notch the 1 Hz line", model="X2SUSOM0")
print(r["batch_id"], [f"{x['module']}/FM{x['fm']}" for x in r["changes"]])

Server and credentials

Client(server=None, token=None) looks, in order, at the arguments, the environment (FECONFIG_SERVER, FECONFIG_TOKEN), the user's ~/.config/feconfig/credentials.toml written by feconfig-cli login, and the site file /etc/feconfig/client.toml (server = "http://host:8080"). Client.login(server, user, password) exchanges a password for a token and can save it to the credentials file.

Errors from the server raise feconfig.FeconfigError with .status, .code (such as forbidden, unloaded_edits, filters_on, epics_disabled) and .message.

Testing

pytest here starts a feconfig server from target/debug/feconfig (build it first with cargo build -p feconfig) on a free port with a temporary tree and the static auth backend, and drives it through the client.

Metadata

Release files for feconfig 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feconfig 0.1.0
File Size Uploaded Provenance Actions
feconfig-0.1.0.tar.gz 20.2 kB Without provenance Details for feconfig-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for feconfig 0.1.0
File Interpreter ABI Platform Actions
feconfig-0.1.0-py3-none-any.whl Python 3 none any Details for feconfig-0.1.0-py3-none-any.whl

Total release size: 38.5 kB

Release files / feconfig-0.1.0.tar.gz

Download URL feconfig-0.1.0.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b89b99735c1e765ecd6abd439bcf4c8180619b43f971f05bad6cc5a258899f37
BLAKE2b-256 checksum
How to use checksums
8eb008a13cd8d0e4f9889b87317bdcead21c817ce233fc3eec6156d729e6508a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / feconfig-0.1.0-py3-none-any.whl

Download URL feconfig-0.1.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96b346b573215a5059d8afd594f40a32beb0af0ab4d59fc0cf0c447c8883fe04
BLAKE2b-256 checksum
How to use checksums
60b4ed6f7aa087690e19588bbb2eecbe49021cf26d329457940c86387f1d6886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for feconfig 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page