Environment variable helpers
Project description
Roskarl
Is a tiny module for environment variables.
Requires
Python 3.12.0
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.3.0.tar.gz
(4.4 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.3.0.tar.gz.
File metadata
- Download URL: roskarl-2.3.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
354261a75b391fd27a1bb55c8e301968b492b13419ae80ec8b79910f2aa8ff18
|
|
| MD5 |
36f1a4ae76617a4478edd4bd27e77028
|
|
| BLAKE2b-256 |
958f93288c3b5a4cd4e1e23b37e0d86c25d9b1db310eec291b3d518c2cd0697f
|
File details
Details for the file roskarl-2.3.0-py3-none-any.whl.
File metadata
- Download URL: roskarl-2.3.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da1f6ea8c4be4bd439a610c1899733403a0e18e673009289e776c9f5fbad7f60
|
|
| MD5 |
eadac0c671310bde4b02d45de2ff39a4
|
|
| BLAKE2b-256 |
23bec8d0645ec29b207d98ede0625e221a21e0b8a265f785675f7535c96c8966
|