Skip to main content

No project description provided

Project description

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.

Project details


Download files

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

Source Distribution

envmodel-0.2.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

envmodel-0.2.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file envmodel-0.2.0.tar.gz.

File metadata

  • Download URL: envmodel-0.2.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for envmodel-0.2.0.tar.gz
Algorithm Hash digest
SHA256 57b2e312ec97f17a04077448c5a9b9b5d1f62e552d383df9a41613d10019cc24
MD5 bb4493c1e526bf79095f56053cdd8088
BLAKE2b-256 8ed748b9bc5f7d3fe2660b6e5909011dfd60b66732dee2ca33be900424e78b93

See more details on using hashes here.

File details

Details for the file envmodel-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: envmodel-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for envmodel-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 249a3e38998f4bd2361cd3d2d647417bb708688cd1050d63c1ea90a08113b088
MD5 284d063409f3ee6cb9195c29798a983c
BLAKE2b-256 1b9429a6e4006613b1f37ea1e9b4ae52fd944f655c21839ff5c8234588dc65fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page