Saravanan666/pypi-org huggingface dataset:
Package: config-checker
Python module wrapper aroundConfigParserto ensure strict operation when working with configuration (.ini) files.Example UsageAssume a configuration file,config.ini, with the following content:[General]
api_key = api-private-key
conversion_factor = 123.456
print_results = FalseConfig parser can be used to ensure the expected values appear in the file, extra values are ignored with default values used as substitutes where entries are missing.fromconfigcheckerimportConfigCheckerconfig=ConfigChecker()# Set the configuration values which are to be used.# set_expectations(SectionName,SectionOption,DataType,DefaultValue)config.set_expectation('General','api_key',str,'api-private-key')config.set_expectation('General','retries',int,5)config.set_expectation('General','conversion_factor',float,3.14)config.set_expectation('General','print_results',bool,True)# Try to load a configuration (.ini) file.# Any previously set expectation which exists in the file has its value updated.# Any value which doesn't exist in the file has its default value applied.# Any configuration value in the file which isn't an expectation is ignored.# This should be called before a file is written, or configuration value set or getconfig.set_configuration_file('config.ini')# Get the value of a configuration variableprintResults=config.get_value("General','print_results')# Set the value of a configuration variableconfig.set_value('General','api_key','123-23423csdfs3-2342-234')# Write a configuration (.ini) file.# This operation creates a new file with all the previously set expectations# If a value hasn't been added for the option, then the default value is used.config.write_configuation_file('config.ini')The resulting (new) configuration file look as follows:[General]api_key=123-23423csdfs3-2342-234retries=5conversion_factor=123.456print_results=FalseNotice the optionretrieshas been added with the default value based on the expectation, and theapi_keyhas been updated. The values ofconversion_factorandprint_resultsremained unchanged, as they existed in the original configuration file.
Package: configclass
configclass - A Python to class to hold configuration valuesAConfigis adictwith a where:existing items can be modified but no items can not be addedhasmake()method so you can easily created derived configsmake()has the same API asdict.update()make()will merge values according tomergedict.ConfigDict.merge()for convenience, make can take aNoneto perform a simple copy>>> from configclass import Config

>>> c1 = Config({'a': 1, 'b': ['foo']})

# can't add new items to config
>>> c1.make({'a':2, 'c': [2]})
Traceback (most recent call last):
KeyError: 'New items can not be added to Config, invalid key:c'

# new config object created
>>> c2 = c1.make({'a':2})
>>> c2
Config({'a': 2, 'b': ['foo']})

# original object is not modified
>>> c1
Config({'a': 1, 'b': ['foo']})

# make() can take keyword arguments, note how lists are merged
>>> c2.make(b=['bar'])
Config({'a': 2, 'b': ['foo', 'bar']})configclass.ConfigMixincan be used to create aConfigclass
that is not based onmergedict.ConfigDict. Check unittests for usage.Project DetailsProject management on github -https://github.com/schettino72/configclass/licenseThe MIT License
Copyright (c) 2014 Eduardo Naufel Schettinosee LICENSE filedevelopers / contributorsEduardo Naufel Schettinoinstall$ pip install configclassor download and:$ python setup.py installtestsInstall dependencies indev_requirements.txt.To run the tests:$ py.test
Package: configconfig
Load and validate YAML configuration files.DocsTestsPyPIAnacondaActivityQAOtherInstallationconfigconfigcan be installed from PyPI or Anaconda.To install withpip:$python-mpipinstallconfigconfigTo install withconda:First add the required channels$condaconfig--addchannelshttps://conda.anaconda.org/conda-forge$condaconfig--addchannelshttps://conda.anaconda.org/domdfcodingThen install$condainstallconfigconfig
Package: configcrunch
Configcrunch is a Python library written in Rust for reading YAML-based configuration files.
It aims to be simple and fast while also providing some very powerful features.Configcrunch is compatible with Python 3.6 and up.Install it via pip:pip install configcrunchFeatures:Read configuration files from YAML files.Define various types of configuration files, that can be validated via a schema.Types of configuration files are defined as separate Python classes.Documents can be configured to contain nested documents of any type.Documents can containMinijinjatemplates that
can reference any other field inside the same or parent document.The classes that represent your document types can contain methods that can be used
inside the configuration files.Documents can reference documents from other files. Configcrunch will merge them together.
You decide where referenced documents are looked up.Configuration objects can also be created without YAML files, by using ordinary Python dicts.All features are optional.Used by:Riptide(Your project here! Open an issue.)By default Configcrunch usesschemato validate schemas.
But you can also use your own validation logic!ExampleThis is an example that uses most of the features described above, using two document types.# doc1.yml - Type: oneone:name:Documentnumber:1sub:# Sub-document of type "two"$ref:/doc2two_field:"{{parent().method()}}"# <lookup path>/doc2.yml - Type: twotwo:name:Doc 2number:2two_field:This is overridden# classes.pyfromschemaimportSchema,OptionalfromconfigcrunchimportYamlConfigDocument,DocReference,variable_helperclassOne(YamlConfigDocument):@classmethoddefheader(cls)->str:return"one"@classmethoddefschema(cls)->Schema:returnSchema({Optional('$ref'):str,# reference to other One documents'name':str,'number':int,Optional('sub'):DocReference(Two)})@classmethoddefsubdocuments(cls):return[("sub",Two)]@variable_helperdefmethod(self):return"I will return something"classTwo(YamlConfigDocument):@classmethoddefheader(cls)->str:return"two"@classmethoddefschema(cls)->Schema:returnSchema({Optional('$ref'):str,# reference to other Two documents'name':str,'number':int,'two_field':str})@classmethoddefsubdocuments(cls):return[]The document “one.yml” can then be read via Python:>>> import yaml
>>> from classes import One
>>> doc = One.from_yaml('./doc1.yml')
>>> doc.resolve_and_merge_references(['<lookup path>'])
>>> doc.process_vars()
>>> print(yaml.dump(doc.to_dict(), default_flow_style=False))
one:
  name: Document
  number: 1
  sub:
    name: Doc 2
    number: 2
    two_field: I will return somethingTestsInside theconfigcrunch.testspackage are tests.To run the tests, seerun_tests.sh.DocumentationThe complete documentation can be found atRead the Docs(or in the docs directory).
