Skip to main content

abstraction-config, in Python

Where a machine keeps its answer to "which store", and who said so. An administrator's machine-wide file, then this user's file, then the environment for one run — each overriding the last, key by key, with the origin of every answer kept beside it.

An application asks the machine and names no path. A key nothing set is absent, which means this machine does not have that tier: a normal answer, not an error.

This page is the Python package. The Go implementation, the file format and what is UNPROVEN are on the repository.

Install

Not on PyPI, and the names on PyPI are not ours. Clone the three repositories beside each other and install them in dependency order:

git clone https://github.com/openabstractions/abstraction-cas
git clone https://github.com/openabstractions/abstraction-watch
git clone https://github.com/openabstractions/abstraction-config

pip install ./abstraction-cas/python ./abstraction-watch/python
pip install ./abstraction-config/python

Python 3.9 or later.

An example that runs

import abstraction_config as config

store, why = config.job_store()
print("jobs live at:", store)
print("because:", why)

print(config.load().describe())

On a machine nobody has configured it prints the default and says so. It reads files and writes none, so running it changes nothing.

What an application calls

call what it does
job_store() (path, why) — where jobs live on this machine, and what decided
load() a Config: nas_store, store, log_sink, log_service, off. A file that cannot be read or parsed is skipped, with one line on stderr saying which
Config.origin(key) which authority answered for one key, and which file said so
Config.describe() what was found and where, for a status command
Config.stamp() differs whenever the answer differs, so a long-running process can ask whether anything moved instead of rebuilding
overridden() the keys the environment is deciding, whatever the files say
user_path() / machine_path() the conventional locations on this platform
watch(budget) a subscription that re-reads when the answer changes

The environment variables that override a file, one per key: ABSTRACTION_NAS_STORE, ABSTRACTION_STORE, ABSTRACTION_LOG, ABSTRACTION_LOG_SERVICE.

What may break

  • This module reads; it does not write. There is no save here. A setup step or the Go implementation writes the file.
  • A machine-wide file no administrator owns raises Untrusted rather than being obeyed. Ownership is what is checked, so a file on a filesystem that does not carry it is refused.
  • No conformance verdict. No scenario in the suite cites this layer yet — what is proven and what is not.
  • Not on any package index, and no release carries an API stability promise. Pin a commit you have read.
  • Every published transcript was produced on Windows or Linux. macOS is UNPROVEN throughout.

Apache-2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstraction_config-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstraction_config-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file abstraction_config-0.1.0.tar.gz.

File metadata

  • Download URL: abstraction_config-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for abstraction_config-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d6487b3ec03150bfd77197cbc0494641ebcab1c8464fc839ff67acb7ea23c39
MD5 786ea2541b53310bc6662659eb703caa
BLAKE2b-256 3f9ee0e194e74bd5f458eaa2c9a62a56bb99c629ed6500d127bd16c2453f3cd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstraction_config-0.1.0.tar.gz:

Publisher: publish.yml on openabstractions/abstraction-config

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file abstraction_config-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abstraction_config-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe4cb2a65dd09d296d623102d7c4c9b923024d02ca9a6e55fca13a74b52e2202
MD5 0bbe3f61f65e9a6bf44841622f5ac494
BLAKE2b-256 5229e653912a131fe21f6d65f51f15ea19857c37bfa481e26aed1abdab967cb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstraction_config-0.1.0-py3-none-any.whl:

Publisher: publish.yml on openabstractions/abstraction-config

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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