Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Simple and flexible separation settings from code
Install: pip install flexiconf
import flexiconf
config = flexiconf.Configuration([ ...loaders... ])
Configuration is being read at the moment of an object creation, all get
are fast and read-only operations. Sources of the configuration are defined by loaders list, that will be described later.
You may also create multiple configurations with different sources - for example, parse command line parameters first, to define configuration files to be read as a full config later.
Configuration is treated as a tree of dicts and lists. For best compatibility, recommended to use only alphanumeric symbols and _
as a key. Point .
inside the key is treated as a divider between nested sections during both parsing ang getting.
After being parsed, tree could be received directly by Configuration.as_dict()
method.
Different parameters could be received via get operators: with auto cast (config.get_bool(...)
, config.get_int(...)
, etc) or by generic get
method. get
methods receive key_path
parameter (e.g. section_1.subsection.key_name
) and optional default
parameter of any type, including None
. KeyError
will be raised, if key was not found and default option was not provided.
Loaders are objects, that read configuration from different sources. Loaders are executed in direct order, later loaders will override previously parsed options with the same keys.
JsonLoader
and IniLoader
are both take optional config_files_pattern
parameter, describing glob
pattern to files with configuration. If not provided, parser will look for all *.json/*.ini
files in the caller directory recursively.
EnvLoader
takes optional pattern
parameter, to define keys to be added in configuration.
ArgsLoader
looks for all command line parameters with key=value
format, with optional number of -
as a prefix.
If you want to write your own loader, you could simply inherit from flexiconf.BaseLoader
class and implement load
method.
If you have some improvements, bug fixes or think, that your loader will be useful for other people, feel free to create pull request!
FAQs
Simple and flexible separation settings from code
We found that flexiconf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.