Package: configdb
Quick way to store db connection details out of sources.import configdb
import ooop
ooop.OOOP( configdb.configdb(required=”user pwd dbname”) )By default, attributes are taken from a YAML file at system
defined user configuration location. From the key (profile) ‘default’.
If the file is not there, it is created with a yaml file
with null values. You have to fill them.To change the profile you can use the ‘profile’ keyword orDBCONFIG_PROFILEenviron.https://github.com/vokimon/python-configdb
Package: configdict
Documentationhttps://configdict.readthedocs.ioInstallation$ pip install configdictCheckedDictA dictionary based on a default prototype. A CheckedDict can only definekey:valuepairs which are already present in the default. It is possible to
define a docstring for each key and different restrictions for the values
regarding possible values, ranges and type. A CheckedDict is useful for
configuration settings.ConfigDictBased on CheckedDict, a ConfigDict is a persistent, unique dictionary. It is
saved under the config folder determined by the OS and it is updated with each
modification. It is useful for implementing configuration of a module / library
/ app, where there is a default/initial state and the user needs to be able to
configure global settings which must be persisted between sessions (similar to
the settings in an application)Exampleconfig=ConfigDict("myproj.subproj")config.addKey("keyA",10,doc="documentaion of keyA")config.addKey("keyB",0.5,range=(0,1))config.addKey("keyC","blue",choices=("blue","red"),doc="documentation of keyC")config.load()Alternatively, a ConfigDict can be created all at once:config=ConfigDict("myapp",default={'font-size':10.0,'font-family':"Monospace",'port':9100,},validator={'font-size::range':(8,24),'port::range':(9000,65000),'font-family::choices':{'Roboto','Monospace'},},docs={'port':'The port number to listen to','font-size':'The size of the font, in pixels'})This will create the dictionary and load any persisted version. Any saved
modifications will override the default values. Whenever the user changes any
value (viaconfig[key] = newvalue) the dictionary will be saved.In all other respects a ConfigDict behaves like a normal dictionary.
Package: configen
* SynopsisPROJECT_NAME=yoyodyneFCGI_PORT=9000configen.py init.conf.template > yoyodyne.confWhen automating software configuration, one ends up using adhoc templating scheme toparametrize config files with sed and awk. configen let's you use python's powerfulstring formatting to generate config files (or any text for that matter) withparams from various sources.* Usage* environment variablesset a bunch of env vars in shell script and invoke from it.env foo=bar configen template* name-values fed to stdinecho foo=bar | configen tempalte -senv | configen tempalte -s* jsonconfigen template -j params.json* yamlconfigen template -y params.yaml* dash '-' can be passed for stdin* Recpie* generating from a shell script--------- genconf.shPROJECT_NAME=yoyodynePYTHON=/usr/bin/pythonPROJECT_ROOT=/home/yoyo/dyneRUNTIME_ROOT=/home/yoyo/dyneFCGI_PORT=9000USER=tenguconfigen.py init.conf.t---------* generating a config file from makefileexport the variables and run configen as follows:---------- Makefileexport PROJECT_NAME=yoyodyneexport PYTHON=/usr/bin/pythonexport PROJECT_ROOT=/home/yoyo/dyneexport RUNTIME_ROOT=/home/yoyo/dyneexport FCGI_PORT=9000USER=tenguyoyodyne.conf:configen.py init.conf.t | tee $@----------
Package: config-enhance
config-enhanceconfig-enhance adds re-use capabilities to ConfigParser style config
files.It introduces a reserved key: ‘<<=’The ‘<<=’ key should be assigned a list of enhancements like:[section]
<<=
    <other1
    +other2
    <other3
    -other4Each enhancement is composed of an operator followed by a section name.
