TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: (aconf) Global Python in-memory configuration module

1 pointsby synchronizingover 4 years ago

1 comment

synchronizingover 4 years ago
Wrote this module after getting annoyed at having to constantly pass `Config` objects left and right in my personal projects. Not planning on using this in any production systems but though it would be fun to package and share it.<p>aconf is a module for in-memory configuration. Create your configuration by doing the following:<p><pre><code> from aconf import make_config make_config(hello=&quot;world&quot;) </code></pre> And then in any file inside your project access the configuration:<p><pre><code> from aconf import conf print(conf().hello) # &gt;&gt;&gt; world </code></pre> That&#x27;s literally it. The configuration will live in memory for as long as the Python runtime exists, and can be accessed by any file&#x2F;class&#x2F;module that calls the `conf` or `config` function (more details on Github). The `make_config` function can take any Python type; objects, functions, etc. should have no issue being passed around.<p>* Github: <a href="https:&#x2F;&#x2F;github.com&#x2F;synchronizing&#x2F;aconf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;synchronizing&#x2F;aconf</a><p>* PyPi: <a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;aconf&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;aconf&#x2F;</a>