Skip to main content

Enviously elegant environment variable parsing

Project description

Parsenvy is an enviously elegant environment variable parsing Python library.

main Documentation Status Github Actions badgefury svg Unreleased chages License: BSD-3-Clause

Environment variables are strings by default. This can be rather inconvenient if you’re dealing with a number of them, and in a variety of desired types. Parsenvy aims to provide an intuitive, explicit interface for retrieving these values in appropriate types with human-friendly syntax.

Features

  • Compatible with Python 3.6+ only (the last Python 2 compatible version was 1.0.2).

  • Fully tested on Linux, macOS, and Windows.

  • No dependencies outside of the Python standard library.

  • BSD (3-Clause) licensed.

  • Utterly awesome.

  • Now with docs!

Examples

>>> import parsenvy

>>> parsenvy.bool('DEBUG_ENABLED')  # DEBUG_ENABLED=True
True

>>> parsenvy.int('POSTS_PER_PAGE')  # POSTS_PER_PAGE=13
13

>>> parsenvy.float('EXCHANGE_RATE')  # EXCHANGE_RATE=42.911
42.911

>>> parsenvy.list('INVALID_USERNAMES')  # INVALID_USERNAMES=admin,superuser,user,webmaster
['admin', 'superuser', 'user', 'webmaster']

>>> parsenvy.tuple('SAMPLE_GREETING')  # SAMPLE_GREETING=Hello,world!
('Hello', 'world!')

>>> parsenvy.set('ALLOWED_CATEGORIES')  # ALLOWED_CATEGORIES=python,vim,git
{'python', 'vim', 'git'}

>>> parsenvy.str('DB_PREFIX')  # DB_PREFIX=dj_
'dj_'

Install

pip install parsenvy

Contributing

Contributions are welcome, and more information is available in the contributing guide.

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

Parsenvy-3.0.1.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

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

Parsenvy-3.0.1-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file Parsenvy-3.0.1.tar.gz.

File metadata

  • Download URL: Parsenvy-3.0.1.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure

File hashes

Hashes for Parsenvy-3.0.1.tar.gz
Algorithm Hash digest
SHA256 c0d50c8c5ba072646b8f7aca8949c49953c11e4f284e938e8849e51b48d24be9
MD5 935f13b297c65bdf9a9bc031d660e42e
BLAKE2b-256 a69a5787546e3610213f9fabefd34481bd8e2205abc095c10c40f194f7ae92ed

See more details on using hashes here.

File details

Details for the file Parsenvy-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: Parsenvy-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure

File hashes

Hashes for Parsenvy-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9dc75570cacc2fb2c16a534010bb646b112c2be9b5021ffe996e20c2fd2d054a
MD5 6cd73353a6c930066181b92bbcaca3fb
BLAKE2b-256 74c9bcec2b1b8250c2ff8e1dc4a56eed2c815ce5e11f2316248dadc1b16d4824

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