Skip to main content

Light Config (lco)

Load a config file once and use it as you would use enviroment variables from anywhere in your code.

Somewhere:

import lco

lco.init("some_config.yml")

You can also set the enviroment variable LCO_CONFIG instead.

Somewhere else entirely, 10 layers deep in some object.

import lco

lco["some_value"]
lco["some_group"]["some_value"]

This works across threads and processes.

But why?

This is mostly useful for research code, MVPs or Prototypes, where on doesn't want to pass configuration variables from object to object or across scopes. I wouldn't recommend this for production code as you're essentially using global variables.

What filetypes are supported?

So far, only yaml. Feel free to open a pull request with the filetype of your choice.

Metadata

Release files for lco 0.1.0

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

Source distribution (sdist)

Source distribution for lco 0.1.0
File Size Uploaded
lco-0.1.0.tar.gz 1.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lco 0.1.0
File Interpreter ABI Platform
lco-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 kB

Release files / lco-0.1.0.tar.gz

Download URL lco-0.1.0.tar.gz
Size 1.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fff7a8c64c1dd0c218374add3cc2db4428083c5573684259cbe6b6f8b81d7aed
BLAKE2b-256 checksum
How to use checksums
442b933ead4581f473c641181af604465b4e5046a4f1adbf45fe8d5f772ff7fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.3.1 CPython/3.8.10

Release files / lco-0.1.0-py3-none-any.whl

Download URL lco-0.1.0-py3-none-any.whl
Size 1.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95201b638fdbadc9345ab1e848e96c490bc2a334619b4b678b76b747a2294de5
BLAKE2b-256 checksum
How to use checksums
3d5801c7bf43adb81ba3099abdd4ea94b70d8bfd46e294e9140ff37cb9c77ead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.3.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

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