The operators are:‘<’ : mix things in from another section if they don’t already exist‘+’ : pull config from another section, overwrite settings in the
current section if there is a clash.‘-’ : remove config items that exist in the source section from this
sectionYou can use it like this:from config_enhance import enhance

cp = ConfigParser (file ("my.cfg"))
enhance(cp)Suppose that my.cfg contains content like:[common]
flup = 1.0
requests = 2.0

[tes_100]
<<= <common
requests = 5.0
tornado = 6.0

[dev_tes_common]
tornado = 6.0d

[dev_unpin]
flup = unpin

[dev_tes_100]
<<=
    <tes_100
    +dev_tes_common
    -dev_unpinAfter running enhance, ‘cp’ will be modified to contain:[common]
flup = 1.0
requests = 2.0

[tes_100]
flup = 1.0
requests = 5.0
tornado = 6.0

[dev_tes_common]
tornado = 6.0d

[dev_unpin]
flup = unpin

[dev_tes_100]
requests = 5.0
tornado = 6.0dtarget audienceconfig-enhance is useful when managing version requirement sections in
buildout. Buildout already contains limited reuse features through the
‘<=’ idiom. But, version management is easier with an extended set.Other docs of interestconfig parser
documentation
Package: config-env
AboutPackage to manage environment variables similar to npm config from nodejsStartpipinstallconfig_env
mkdirconfigenv
viconfigenv/default.json// default.json{// Customer module configs"Customer":{"dbConfig":{"host":"localhost","port":5984,"dbName":"customers"},"credit":{"initialLimit":100,// Set low for development"initialDays":1}}}viconfigenv/production.json{"Customer":{"dbConfig":{"host":"prod-db-server"},"credit":{"initialDays":30}}}And if is necessary to hide secret values, it is recommended to use custom_environment_varibles.json to get environment variables:viconfigenv/custom_environment_varibles.json{"Customer":{"dbConfig":{"user":"MY_USERNAME","password":"MY_PASSWORD"}}}Values preference order:custom_environment_varibles -> production -> defaultIf custom_environment_varibles.json file does not exist or do not contain some key:value, it will come from produciton.json.If producion.json file does not exist or do not contain some key:value, it will come from default.json.Using config_envThe name of the environment variable PYTHON_ENV must be the same as your json file created.
If PYTHON_ENV is not defined, the values defined in default.json will be used.Example:exportPYTHON_ENV=production# app.pyfromconfig_envimportConfigEnvconfig=ConfigEnv()customer_host=config.get("Customer.dbConfig.host")customer_credit=config.get("Customer.credit")
Package: config-env-parser
Config ENV ParserThis project intents to simplify the process of reading configuration files and
exposing these configuration variables to be overwritten with env variables.Installpip install config-env-parserMinimal Examplefrom iniparser import Config

if __name__ == '__main__':
    c = Config()
    # True indicates recursive scan
    # '.' indicates to start the scanning in '.' as root
    c.scan('.', True)
    # Reads your ini files
    c.read()
    # prints the rendered config file
    print(c.config_rendered)
    # prints the config file with lambda functions in the fields that are exposed to the environment.
    print(c.config)Generate env markdown fileTo enable easy tracking of the created env variables,
you can call the Config'sto_envmethod.from iniparser import Config

if __name__ == '__main__':
    c = Config()
    # True indicates recursive scan
    # '.' starts the scanning in root
    # read reads your ini files
    c.scan('.', True).read()
    # Writes all available env variables to env.md
    c.to_env(output_path='./env.md')HintingYou can hint this tool in your ini files by adding acep:hint.
