Saravanan666/pypi-org huggingface dataset:
Package: config-probe
[![Build Status](https://travis-ci.org/internap/python-config-probe.svg?branch=master)](https://travis-ci.org/internap/python-config-probe)[![PyPI version](https://badge.fury.io/py/config-probe.svg)](http://badge.fury.io/py/config-probe)Mission=======Provide an auto-discovery process of configurations for simple code use. Given a path and a list of pattern,the result config will be a shortcut to any config.## UsageSetup:config = probe(path="path/to/my/files",patterns=["path/(*)/file.yaml"])Use it:print config.mynamespace.key## Parameters- **path**Initial path to probe.  Patterns will be tested against the file structure underneath the pathand it will be ignored in determining the namespacing.- **patterns**A list of file paths containing (or not) placeholders "(\*)" o find where the configuration files are located.The patterns definition order defines which keys has the priority, the last one being the most relevant.Each placeholder in the path will result in a namespace in the resulting config.  So let's say you have a patterndir1/(*)/dir2/(*).yamlIf this pattern finds the file : "dir1/**ns1**/dir2/**file**.yaml" that contains "key: 'value'", the resultingconfig will beconfig.ns1.file.key == "value"now if the pattern wasdir1/ns1/dir2/file.yamlfor the same file, the resulting config would simply beconfig.key == "value"so you can use placeholders "(\*)" to namespace the resulting config and use "\*" without the parenthesisto have a variable path without the namespacingdir1/(*)/dir2/*.yamlconfig.ns1.key == "value"## Mocking the probingYour unit test can have your code use fake_probe instead to which to give a dict and it will appear as if itwas just probed. Example:config = fake_probe({"ns1": {"file": {"key": "value"}}})# thenconfig.ns1.file.key == "value"Contributing============Feel free to raise issues and send some pull request, we'll be happy to look at them!
Package: configprops
configpropsIntroductionThis package provides a configuration base class to be extended with list of KEYS (same prefix) that could be overridden by environment variables.APIclassConfigurationProperties(key_name_prefix:str,dot_env:bool=False,debug=False):...flagdot_envmeans loading.envfile.Examples#!/usr/bin/env python3fromconfigpropsimportConfigurationPropertiesimportosclassAppTestConfig(ConfigurationProperties):TEST_APP_CONFIG_KEY_TEXT='Original'TEST_APP_CONFIG_KEY_BOOL=TrueTEST_APP_CONFIG_KEY_INT=32TEST_APP_CONFIG_KEY_FLOAT=3.3TEST_APP_CONFIG_KEY_OTHER=55deftest_override():os.environ['TEST_APP_CONFIG_KEY_BOOL']='0'os.environ['TEST_APP_CONFIG_KEY_FLOAT']='8.5'os.environ['TEST_APP_CONFIG_KEY_INT']='185'config=AppTestConfig('TEST_APP_CONFIG_')assertconfig.TEST_APP_CONFIG_KEY_BOOL==Falseassertconfig.TEST_APP_CONFIG_KEY_OTHER==55assertconfig.TEST_APP_CONFIG_KEY_FLOAT==8.5assertconfig.TEST_APP_CONFIG_KEY_INT==185
Package: config-proxy
config-proxyThis is a Python module that enables you to setup paths for both json configuration and configuration from env variables.It automatically looks into environmental variables and either uses its value, or looks it up in json configuration file or falls back to default.InstallEither clone from this repository or usepip/poetrylike so:Viapippip install config-proxyUsingpoetrypoetry add config-proxyUsageBasic usageIf your configuration file is either calledconfig.jsonand is expected in the current working directory or its location is set usingCONFIG_PATHenvironmental variable, the usage is fairly easy:config.json{"database":{"host":"mydbhost.databases.com"}}main.pyfromconfig_proxyimportStringPropertydatabase_host=StringProperty(path="database.host",env="DATABASE_HOST",default="localhost")print(database_host.value)$pythonmain.py
mydbhost.databases.com

$DATABASE_HOST="overridden.database.com"pythonmain.py
overridden.database.comAdvanced usageIf you want to specify configuration file path and customize env variable that stores the path, you have to extend theConfigProxyclass and overload attributes you wish to change.my-special-config.json{"database":{"host":"mydbhost.databases.com"}}custom.pyfromconfig_proxyimportConfigProxyas_ConfigProxy,StringPropertyclassConfigProxy(_ConfigProxy):env_location="ENV_VARIABLE_THAT_CONTAINS_MY_CONFIG_PATH"config_file_names=["my-special-config.json"]Please note, thatStringPropertynow does not know it should use your subclass instead, do not forget to specify it when creating the property:database_host=StringProperty(path="database.host",env="DATABASE_HOST",default="localhost",proxy=ConfigProxy)print(database_host.value)If you want to specify a custom config file, you can use:$ENV_VARIABLE_THAT_CONTAINS_MY_CONFIG_PATH="/actual/path/to/my/config.json"pythoncustom.py
mydbhost.databases.com
Package: configpy
configpy is a JSON configuration file reader with support
for variable look-ahead and look-behind, expressions, and
comments.Exampleconfig_json = """
/* Some example configuration items */
{
    "a": 10,
    "b": 2,
    "c": "{{ ${a} / ${b} }}",
    "d": "{{ ${c} * ${a} }}",
    "e": "{{ ${d} + 50 }}",
    "f": "{{ ${e} - 25 }}",
    "g": "'some text = {{ ${a} / ${b} }}'"
}
"""

config = Config(config_json)
10 == config.a
2 == config.b
5 == config.c
50 == config.d
100 == config.e
75 == config.f
"some text = 5" == config.g
Package: config-py2
A Config Management CLI Tool similar to dynaconf for python 2 and above=============================================================================The library provides a basic cli toolconfig_py2to initialize a config mechanism in the current directoryOnce installed you can run the--helpto see the list of commands and options supported.Please note that although the validation is missing currently, it will be supported in future releases.$ config_py2 --help

Usage: config_py2 [OPTIONS] COMMAND [ARGS]

Options:
  --version         Show config_py2 version currently installed
  --help            Show this message and exit

Commands:
  init              Inits a config_py2 project. Default behavior of using `settings.toml` can be overriden with [ARGS]      
  list              Lists all defined config values

Args:   Optionally use EITHER one of these in conjunction with `init` command
  -f, --filename    Pass one or more of this followed by a filename (with extension) to give a list of file(s) to use for config
  -t, --filetype    Pass one or more of this followed by a filetype (extension) to use for settings file.
                    Possible values are: [toml | json | yaml]
                    Please note that this option will not be used if filenames are passed via the -f, --filename flag       
  -e, --env_prefix  Pass this option to override the ENV_PREFIX that will be used to override configs with the shell variables
                    Format of environment variables will be `ENV_PREFIX_{}`. By default it is set to 'CONFIG'Examples to get you started with theinitcommand# Initializes a config_manager.py and settings.toml with placeholders for various environments
$ config_py2 init
Configuring your environment. Please Wait !


# Initializes a config_manager.py and settings.json with placeholders for various environments
$ config_py2 init -t json
Configuring your environment. Please Wait !


# Initializes a config_manager.py and settings.toml, settings-override.toml with placeholders for various environments
# Note that the configs will be read in the same order as provided during the `init` command

# Also note that the subsequent settings files don't need to have a `default` section of their own as long
# as the first file has one. This can be useful when you have seperate files for different environments

$ config_py2 init -f settings.toml -f settings-override.toml
Configuring your environment. Please Wait !


# This wil print the list of all configs as it'll be available for your application
$ config_py2 list
{
    "APP_ENV": "local",
    "CONFIG_ENVIRONMENT": "local"
}Examples for usage in code once the config mechanism is initialized via the cli-tool$ export CONFIG_ENVIROMENT=local

$ python
    >>> from config import settings
    >>> settings.APP_ENV
    'local'
    >>> settings.CONFIG_ENVIRONMENT
    'local'
Package: configpy-file
Create config file.Supports: config.c, config.h, config.cpp, config.hpp, config.py and config.pyc
Use it as this:#!/usr/bin/env python3

from config_py import ConfigPy
config = ConfigPy()
config['number'] = 42.5
config['string'] = 'hello'
config['none'] = None
config['boolean'] = True
config.save('./config.py')
Package: configration
configrationA module to validate and load config files.InstallationpipinstallconfigrationVersion HistoryVersion 2.0.7 6 Aug 2023Status constant on  save toml_configVersion 2.0.6 29 Jun 2023Copy all testsVersion 2.0.5 29 Jun 2023Tests on json and TomlVersion 2.0.4 18 June 2023Invalid toml test correctedAdd tomli to requirements.txtVersion 2.0.3 9 June 2023Implement create()Implement save()Consolidated testing into one fileVersion 1.0.2 29 May 2023ProvidereprVersion 1.0.1 29 May 2023Expose TomlConfigVersion 1.0.0 29 May 2023Implement Toml configsTest suit introducedVersion 0.0.1 11 May 2023Better error message if config file is missingVersion 0.0.0 10 May 2023Initial version
Package: configreader
There are quite many Configuration Parsers for Python out there, but well, they
all kind of suck in there own way. Let me point out what I dislike:configparser: which is the de facto standard, has it’s ini like language, in
my opionion quite awful, difficult and limitedConfiguration through yaml: is beautiful, but how about intergration of
simple environment variables or interpolation of already defined valuesHow about just execution a python module, very unsafe (but who cares), but it
also pollutes the namespace with all sort of builtins and whatsoeverSo I was looking once again and foundpython-config, which looked really
exactly what I wanted, but well, I had my problems with it, since I wanted to
have acces to stuff likeos.getenv(‘HOME’)and similar, which was not really
possible since it was forbidden to call a function, though you could still
evaluate stuff and so on. I looke into the source and thought well how can I
allow also calling functions? But I realized they are defining there own
parsing grammar, which seemed kind of reinventing the wheel since I already
knew theastmodule.Finally I wrote a very simple Configuration Parser which letsastandoperatordo most of the work. It has of course its own problems, and is hack
of half an hour so don’t expect much. For me it is still usefull, and maybe we
can improve it.UsageAs a simple example of what is possible and how to use the module, see the
following config file which is by the way completely valid python:home = os.getenv('HOME')
aster_root = home+"/data/opt/aster"
project = "bikeframe-test"
version = "testing"
# source directory for all files if relative path
srcdir = "."
# output directory for all stuff
outdir = "results"
# input mesh file
meshfile = "mesh.med"
logfile = "asterclient.log"
workdir = "/data/tmp"
# define the studies
calculations = [
    {"name":"main",
      "commandfile": "main.comm",
      "resultfiles":{
            "bikeframe.rmed":80,
            "bikeframe.msh": 81,
            "buckling.rmed": 82,
            "bikeframe.table": 39,
            "bikeframe.resu": 38,
            "buckling.resu": 37,
            },
      "inputfiles":["parameters.py"],
      },
    {"name": "post",
      "commandfile":"post.comm",
      "poursuite": "main",
      "resultfiles":{
        "vmises.table": 40,
        "protocol": "protocol*.rst",
        }
      }]Suppose we have this saved asprofile.confwe could read it like:import os
from configreader import Config

c = Config(open('profile.conf','r'),namespace={'os.getenv':os.getenv})which would give as all the values specified and evaluated as a pythondict.
If we wouldn’t have provided the namespace withos.getenvthe parsing would
have failed since it only allows functions mapped in the namespace, so you have
completele fine grained possibility on what to allow.
As input theConfigclass expects any file like object which is an object
with a read method.TestingThere are a few simple test cases intestsuse bestpy.testto run them.
Package: config-redis
config-redisconfig-redis是一个python库，用于从redis获取项目配置，并且可以在项目中隐藏您的配置详细信息，以免配置信息泄露。Installation1.使用python包管理工具pip进行安装.pipinstallconfig-redis2.本项目需要使用redis存储配置3.从命令行设置环境变量或写入配置文件exportCONF_FOR_REDISCONF="{'host': '172.0.0.1', 'port': 6379, 'db': 0, 'password': 'your_password', 'decode_responses': True}":$CONF_FOR_REDISCONFUsage1.setup your config, e.g: your_proj/setting.pyfromconfigredisimportSetConfig,Tools,SetRediscon=SetConfig.ConfigArgs()# env 关键字是default, default是全局配置，可以放置env共用的配置SetConfig.defaultconfig(c_env='default',disk_name='TenD')# env 关键字是devSetConfig.devconfig(c_env='dev',celery_broker="amqp://user:password@172.0.0.1:5672//",r_flow={'host':Tools.host_ip('httpbin.org'),'port':7000,'db':0,"cluster":True},r_flow1={'host':'httpbin.org','port':7000,'db':0,"cluster":True})# env 关键字是proSetConfig.proconfig(c_env='pro',celery_broker="amqp://user:password@172.0.0.1:5672//",disk_name="TenB")# env 关键字是custom_envSetConfig.envconfig('custom_env',c_env='custom_env')config=SetConfig.configs('bin.org')# 如果明文配置env，会以明文配置优先，如果配置文件删除明文配置，则会查找redis最新配置，SetConfig.configs会自动把明文配置持久化到redis, replace_domain参数可以自动解析相关域名IP，适合局域网静态IP地址，如果是动态IP，请关闭。if__name__=='__main__':print(config)# 获得当前env的配置2.运行上一步SetConfig.configs会自动会自动把明文配置持久化到redis，此时删除所有明文配置文件SetConfig.defaultconfig/SetConfig.devconfig/SetConfig.proconfig/SetConfig.envconfig，项目会自动从redis拉取最新的配置。fromconfigredisimportSetConfig,Tools,SetRediscon=SetConfig.ConfigArgs()config=SetConfig.configs('bin.org')if__name__=='__main__':print(config)# 获得当前env的配置# print(SetConfig.getconfs())  # 查看redis中项目目前所有版本配置# SetConfig.print_config()  # 罗列项目所有版本的配置信息，并根据index打印相关配置，方便复制到配置文件, 顺序从新到旧# print(con['custom_env'])  # 根据env查看redis储存的最新配置# SetConfig.upsert_field_to_redis('custom_env', disk_name='TenC')  # 明文配置删除的情况下，给redis中的最新配置增加字段，不要跟明文配置同时使用，会导致redis版本错乱  # noqa# print(Tools.lookup_redis_proj_config())  # 显示redis存储的最新配置# print(Tools.lookup_proj_config(replace_domain='bin.org'))  # 显示当前所有env配置，明文优先于redis配置# print(SetRedis().getkeys())  # 查看redis所有的项目名称# SetConfig.delconfs()  # 罗列项目所有版本的配置信息，并根据index删除相关配置, 顺序从旧到新3.在项目中导入config获得对应的配置fromtests.settingimportconfigdeftest_env():returnconfig['celery_broker']if__name__=='__main__':print(test_env())4.使用命令行根据关键字获得配置运行项目。pythonsample.pypro/dev/custom_env# default 是全局配置，可以放置env共用的配置Contributing使用前请做适当的测试，以确定跟您的项目完全兼容。LicenseMIT
Package: config-registry
Python Config Registry Package说明这是一个 Python 配置快速注册调用模块，主要解决多维数组深层次配置调用问题。链接GitHubPyPI安装pip install config-registry设置获取数据from ConfigRegistry import ConfigRegistry

setting = Registry()

setting.set('a', 'a')
setting.set('b', {'bb': 'bbb'})
setting.set('c.h', 'h')

print(setting.get())
print(setting.get('b.bb'))加载字典from ConfigRegistry import ConfigRegistry

setting = ConfigRegistry()

setting.load({'a': {'aa': 'aaa'}})
print(setting.get('a.aa'))合并字典from ConfigRegistry import ConfigRegistry

setting = ConfigRegistry()

setting.load({'a': {'a1': 'aaa1'}})
setting.merge('a', {'a2': 'aaa2' })
print(setting.get('a'))设置默认值from ConfigRegistry import ConfigRegistry

setting = ConfigRegistry()

setting.set('a', 'aaa')
setting.default('a', 'bbb')
setting.default('c', 'ccc')
print(setting.get('a'))
print(setting.get('c'))钩子调用import time
from ConfigRegistry import ConfigRegistry

setting = ConfigRegistry()

def callback():
    print('callback')

setting.set_hook('hook', 3, callback)
time.sleep(1)
setting.refresh_hook('hook')
time.sleep(3)
setting.refresh_hook('hook')扁平化数据from ConfigRegistry import ConfigRegistry

setting = ConfigRegistry({'a': {'aa': 'aaa'}, 'b': {'bb': 'bbb'}})
print(setting.flat())
Package: config-resolver
Full Documentationhttps://config-resolver.readthedocs.org/en/latest/Repositoryhttps://github.com/exhuma/config_resolverPyPIhttps://pypi.python.org/pypi/config_resolverconfig_resolverprovides a simple, yet flexible way to provide
configuration to your applications. It follows theXDG Base Dir Spec(This instance is
based on 0.8 of this spec) for config file locations, and adds additional ways
to override config locations. The aims of this package are:Provide a simple APIFollow well-known standards for config-file locationsBe as close to pure-Python as possibleBe framework agnosticAllow custom configutaion types (.iniand.jsonsupport is shipped by
default)Allow to provide system-wide defaults but allow overriding of values for more
specific environments. These are (in increasing order of specificity):System-wide configuration (potentially requiring root-access to modify)User-level configuration (for all instances running as that user)Current Working Directory configuration (for a running instance)Per-Instance configuration
Package: configrw
ConfigRWConfigRW is a simple python module which read and write config files based on key-value or INI-structure.Key featuresMaximum preserves formatting of the source file (indents, spaces, comments, etc)Support non-section (for access for simple config files based on key-value)Inserting an option on an arbitrary string in the sectionSupport multiple values of optionSupport options without valuesSupport comments in a sectionSupport indentation for options, valuesSecure file rewriting. Using *.new file on write, then renamed to original filenameInstallationInstallation package to user python-library directory:$pipinstall--userconfigrwOr you can install package to global system directory of python libraries (not recommended):$sudopipinstallconfigrwDocumentationYou can find a full manual on how to use ConfigRW atreadthedocsQuick startIn next examples we will use the following INI file:# This is commentthis is option=this is valuesecond option=-100[ SECTION1 ] # commentoption1=100option2=200# commentoption3=1.2[ section2 ]param1='str'param2=0# commentparameter_without_value[section3]extensions=# comment1ext1# comment2ext2ext3Access to non-section areaThis is features needed if you want use simple key-value of config filefromconfigrwimportConfigconfig=Config.from_file('/path/to/file')section=config[None]# Getting non-sectionvalue=section['this is option']# Getting the valuesection['this is option']=None# Setting the valuedelsection['second option']# Deleting the optionAccess to section areaThis is features needed if you want use INI config filevalue=config['SECTION1']['option2']# Getting the valueconfig['SECTION1']['option2']=0# Setting the valueconfig['SECTION1']['option3']=300# Adding new option to sectionconfig['section3']['extensions'].append('ext4')# Adding new value to multiple valuesconfig['section3']['extensions'].insert('ext0',0)# Inserting new valueconfig['section3']['extensions'][0]='extension0'# Changing single value of multiple valuesconfig.write('/path/to/file')# Saving config to file# Render config to screenforlineinconfig.to_text():print(line)INI-file after changes:# This is commentthis is option[ SECTION1 ] # commentoption1=100option2=0# commentoption3=300[ section2 ]param1='str'param2=0# commentparameter_without_value[section3]extensions=extension0# comment1ext1# comment2ext2ext3ext4
Package: configs
Parsing INI configs must be easy, as are the INI files.Configsprovides a simple API for getting data from INI config files.Loading data from a config is as easy asconfigs.load('my.conf').Configswork with Python 2.7+ (including 3).The repo is atbitbucket.org/moigagoo/configs.Read the full documentation atconfigs.rtfd.org.FeaturesRoot-level params supportNumeric and boolean values are converted automaticallySections with only key-value items are parsed as dictsSections with only flag items (keys with no value) are parsed as listsMixed content sections are parsed as tuples of a dict and a list, which can be accessed individuallySections are iterable (even the mixed ones; list first, dict second)Comments supportInstallationInstall configs with pip:$pipinstallconfigsUsageLoad a config file:>>> import configs
>>> c = configs.load('sample.conf')
>>> c['general']
{'foo': 'baz'}TestsRun the tests with:$pythontest_configs.py
Package: config-sci
Python script for autoconfig SublimeCodeIntel (http://sublimecodeintel.github.io/SublimeCodeIntel/)Free software: BSD licenseHow useFirst: install from pip`text pip installconfig-sci`Second: execute the command (In the project’s root path)`text $ config_sci `Check the file`text $ cat .codeintel/config `FeaturesAutoconfig SublimeCodeIntel with system environment or virtual environment.History0.1.0 (2013-12-30)First release on PyPI.
Package: config-sesame
Copyright ©  2016 1&1 Group <jh@web.de>Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: configset
configsetsimple write config/setting, wrap of configparserInstallingInstall and update usingpip_:.. code-block:: text$ pip install configsetconfigset supports Python 2 and newer, Python 3 and newer, and PyPy... _pip:https://pip.pypa.io/en/stable/quickstart/ExampleWhat does it look like? Here is an example of a simple configset program:.. code-block:: pythonimport configset

class pcloud(object):

    def __init__(self, **kwargs):
        ...
        self.CONFIG.configname = os.path.join(os.path.dirname(__file__), 'config.ini')
        self.CONFIG = configset.configset(self.CONFIG.configname)
        ...

        self.username = self.CONFIG.read_config('AUTH', 'username', "admin")
        self.password = self.CONFIG.read_config('AUTH', 'password', "12345678")
        ...SupportPython 2.7 +Windows, LinuxLinksLicense:BSD <https://bitbucket.org/licface/configset/src/default/LICENSE.rst>_Code:https://bitbucket.org/licface/configsetIssue tracker:https://bitbucket.org/licface/configset/issues
Package: config-setup
Configuration Creator for PythonA Python library for managing configurations. Supports saving and loading configurations in various formats, such as JSON, YAML, XML, INI, and CFG.InstallationTo install the library, you can use pip:pip install ConfigSetupUsageTo use the ConfigSetup library in your Python code, you can import it and create an instance of theConfigSetupclass:fromconfig_setupimportConfigSetupconfig=ConfigSetup()Setting and Getting ValuesTo set a value in the configuration, you can use thesetmethod:config.set('name','John')To get a value from the configuration, you can use thegetmethod:name=config.get('name')Saving and Loading ConfigurationsTo save the configuration to a file, you can use thesavemethod and specify the file format:config.save('config','json')To load a configuration from a file, you can use theloadmethod and specify the file path:config.load('config.json')Validating ConfigurationsTo validate a configuration data string against a specific format, you can use thevalidatemethod and specify the format:data='{"name": "John", "age": 30}'valid=config.validate(data,'json')Clearing the ConfigurationTo clear the configuration, you can use theclearmethod:config.clear()LicenseThis library is released under theMIT License.ContributingContributions are always welcome! If you'd like to contribute to this library, please follow these steps:Fork the project on GitHub.Clone your forked repository to your local machine.Create a new branch for your changes.Make your changes and commit them, making sure to write clear commit messages.Push your branch to your forked repository.Submit a pull request to the main project repository, explaining your changes and why they should be merged.Before submitting a pull request, please make sure to run the tests by executing the following command from the project's root directory:python -m unittest discoverIf any tests fail, please investigate and fix the issue before submitting your pull request.Thank you for your interest in contributing to this project!