Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alchemy-config

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alchemy-config

Configuration framework in Python for general configuration use.

  • 1.1.3
  • PyPI
  • Socket score

Maintainers
1

Alchemy Config

The aconfig library provides simple yaml configuration in python with environment-based overrides.

Installation

To install, simply use pip

pip install alchemy-config

Quick Start

config.yaml

foo: 1
bar:
    baz: "bat"

main.py

import aconfig

if __name__ == "__main__":
    config = aconfig.Config.from_yaml("config.yaml")
    print(config.foo)
    print(config.bar.baz)
export BAR_BAZ="buz"
python3 main.py

Corner-case Behavior

You CAN set builtin method names as attributes on the config. However, you should only access/delete them via dictionary access methods.

For example:

import aconfig
cfg = {"update": True}

config = aconfig.Config(cfg)

# DO NOT DO THIS:
config.update

# DO THIS INSTEAD:
config["update"]

This is because there is no way in Python to tell whether you want the method or the attribute "update" when "getting" it from the object.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc