Skip to main content

readables-py

Enhance code readability and self-documentation in our Python code


Distributed Lock

[!NOTE] Check out the dedicated documentation.


Environment Variable Manager and Exporter

Declare and retrieve variables

Here is how you can declare and retrieve variables.

# file: your_app/constants.py
from readables.env import required_env, optional_env, flag

ALPHA = required_env('ALPHA', help='Alpha variable')
BETA = optional_env('BETA', 'default_value', help='Beta variable')
CHARLIE = flag('CHARLIE', help='Charlie flag')

[!TIP] When required_env is used, if the variable is not set, it will raise an exception.

Export variables

We have provided two exporters: the env file exporter and the MarkDown exporter. If you are working on the code that the required environment variables have not been set, you will need to set READABLES_ENV_ALLOW_UNSET_REQUIRED to true before using an exporter to suppress the error.

In this example, we use the env file exporter to generate the content of the distributed env file using the content above.

# file: scripts/gen_dist_env.py
from os import environ

environ['READABLES_ENV_ALLOW_UNSET_REQUIRED'] = 'true'

# noinspection PyUnresolvedReferences
from your_app import constants
from readables.env import manager, EnvFileExporter

output = EnvFileExporter.export(manager.variables)

[!NOTE] An exporter does not know how to scan the code. So, you need to find the way to ensure that the manager knows the declared variables. In this example, it imports any references to the "static" variables.

Metadata

Release files for readables-py 0.2.4

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

Source distribution (sdist)

Source distribution for readables-py 0.2.4
File Size Uploaded Provenance Actions
readables_py-0.2.4.tar.gz 11.8 kB With provenance Details for readables_py-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for readables-py 0.2.4
File Interpreter ABI Platform Actions
readables_py-0.2.4-py3-none-any.whl Python 3 none any Details for readables_py-0.2.4-py3-none-any.whl

Total release size: 25.5 kB

Release files / readables_py-0.2.4.tar.gz

Download URL readables_py-0.2.4.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
af2bc98f174362e8d39ad790f98766d34f022214490c3b9f7cb5450ec80195cb
BLAKE2b-256 checksum
How to use checksums
4cf2b12fd5efdedd15a64be63bcdc004ec899367d07e04ad9da54eccab49795c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release files / readables_py-0.2.4-py3-none-any.whl

Download URL readables_py-0.2.4-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a67aedac72a49049ba25d04813d38b0e4427d1af871d828cef913e0652beb1b4
BLAKE2b-256 checksum
How to use checksums
9e6fa26fb0e569d7a95b5a67be264a32ac4eb6bdcf9dbba29cd9ffa2e3b420e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Security for readables-py 0.2.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for readables_py-0.2.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

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.

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