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 with uv (preferred):

> uv add autoread-dotenv

If you are using Poetry:

> 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

entrypoint() never raises for a configuration problem (a missing, unreadable or un-loadable .env, or a missing python-dotenv): it warns and carries on, so it cannot break interpreter startup. To check afterwards whether loading actually succeeded, read autoread_dotenv.last_load_status (a LoadStatus enum), which entrypoint() also returns:

import autoread_dotenv
from autoread_dotenv import LoadStatus

if autoread_dotenv.last_load_status is not LoadStatus.LOADED:
    ...  # LoadStatus.MISSING / DOTENV_NOT_INSTALLED / LOAD_FAILED / NOT_RUN

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 the performance page for the current numbers and how to reproduce them.

Compatibility

Python Version PyPI - Implementation

autoread-dotenv works on Python 3.11+, including PyPy3. Tested until Python 3.15.

Notable dependencies

Metadata

Release files for autoread-dotenv 1.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 autoread-dotenv 1.1.0
File Size Uploaded Provenance Actions
autoread_dotenv-1.1.0.tar.gz 11.8 kB With provenance Details for autoread_dotenv-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autoread-dotenv 1.1.0
File Interpreter ABI Platform Actions
autoread_dotenv-1.1.0-py3-none-any.whl Python 3 none any Details for autoread_dotenv-1.1.0-py3-none-any.whl

Total release size: 23.5 kB

Release files / autoread_dotenv-1.1.0.tar.gz

Download URL autoread_dotenv-1.1.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
45e5079f5ab47e45e0c4f1acf3e3a3e4c9cf4eb109cab7bc6270f91b2159a2ea
BLAKE2b-256 checksum
How to use checksums
3f0f0333e7f7744d90e0aa3c0f3c9ca09fc219f759fe0a62a9b8ff2ec9a39c1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Release files / autoread_dotenv-1.1.0-py3-none-any.whl

Download URL autoread_dotenv-1.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb2b5ee40ba76f0bf23c82d00540d6c8b75aea302e2a253bb58e6170aafbcded
BLAKE2b-256 checksum
How to use checksums
a5164ce676df6673bf6dfd86654bc9f73c57390883aeb63ff520c49a768022ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Security for autoread-dotenv 1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for autoread_dotenv-1.1.0.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 Nov 3, 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