Skip to main content

autoread-dotenv

Testing Linting Read the Docs Codecov PyPi Package MIT License

autoread-dotenv parses your .env file when starting any venv-based Python process:

Demo

Installation

Install via uv:

> uv add autoread-dotenv

Or add to your poetry-based project:

> poetry add autoread-dotenv

Install via pip:

> bin/pip install autoread-dotenv

Set up a local development environment

> just install

Usage

The only thing left to do for you is the create a .env in the root of your project.

Registered sitecustomize-entrypoint

The autoread_dotenv.entrypoint-function is registered as a sitecustomize-entrypoint in our pyproject.toml_:

    [project.entry-points.sitecustomize]
    autoread_dotenv = "autoread_dotenv:entrypoint"

Sitecustomize and all its registered entrypoints will be executed at the start of every python-process. For more information, please see sitecustomize-entrypoints

Avoid overriding existing environments variables

By default, your .env-file read by autoread-dotenv will override any pre-existing environment variables. You can avoid this behaviour by setting AUTOREAD_ENFORCE_DOTENV=0.

Overriding where the .env-file is looked up

By default, autoread-dotenv locates your .env relative to sys.prefix, assuming the in-project-virtualenv layout described above. For setups that don't follow that convention (global installs, containers, editable mounts, ...), set AUTOREAD_DOTENV_PATH to the full path of the .env-file to use instead - it takes precedence and skips the sys.prefix-based lookup entirely:

> export AUTOREAD_DOTENV_PATH=/etc/myapp/production.env

Performance

autoread-dotenv runs on the start of every Python process in the venv, so its startup-time cost is measured and tracked explicitly - see docs/performance.md for the current numbers and how to reproduce them.

Compatibility

Python Version PyPI - Implementation

autoread-dotenv works on Python 3.9+, including PyPy3. Tested until Python 3.14.

Notable dependencies

Download files

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

Source Distribution

autoread_dotenv-1.0.6.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

autoread_dotenv-1.0.6-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file autoread_dotenv-1.0.6.tar.gz.

File metadata

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

File hashes

Hashes for autoread_dotenv-1.0.6.tar.gz
Algorithm Hash digest
SHA256 3bd2a034b18f30cd1a71a5bb9feb1618f891c091b0e00907ecff14aad8a0da48
MD5 dee4ed3d9af13a0072f878d32385dcff
BLAKE2b-256 52266f5d3ec0f59eb24f2dad157e9c6de4be90b263600281da3a51dd82ca65f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoread_dotenv-1.0.6.tar.gz:

Publisher: releasing.yaml on libranet/autoread-dotenv

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

File details

Details for the file autoread_dotenv-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for autoread_dotenv-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa59b7eb329b6b97631944fbe9e224e71a8eb981f6ad59454851402778262f0
MD5 bcb557bc50e0938ef95394cfef27e78d
BLAKE2b-256 710088e09a00d3362a785a4a955f99a1da7abbffa9fe7a22d5a9eea833d3e196

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoread_dotenv-1.0.6-py3-none-any.whl:

Publisher: releasing.yaml on libranet/autoread-dotenv

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

1.0.6 This release

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0

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