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.1.0.post2.tar.gz (14.2 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.1.0.post2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file envmodel-0.1.0.post2.tar.gz.

File metadata

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

File hashes

Hashes for envmodel-0.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 89b9fa4aaee2968af5e3f5a4e908b18501d603836f01c5636980d7d54a3a0eb2
MD5 9b2db7245ab9c38cde331b0ae94f3a18
BLAKE2b-256 a634e26ed811e1772aba763359645d0a5ae08735701ce2e023af9fded95cd3a2

See more details on using hashes here.

File details

Details for the file envmodel-0.1.0.post2-py3-none-any.whl.

File metadata

  • Download URL: envmodel-0.1.0.post2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 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.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ed9ee625b96067d1bb9611021b34118cc269715bdcc1d7e468e5aa4fe47d9ed
MD5 c1f62660ff23ccd7683fc84321ba885f
BLAKE2b-256 f140e0173f390bc8b676b092b566ef0082db16323a3d5e70bb747998367237ff

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