E.g. in your ini fileexclude|include|hint...
; ceb: exclude
excluded_key = excluded_value
; ceb: include
included_key = included_value
; ceb: hint
depends_key = depends_valueThedepends_keydepends on the settings of the Config class. If your setting of the mode wasall_allowed, the hint keyword will exclude thedepends_key. If your mode setting isall_forbiddenon the other hand, thedepends_keywill be included.
In short: The hint keyword will do the opposite of the mode for the following line.
If you place theceb:command before a section, it will apply this to the whole section.The include will provide a always exposed ENV var coming from the name.
The exclude will never expose the config variable to the ENV.Exposed in this contextExposed in this context means, that an automated ENV variable is created and if the ENV variable is
set or changed, the config variable is overwritten by the ENV variable.Find an exampleInexampleyou can find an example config.ini and the usage of the config parser inexample/example.py.
Package: configer
ConfigerThis is the repository for the packageCONFIGERhelps with easy configuration of arguments in a python code.IntroductionWhen Python programs grow large, one would eventually need a way to load configurations through a file. The common answer to this would by Python's ConfigParser. But at least I find the result of using ConfigParse an ugly code:import ConfigParser
Config = ConfigParser.ConfigParser()
Config.read("c:\\tomorrow.ini")
Config.get(section, option)That's why I packaged my solution to this issue. Configer basically gives you a flattened ConfigParser with extra functionality:dot-access of values in the settings filedump settings to a file for later useadd different settings while choosing to overload previous one.DependenciesThis package is written forPython 2.7.
The only dependency isconfigparserand will be installed automatically by thesetup.py.InstallationIn the root directory, type inpip install .ExamplesOverall Configer will be a sleek way to disentangle settings away from the mechanics. An exact copy of the above code will be:from configer import Configer
Config = Configer(default_ps_fname='c:\\tomorrow.ini')
Config.optionNote that you don't have sections anymore and you can access an option with a dot-access approach.Other use cases would be:Loading default settingsdefault_ps_fname = 'pyconfiger/Configer/test/sample_settings.ini'
ps = Configer(default_ps_fname=default_ps_fname)
print(ps.status) # NoneLoading default settings while adding new argumentsps = Configer(default_ps_fname=default_ps_fname, status=False)
print(ps.status) # False
ps.status = True
print(ps.status) # True
ps.new_status = True
print(ps.new_status) # TrueLoading default settings while initializing with a dictionary of argumentsps = Configer(default_ps_fname=default_ps_fname, status=False,**{'somethings': [1.0, 2.0]})
print(ps.somethings) # [1.0, 2.0]Adding and overloading with a second Configer instanceps1 = Configer(status=False)
ps2 = Configer(status=True, othersetting = 'this')

ps3 = ps1 + ps2
print(ps3.status) # False
print(ps3.othersetting) # 'this'

ps4 = ps1.overload(ps2)
print(ps4.status) # TrueDumping current Configer instance as an.inifileps = Configer(default_ps_fname=default_ps_fname, status=False)
print(ps.status) # False
ps.dump_settings(fname='~/settings.ini') # saves the settings to the specified fileTestsTo run the tests, type in in the root directory:python -m unittest discoverLicenseSee LICENSE.txtAuthorNima Ghorbani,nima.ghorbani@tuebingen.mpg.de
Package: configerus
ConfigerusDynamic and abstract configuration managementAn extendable plugin based configuration system, which allows abstract config
primitives to be loaded from various prioritized sources.  Config from higher
priority source plugins takes precedence over lower priority, with some simple
deep merging.Configerus makes config easy by:having a simple construction methodallowing config to be pulled from a variatey of sources, such as json/yml in
file paths, or custom dictsusing priorities, configerus allows config override, where some sources can
override others.deep configuration retrieval is easy using "dot" (one.two.three) notation to
search in config treesConfigerus offers a few tricks for complex use-casesyou can apply simple validation (such as jsonschema) on retrieved configyou can use a templating syntax to embed config from one source into another
at the time of retrievalyou can use a templating syntax to direct configeraus to replace a string
file path with the contents of that file. Some files will be unmarshalled
for the replacement.Configerus makes advanced config management possible by:allowing you to define your own sources, formatters and validators and inject
them at run timeallowing you to extend using setuptools entrypoints for advanced functionality
bootstrapping.UsageConfigerus has a bit of steep learning curve in its approach and construction
but it easy to use if it is set up correctly.A cheap and dirty example:If you have a folder./configthat has to config files in it:settings.yamlvalues.jsonimport configerus
from configerus.contrib.dict import PLUGIN_ID_SOURCE_DICT
from configerus.contrib.files import PLUGIN_ID_SOURCE_PATH

