Environment variable helpers
Project description
Roskarl
Is a tiny module for environment variables.
Requires
Python 3.9.5
How to install
pip install roskarl
Example usage
from roskarl.env import (
env_var_bool,
env_var_cron,
env_var_float,
env_var_int,
env_var_list,
env_var,
env_var_tz,
env_var_dsn,
DSN
)
str
value = env_var(name="STR_VAR")
returns str
bool
value = env_var_bool(name="BOOL_VAR")
tz
value = env_var_tz(name="TZ_VAR")
list
value = env_var_list(name="LIST_VAR", separator="|")
returns list if value is splittable by separator
int
value = env_var_int(name="INT_VAR")
returns int if value is numeric
float
value = env_var_float(name="INT_VAR")
returns float if value is float
cron
value = env_var_cron(name="CRON_EXPRESSION_VAR")
DSN
value = env_var_dsn(name="DSN_VAR", type)
returns DSN object if value is like a dsn
needs to be formatted like this:
postgresql://username:password@hostname:5432/database_name
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
roskarl-2.4.0.tar.gz
(5.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file roskarl-2.4.0.tar.gz.
File metadata
- Download URL: roskarl-2.4.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78fcab68fc368d912b3aaa4b5e7720e01bd7b419c3b14a983a0da8d1eec45491
|
|
| MD5 |
2819028405e65dd6f99e12ff9fd24adc
|
|
| BLAKE2b-256 |
b9f5e890cfa933db9b3bfb1838228e0efe29d73fa5c83345635783140c0616c6
|
File details
Details for the file roskarl-2.4.0-py3-none-any.whl.
File metadata
- Download URL: roskarl-2.4.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84247688505d14af1ee68ac7abb4796927cc3116894e685aea6bdd99e57c1b78
|
|
| MD5 |
d5548157d8ee00be7d3f6aa1ca628a53
|
|
| BLAKE2b-256 |
d9ae679943ee6a06e3b93e598fc8341270def469d15a4e6e316d44cc004adc7b
|