Skip to main content

Itacate

https://travis-ci.org/categulario/itacate.svg?branch=master

Itacatl: Provisión de comida que se lleva para un viaje o un paseo, o que ha sobrado de una fiesta y se da a algunos invitados.

El módulo de configuración de flask para el resto del mundo, por que me gusta cómo funciona. Escribe tus configuraciones en archivos python e impórtalas según el entorno, sobreescribiéndolas en cascada.

The config module from flask for the rest of the world, just because I like how it works. Write your config files in normal python files and import them depending on environment variables. Overwrite them in cascade.

Cómo usar / Usage

# settings.py
DEBUG = False
BE_MAGIC = True
SECREY_KEY = ''
FIZ_BOZ = 15
STORAGE_DIR = 'media'
DB_NAME = 'mysql'
# settings_develop.py
DEBUG = True
# settings.json
{
   "FIZ_BOZ": 10
}
# module.py
from itacate import Config
import os

class MyObject:
   STORAGE_DIR = '/var/www/media'

DB_NAME = 'postgres'

config = Config(os.path.dirname(os.path.realpath(__file__)))
config.from_pyfile('settings.py')
config.from_envvar('MY_APP_SETTINGS', silent=False) # export MY_APP_SETTINGS=/path/to/settings_develop.py
config.from_mapping({
   'SECREY_KEY': 'lalala',
})
config.from_json('settings.json')
config.from_object(MyObject)
config.from_object(__name__) # from this same module!

assert config.BE_MAGIC == True
assert config.DEBUG == True
assert config.FIZ_BOZ == 10
assert config.SECREY_KEY == 'lalala'
assert config.STORAGE_DIR == '/var/www/media'
assert config.DB_NAME == 'postgres'

Metadata

Release files for itacate 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for itacate 1.0.3
File Size Uploaded
itacate-1.0.3.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for itacate 1.0.3
File Interpreter ABI Platform
itacate-1.0.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 16.4 kB

Release files / itacate-1.0.3.tar.gz

Download URL itacate-1.0.3.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aa3acf3c3269fdc70b40ca1dd8e76aa93919f4b46a079b887c55a915a49b10ee
BLAKE2b-256 checksum
How to use checksums
352b4585514cef695bccbb9db6e7b6807d5cc5e7cd770456eb8e2d0f5ad67a92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / itacate-1.0.3-py2.py3-none-any.whl

Download URL itacate-1.0.3-py2.py3-none-any.whl
Size 8.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
982a22cfefeaf58ae8ab122815a7d0a8386bebc042dbbefe33ab89d5ad285931
BLAKE2b-256 checksum
How to use checksums
a0129a643c2ea6a4fb5d69a66032a614dcde4733a6430642ddfb63b8273334af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page