Skip to main content

EnvModel

A Python library for simplifying the use of environment variables in your projects.

Overview

EnvModel provides a simple and intuitive way to define, manage, and access environment variables in your Python projects. It supports a variety of field types, including strings, integers, floats, booleans, JSON, and string lists.

Installation

To install EnvModel, run the following command:

pip install envmodel

Usage

Here's a minimal example of how to use EnvModel:

from envmodel import EnvModel, StringField

class MyConfig(EnvModel):
    api_key = StringField(name="API_KEY", required=True)
    database_url = StringField(name="DATABASE_URL", default="sqlite:///example.db")

config = MyConfig()
print(config.api_key)  # prints the value of API_KEY environment variable
print(config.database_url)  # prints the value of DATABASE_URL environment variable or the default value

Field Types

EnvModel supports the following field types:

  • StringField: A string field that can hold any string value.
  • IntegerField: An integer field that can hold any integer value.
  • FloatField: A float field that can hold any float value.
  • BooleanField: A boolean field that can hold a boolean value.
  • JsonField: A JSON field that can hold any JSON value.
  • StringListField: A string list field that can hold a list of string values.

See the Field Types documentation for more details.

Contributing

We welcome contributions to EnvModel! Please check out the Contributing documentation for more information.

License

EnvModel is released under the Apache License 2.0.

Changelog

See the CHANGELOG for a list of changes.

Metadata

Release files for envmodel 0.2.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 envmodel 0.2.0
File Size Uploaded Provenance
envmodel-0.2.0.tar.gz 14.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 26.9 kB

Release files / envmodel-0.2.0.tar.gz

Download URL envmodel-0.2.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
57b2e312ec97f17a04077448c5a9b9b5d1f62e552d383df9a41613d10019cc24
BLAKE2b-256 checksum
How to use checksums
8ed748b9bc5f7d3fe2660b6e5909011dfd60b66732dee2ca33be900424e78b93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / envmodel-0.2.0-py3-none-any.whl

Download URL envmodel-0.2.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
249a3e38998f4bd2361cd3d2d647417bb708688cd1050d63c1ea90a08113b088
BLAKE2b-256 checksum
How to use checksums
1b9429a6e4006613b1f37ea1e9b4ae52fd944f655c21839ff5c8234588dc65fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for envmodel 0.2.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.2.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