config = configerus.new_config()
# tell configerus to read files from a path
config.add_source(PLUGIN_ID_SOURCE_PATH).set_path('./config')
# add a dynamic dict to configerus, with a 90/100 priority
config.add_source(PLUGIN_ID_SOURCE_DICT, priority=90).set_data({
    'values': {
        'one': 'overriden from dict'
    }
})

# load all of the settings
settings = config.load('settings')
user_id = settings.get('user.id') # expects that settings had {user: {id: 'some value'}}

# load some overriding values
values = config.load('values')  # loads the value file, but overrides from the dict
assert values.get('one') == 'overriden from dict'
Package: configextractor-py
ConfigExtractorMaintainer: @cccs-rsPython Library for performing configuration extraction across multiple extraction frameworks (ie. Maco, MWCP, etc.). This tool is actively used in theAssemblylineproject as aservice.The code found in this repository contains a command line interface that acts as
a wrapper for popular malware configuration data decoders from:Maco:https://github.com/CybercentreCanada/Maco[MIT license]MWCP framework:https://github.com/Defense-Cyber-Crime-Center/DC3-MWCP[MIT license]CAPE Sandbox*:https://github.com/kevoreilly/CAPEv2/[GPL license] (many thanks to @kevoreilly for releasing so many open source parsers).Support using an oldforkbut actively working on official native support with upstream!MWCFG :https://github.com/c3rb3ru5d3d53c/mwcfg[BSD 3-Clause License]Pending support from malduck with structured outputInstallation GuideSetup YARA on Hostsudoapt-getupdate&&sudoapt-getinstall-ygitlibssl-devlibmagic-devautomakelibtoolmakegccwgetlibjansson-devpkg-configexportYARA_VERSION=4.1.3
wget-O/tmp/yara.tar.gzhttps://github.com/VirusTotal/yara/archive/v${YARA_VERSION}.tar.gz
tar-zxf/tmp/yara.tar.gz-C/tmpcd/tmp/yara-${YARA_VERSION}./bootstrap.sh
./configure--enable-magic--enable-dotnet--with-crypto--prefix/tmp/yara_install
make
makeinstall
pipinstall--global-option="build"--global-option="--enable-dotnet"--global-option="--enable-magic"yara-python==$YARA_VERSIONRunning in a Containerdockercontainerrun\-v/path/to/parsers:/mnt/parsers\-v/path/to/samples:/mnt/samples\cccs/assemblyline-service-configextractor\"cx -p /mnt/parsers -s /mnt/samples"UsageCommand-lineYou can useconfigextractororcxto make use of the CLI:Usage: cx [OPTIONS] PARSERS_PATH SAMPLE_PATH

Options:
  --block_list TEXT  Comma-delimited list of parsers to ignore
  --help             Show this message and exit.Pythonfromconfigextractor.mainimportConfigExtractorimportlogging# Create a logger to track ongoingslogger=logging.getLogger()logger.handlers=[logging.StreamHandler()]logger.setLevel('DEBUG')# Instantiate instance of class with path(s) to extractors# Attaching a logger will allow some insight into what's going on if parser detection is the issuecx=ConfigExtractor(["/path/to/extractors/"],logger=logger)# List all parsers actively detected and loaded into instance# cx.parsers.keys() lists all the relative module paths to the parsers# The value of each key is an Extractor object containing details for running the extractor (ie. venv location, YARA rule, etc.)print([cx.get_details(p)['name']forpincx.parsers.values()])# Run all loaded parsers against sampleresults=cx.run_parsers('/path/to/sample')# Output raw results to stdout, each should be organized by the parsers that generated an outputprint(results)Adding a new Parser FrameworkInherit from the baseFrameworkclass and implement class accordinglyAdd new framework to the ConfigExtractor class'FRAMEWORK_LIBRARY_MAPPING
Package: configfactory
Distributed configurations serverNext releasev1.18 (2016-10-31)removed client in favour of am-configv1.17 (2016-10-12)added client cachev1.16 (2016-10-12)cleanup warningv1.15 (2016-09-30)cleanup warningv1.14 (2016-03-15)api fixesv1.13 (2016-02-21)added client environment propertyadded client not supported environments warning messagev1.12 (2016-02-19)added global propertyv1.11 (2016-02-19)added update confirmationv1.10 (2016-02-19)added timezone supportv1.9 (2016-02-19)added client default settingsv1.8 (2016-02-19)added json key sortingv1.7 (2016-02-19)added json schema validationv1.6 (2016-02-18)fixed backup directory