Skip to main content

Multipurpose python utils

Project description

jania

Librería Python ultra-minimalista para gestión de configuración: prioridad automática entre entorno, archivos y valores por defecto.

Instalación

pip install jania

Uso

from jania import env, env_config

# Cargar un archivo de configuración custom (opcional)
env_config("settings.toml")

# Obtener variable con prioridad: entorno > archivo custom > config.py > settings.toml > settings.yaml > fallback
valor = env("ENDPOINT_OUT_MSG", "http://localhost:5000")

Soporta archivos de configuración en formato:

  • Python (config.py)
  • TOML (settings.toml)
  • YAML (settings.yaml)
  • JSON (config.json)
  • TXT (key=valor por línea)

Puedes añadir nuevos formatos fácilmente.


Ejemplo completo

Supón que tienes los siguientes archivos en tu proyecto:

config.py

ENDPOINT_OUT_MSG = "http://localhost:8000/msg"

settings.toml

ENDPOINT_OUT_MSG = "http://localhost:8080/msg"

settings.yaml

ENDPOINT_OUT_MSG: "http://localhost:8090/msg"

Entonces:

from jania import env

print(env("ENDPOINT_OUT_MSG", "http://localhost:5000"))

Imprimirá (según prioridad de archivos y entorno).


Licencia

MIT License © 2025 Julian Ania

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

jania-0.2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

jania-0.2.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jania-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4c1ad0363c91411f3e5ec78e3aa907b1eef723cd897348da1f6b65b54143c67a
MD5 158d54f1aa4aeac6740fa16632a9826d
BLAKE2b-256 b56386ce520e6f1907282bcf5355b54e45e6b7a1aa6a2a03daac48035a00d9bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for jania-0.2.0.tar.gz:

Publisher: publish.yml on julianin/JANIALIB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

File hashes

Hashes for jania-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9737b97510b4d1e56d36ce6ec9c0703cfcf218e3e07cd877ae037d57f3699b8d
MD5 176108ebb08a6b74cdae6cdf5f4cd41d
BLAKE2b-256 77be77f97036b85f4cbbecb426035f3ef7e5b7d0f61abc07054cbc86aab10c99

See more details on using hashes here.

Provenance

The following attestation bundles were made for jania-0.2.0-py3-none-any.whl:

Publisher: publish.yml on julianin/JANIALIB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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