Saravanan666/pypi-org huggingface dataset:
Package: py-config-handler
ConfigHandlerDescriptionCreate, update, and remove values from a configuration file made by ConfigHandler.Simple Mode: Store simple data (e.g., version, program statistics, etc.) in a single file.Advanced Mode: Store configuration data using JSON data format. Supports metadata, encryption, and compression.Installationvia pip:pip install py-config-handleras a Git submodule:git submodule add https://github.com/Chris1320/ConfigHandler-python.gitUsageSimple Mode[QuickStart]Creating a New Configuration Filefromconfig_handler.simpleimportSimpleconfig=Simple("config.ini")# Create a new configuration file by assigning key-value pair.config.set("foo","bar")# "foo" is the key, "bar" is the value.config.set("nums",123)config.set("dec",3.14)config.set("Aboolean",True)config.set("unintentional variable!","unintentional value.")# Remove valuesconfig.remove("unintentional variable!")config.save()# Save the data to the file.[QuickStart]Loading an Existing Configuration Filefromconfig_handler.simpleimportSimpleconfig=Simple("config.ini")# Load the data from the file.config.load()# Get values from the loaded data.config.get("foo")# "foo" is the key.# Change value of a key.config.set("foo","barred")# Add a new key-value pair.config.set("new_key","new_value")# Encode configuration file to Base64.config.isbase64=True# Save changesconfig.save()A key can be any string, but must not start with a#, include a=, or include a\n.
A value can by any string, integer, or float.Advanced Mode[QuickStart]Creating a New Configuration Filefromconfig_handler.advancedimportAdvancedconfig=Advanced("config.ini","p4ssw0rd")# Password is required when encryption is not None.config.new(name="Advanced Mode Test",author="Chris1320",compression="zlib",encryption="aes256")# Create a new configuration file by assigning key-value pair.config.set("foo","bar")# "foo" is the key, "bar" is the value.config.set("nums",123)config.set("dec",3.14)config.set("Aboolean",True)config.set("unintentional variable!","unintentional value.")# Remove valuesconfig.remove("unintentional variable!")config.save()# Save the data to the file.[QuickStart]Loading an Existing Configuration Filefromconfig_handler.advancedimportAdvancedconfig=Advanced("config.ini","p4ssw0rd")# Password is required when encryption is not None.# Load the data from the file.config.load()# Get values from the loaded data.config.get("foo")# "foo" is the key.# Change value of a key.config.set("foo","barred")# Add a new key-value pair.config.set("new_key","new_value")# Encode configuration file to Base64.config.metadata()# Get metadata of the configuration file.# Save changesconfig.save()
Package: py-config-runner
Python Configuration and a command line RunnerPython configuration file and command line executable to run a script with.Why a python file as configuration?Configuration of any complexityNo need to serialize the configurationNo need other meta-languages for the configurationUsageIn the codeConfiguration file (e.g.config.py):num_epochs=100batch_size=256model=resnet18(10)train_loader=get_train_loader("/path/to/dataset",batch_size=batch_size)unsup_dataloader=get_train_unsup_loader("/path/to/unsup_dataset",batch_size=batch_size)...Script file (e.g.training.py):fromtorch.utils.dataimportDataLoaderfrompy_config_runnerimportConfigObject,TrainvalConfigSchemaclassSSLTrainvalConfigSchema(TrainvalConfigSchema):unsup_dataloader:DataLoaderdeftraining(config):# ...print(config.config_filepath)print(config.output_path)print(config.num_epochs)print(config.model)print(len(config.train_loader))defmain():config_filepath="/path/to/config.py"config=ConfigObject(config_filepath)SSLTrainvalConfigSchema.validate(config)# Add more things at runtimeconfig.output_path="/tmp/output"training(config)With launchercd/path/to/my/project
py_config_runnerscripts/training.pyconfigs/train/baseline.pyorcd/path/to/my/project
python-u-mpy_config_runnerscripts/training.pyconfigs/train/baseline.pyor if your specific launcher requires only python script files:cd/path/to/my/project
python-mspecial_launcher`py_config_runner_script`scripts/training.pyconfigs/train/baseline.pyThe only condition on the script file is it should containrun(config, **kwargs)callable method. Additionally,
argument kwargs containslogger(e.g.kwargs['logger']) andlocal_rank(e.g.kwargs['logger'])
for distributed computations.No restrictions are applied on the configuration file. It is user's responsibility to provide the script file that can
consume given configuration file. Provided configuration file is loaded as python module and exposed into the script as
the module namedconfig.ExamplesExample for Machine/Deep LearningInstallationpipinstallpy-config-runner
Package: py-configs-registry
Python Registry Package说明这是一个 Python 配置快速调用模块，主要解决 Json or Yaml 深层次配置调用问题。使用fromregistryimportRegistryregistry=Registry()registry.set('a','a')registry.set('b',{'bb':'bbb'})registry.set('c.h','h')print(registry.get())print(registry.get('b.bb'))加载字典fromregistryimportRegistryregistry=Registry()registry.load({'a':{'aa':'aaa'}})print(registry.get('a.aa'))合并字典fromregistryimportRegistryregistry=Registry()registry.load({'a':{'a1':'aaa1'}})registry.merge('a',{'a2':'aaa2'})print(registry.get('a'))设置默认值fromregistryimportRegistryregistry=Registry()registry.set('a','aaa')registry.default('a','bbb')registry.default('c','ccc')print(registry.get('a'))print(registry.get('c'))高级用法### 实例化 RedisRedis(**registry.get(prefix))### 初始化 MysqlMysql(**registry.get(prefix))
Package: pyconfigstore
# ConfigStoreA Python module for handling config files. It helps handles persist config files and also giving the ability to set, get, update and delete config settings> Easily load and persist config without having to think about where and howIt's built base on nodejs [configstore](https://github.com/yeoman/configstore)Config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.localconfig`.<br>Example: `~/.localconfig/configstore/name.json`## Installation```bashpip install pyconfigstore```## Usage```pythonfrom pyconfigstore import ConfigStore# create a Configstore instance with a unique name e.g. gnit# Package name and optionally some default valuesconf = ConfigStore("Gnit", {"foo": 'bar'});print(conf.get('foo'));#>>> 'bar'conf.set('awesome', True);print(conf.get('awesome'));#>>> True# Use dot-notation to set nested propertiesconf.set('bar.baz', True);print(conf.get('bar'));#>>> {"baz": True}# escape dot-notation to set nested propertiesconf.set('bar.baz\\.bag', True);print(conf.get('bar'));#>>> {"baz.bag": True}conf.delete('awesome');print(conf.get('awesome'));#>>>```## API### Configstore(packageName, [defaults], globalConfigPath)Returns a new instance.#### packageNameType: `str`Name of your package.#### defaultsType: `dicts`Default config.#### globalConfigPathType: `bool`<br>Default: `False`Store the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot.### FeaturesYou can use dot-notation to set, get, update and delete nested dict properties### .set(key, value)Set an item.### .set(dict)Set multiple items at once.### .get(key)Get an item.### .has(key)Check if an item exists.### .delete(key)Delete an item.### .clear()Delete all items.### .all()Get all the config as a dict or replace the current config with an object:```pythonconf.all({hello: 'world'})```### .sizeGet the item count.### .pathGet the path to the config file. Can be used to show the user where the config file is located or even better open it for them.## ContributeYes, you can contribute. Just dm on twitter:[@OyetokeT](http://twitter.com/@OyetokeT)## TODOThere are couple of things I still need to add1. Dot-notation: Currently, you can only set configs using this feature. (get, delete)2. Stream: I planned to add a param that'll indicate that you want it to hit the file for every operation. Well that's how it works currently though. But to make it smarter, we don't need to hit the file for (size, get, has, all) operation. We are going to call the `.all()` once to get the configs in dicts and do the operation just using dict properties.and more...## LicenseCopyright - 2018Oyetoke Toby twitter:[@OyetokeT](http://twitter.com/@OyetokeT)MIT LICENSE
Package: pyconfigstore3
ConfigStoreA Python module for handling config files. It helps handles persist config files and also giving the ability to set, get, update and delete config settingsEasily load and persist config without having to think about where and howIt's built base on nodejsconfigstoreConfig is stored in a JSON file located in$XDG_CONFIG_HOMEor~/.localconfig.Example:~/.localconfig/configstore/name.jsonInstallationpipinstallpyconfigstoreUsagefrompyconfigstoreimportConfigStore# create a Configstore instance with a unique name e.g. gnit# Package name and optionally some default valuesconf=ConfigStore("Gnit",{"foo":'bar'})print(conf.get('foo'))#>>> 'bar'conf.set('awesome',True)print(conf.get('awesome'))#>>> True# Use dot-notation to set nested propertiesconf.set('bar.baz',True)print(conf.get('bar'))#>>> {"baz": True}# escape dot-notation to set nested propertiesconf.set('bar.baz\\.bag',True)print(conf.get('bar'))#>>> {"baz.bag": True}conf.delete('awesome')print(conf.get('awesome'))#>>>APIConfigstore(packageName, [defaults], globalConfigPath)Returns a new instance.packageNameType:strName of your package.defaultsType:dictsDefault config.globalConfigPathType:boolDefault:FalseStore the config at$CONFIG/package-name/config.jsoninstead of the default$CONFIG/configstore/package-name.json. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot.FeaturesYou can use dot-notation to set, get, update and delete nested dict properties.set(key, value)Set an item..set(dict)Set multiple items at once..get(key)Get an item..has(key)Check if an item exists..delete(key)Delete an item..clear()Delete all items..all()Get all the config as a dict or replace the current config with an object:conf.all({hello:'world'}).sizeGet the item count..pathGet the path to the config file. Can be used to show the user where the config file is located or even better open it for them.ContributeYes, you can contribute. Just dm on twitter:@OyetokeTTODOThere are couple of things I still need to addDot-notation: Currently, you can only set configs using this feature. (get, delete)Stream: I planned to add a param that'll indicate that you want it to hit the file for every operation. Well that's how it works currently though. But to make it smarter, we don't need to hit the file for (size, get, has, all) operation. We are going to call the.all()once to get the configs in dicts and do the operation just using dict properties.and more...LicenseCopyright - 2018Oyetoke Toby twitter:@OyetokeTMIT LICENSE
Package: pyconfigurableml
Configurable MLPython utilities for easily configurable machine learning.This project utilizes the excellent tutorialHow to Publish an Open-Source Python Package to PyPIUsagefrompyconfigurableml.entryimportrundefmain(config,log):# TODO: put your logic here.passif__name__=='__main__':# The main function will be called with appropriate configuration# object and logger.run(main,__file__)# Alternative approach. Will only load configuration + run main if# __name__ == '__main__'.run(main,__file__,__name__)You may also use this library to configure a set of unit tests. If you're using
PyTest,frompyconfigurableml.entryimportrun_no_parse_argsdefcustom_setup_logic(config,log):# TODO: put your logic here.passdefsetup_module(module):# You probably don't want to attempt to parse command line arguments# inside unit tests.run_no_parse_args(custom_setup_logic,__file__)Configuring this libraryIn addition to using pyconfigurableml to parse and inject configuration into
your main method, you may also configure the library itself by adding some
information under apyconfigurablemlfield in your config file.First, to enable these extras, install them:pip install pyconfigurableml[azure,munch]Then, add subfields following the example below.# You may insert your other configuration here as usual.

# This section is for configuration specific to this library.
pyconfigurableml:

  azure:
    # Replace URLs to Azure Key Vault secrets with the secret values. The code
    # must be running in an environment with access to those key vaults.
    resolve_secret_identifiers: True

    # (Optional) Azure Active Directory tenant ID to use when initializing a
    # "default Azure credential" object.
    tenant: 2b9d773f-f2b1-43e7-8a53-bbe28bbb0c6b

  # Ensure files downloaded from the configured URLs exist at these paths
  # (relative to working directory). This library does not (yet) handle
  # authenticating against files stored in enterprise storage accounts (e.g.,
  # Azure blob storage).
  files:
    .data/resnet.tar.gz: https://github.com/onnx/models/raw/master/vision/classification/resnet/model/resnet18-v2-7.tar.gz
    .data/labels.txt: https://raw.githubusercontent.com/onnx/models/master/vision/classification/synset.txt

  # Dictionary mapping logger names to minimum levels. This is convenient for
  # suppressing overly verbose logs from consumed libraries.
  logging:
    azure.core.pipeline.policies.http_logging_policy: WARN

  # If this flag is set to true, the library will convert the configuration
  # object into a "JavaScript-style" object, i.e. a['b'] may be accessed via
  # a.b.
  munch: True
Package: pyconfigurathon
PyConfigurathonA python package for making it easy to use and manage configuration files in your python applications.InstallationUsing poetry`poetry add pyconfigurathon`Using pip`pip install pyconfigurathon`How to useThe recommended way to use this module is to have a module dedicated to your configuration. Eg. config.pyUse with an absolute path to the configuration file:from pyconfigurathon.configurator import configurator


def get_config(config_name, file_path="/path/to/file/settings.json"):
    cf = configurator(file_path)

    return cf.get(config_key=config_name)Use with a path to the configuration file relative to the config.py fileimport os
from pyconfigurathon.configurator import configurator


def get_config(config_name, file="settings.json"):
    conf = configurator(os.path.join(os.path.dirname(__file__), file))

    return conf.get(config_key=config_name)Please note that these are only examples to help you get started faster. There are other ways to use this package.
Package: pyconfigurer
PyConfigurerA GUI configuration library for python programs.UsagefromPyConfigurerimportConfigurer,ConfigTemplate,Token,FieldTypedefault_config={"user":"Arjix","age":18}config_template=ConfigTemplate([Token(FieldType.text_input,"user","Enter your name:",default_config["user"]),Token(FieldType.int_input,"age","Enter your age:",default_config["age"])])config=Configurer(config_template)new_config=config.run()print("Old config",default_config)print("New config",new_config)
Package: pyconfigvar
# pyconfigvarManage required and optional environment variables in your Python scripts.## Example`sh $REQUIRED_VAR="something"python ``python >>> import pyconfigvar >>>pyconfigvar.requiredvar('REQUIRED_VAR')'something' >>>pyconfigvar.requiredvar('MISSING_VAR')>>>pyconfigvar.requiredvar('MISSING_VAR')MISSING_VAR was not supplied in the environment. <drop back to shell> `## UsageThere are four functions available:###requiredvar(var)Returns the contents of the environment variablevar. Ifvaris not present in the environment,sys.exit()is invoked to terminate the interpreter.###optionalvar(var, default)Likerequiredvar(), but instead of terminating,defaultis returned.###requiredbool(var)Likerequiredvar(), but will coerce the value ofvarinto a boolean and return that. Essentially, anything non-zero or non-empty will return True, otherwise it will returnFalse.###optionalbool(var, default)Likerequiredbool(), but will returndefaultrather than terminate the interpreter.## ContributingPull request away!
Package: pyconfirmdeployment
version number: 0.0.1
author: Hannes HapkeOverviewA python package that can be installed with pip.Installation / UsageTo install use pip:$ pip install pyconfirmdeploymentOr clone the repo:$ git clonehttps://github.com/hanneshapke/pyconfirmdeployment.git$ python setup.py installContributingTBDExampleTBD
Package: pyconfita
PyConfita: Confita-like for PythonLibrary that ease reading a value from multiple key-value stores/backends with ordered evaluation.DisclaimerFree implementation of the GO libraryConfita.FeaturesBackends/stores supported:Environment variables (EnvBackend);File (YAML format) (FileBackend);Python dictionary object (DictBackend);Vault key-value store (VaultBackend);String parsing (serialized JSON) (StringBackend);Backends evaluation order: directly set by the order of backends inConfita.backendslist. The last notNoneevaluated value is returned;Explicit type conversion supported forstr, bool, int, float;Case sensitivity option: option to read key with casing variations (uppercased, lowercased).Quickstartfrompyconfitaimport(LoggingInterface,Confita,EnvBackend,StringBackend,DictBackend,VaultBackend,FileBackend)dumb_logger=LoggingInterface()c=Confita(logger=dumb_logger,backends=[FileBackend("/abs/path/vars.yaml"),DictBackend({"FOO":"bar"}),StringBackend("{'HELLO': 'WORLD'}"),VaultBackend(dumb_logger,default_key_path=f"path1"),EnvBackend(),],)v=c.get("FOO")# At least DictBackend should evaluate it as not NoneassertvisnotNone# Type should be `str`assertisinstance(v,str)Evaluation orderEvaluation is performed in order of the list of backends.
Next backend has priority over previous backend to set the value.importosfrompyconfitaimport(LoggingInterface,Confita,EnvBackend,DictBackend)dumb_logger=LoggingInterface()os.environ.setdefault("KEY","VALUE_FROM_ENV")c=Confita(logger=dumb_logger,backends=[DictBackend({"KEY":"VALUE","BOOL_1":"false","BOOL_2":"true"}),EnvBackend(),],)assertc.get("KEY")=="VALUE_FROM_ENV"# Environment backend overrides previous backends' valuesassertc.get("BOOL_1")=="false"# No implicit type conversionassertc.get("BOOL_2",type=bool)# Explicit type conversion requested# Reverse evaluation order by reversing list of backendsc=Confita(logger=dumb_logger,backends=[EnvBackend(),DictBackend({"KEY":"VALUE"}),],)assertc.get("KEY")=="VALUE"# Dict backend overrides previous backends' valuesExplicit type conversionType conversion must be explicit. Onlystr, bool, int, floattypes are supported.
Default type isstr.frompyconfitaimport(LoggingInterface,Confita,DictBackend)dumb_logger=LoggingInterface()c=Confita(logger=dumb_logger,backends=[DictBackend({"BOOL_1":"false","BOOL_2":"true"}),],)assertc.get("BOOL_1")=="false"# No implicit type conversionassertc.get("BOOL_2",type=bool)# Explicit type conversion requestedCase sensitivityfrompyconfitaimport(LoggingInterface,Confita,DictBackend)dumb_logger=LoggingInterface()# Case sensitivity is enabled by defaultc=Confita(logger=dumb_logger,backends=[DictBackend({"KEY":"VALUE"})],)assertc.get("KEY")=="VALUE"assertc.get("key")==None# Disable case sensitivityc=Confita(logger=dumb_logger,backends=[DictBackend({"KEY":"VALUE"})],case_sensitive=False)assertc.get("KEY")=="VALUE"assertc.get("key")=="VALUE"
Package: pyconfluent
pyconfluentpyconfluent brings most Confluent Kafka functionality to Python by providing wrappers for the KSQL and Schema Registry REST APIs, and an in-depth Pythonic interpretation of the Kafka Streams Java package inspired by Robinhood'sfaustand Winton'swinton-kafka-streams.InstallationThis package was written for Python 3.6 and was not tested on other versions.pip3 install pyconfluentUsagepyconfluent requires the Confluent Platform and all its underlying services to be running. When creating class instances, make sure to pass in the list of brokers running or leave it empty to connect tolocalhost.KSQLimport KSQL

k = KSQL()  # enter your boostrap_server here if not 'localhost', no port

# create streams from existing topics
sales_stream = k.ksql("CREATE STREAM sales (company VARCHAR, product BIGINT, quantity BIGINT)"
                      "WITH (KAFKA_TOPIC='sales', VALUE_FORMAT='JSON';")

reviews_stream = k.ksql("CREATE STREAM reviews (company VARCHAR, product BIGINT, review VARCHAR)"
                        "WITH (KAFKA_TOPIC='sales', VALUE_FORMAT='JSON';")

# stream to stream join, WITHIN clause required
# creates and populates new kafka topic
enriched_stream = k.ksql("CREATE STREAM enriched AS SELECT"
                         "sales.company, sales.product, sales.quantity"
                         "FROM sales LEFT JOIN reviews WITH 1 HOURS"
                         "ON sales.company = reviews.company")
Package: py-confluent
py-confluentBringing KSQL, Kafka Streams, Schema Registry APIs to Python 3,
all in one clean package.Installpip install pyconfluentUsagepyconfluent requires the underlying Kafka services to be running. The
easiest way is to start Confluent Platform, see: ``.KSQLimport KSQL

client = KSQL()  # enter your boostrap_server here if not 'localhost', no port
client.
Package: pyconfman
Easy Configuration Manager for Python applicationsConfiguration made easyWhen you need some configuration, or you need sets of configuration
to correspond to more stages such as development, test and production
you may want to have a single configuration set and refer to it
all over your application.Then you may want to incorporate your set of configration buckets
into your CLI application.installationinstall the package on your environmentusing pip:$pipinstallpyconfmanIncorporate it into your applicationIf you useclicklibrary to manage your application CLI
there is already,pyconfmancomes along with a simple function to add
the config group to your application'scli.group.For example, if your app has a command such asimportclick@click.group()defcli():"""My amazing application"""if__name__=="__main__":cli()you can incorporate theconfmanas following:importclickimportpyconfman@pyconfman.cli@click.group()defcli():"""My amazing application"""if__name__=="__main__":cli()This adds the configuration manager to your command line interfaceUsage and command line$ myapp --help

Usage: myapp [OPTIONS] COMMAND [ARGS]...

Options:
  -C, --conf-dir TEXT  configuration directory: [~/.config/<myapp>]
  --help               Show this message and exit.

Commands:
  config  Read or modify configuration files.
  ...
  ...Get configs on the spotUsage:myappconfig[OPTIONS]COMMAND[ARGS]...Readormodifyconfigurationfiles.

Options:--helpShowthismessageandexit.

Commands:getPrintoutconfigurationinformation.loadLoadafullconfigurationstoragefrom`path_to_json`file.setSetasinglevalueonaconfigurationstorage
Package: pyConfObj
#pyConfObjectDefine configuration files from classes and its relationsIt allows to load/export configuration from classes to json/yaml files easily
It allows to have code completion on your configuration objects and not depend on dictionariesExamplefromnumbersimportNumberfromconfObjimportConfObjclassPgServerConf(ConfObj):ip:str=""port:Number=5432username:str=""password:str=""classMainConf(ConfObj):pgconf:PgServerConf=PgServerConf()timezone:str="UTC"if__name__=="__main__":conf=MainConf()print("Default configuration:")print(conf.as_json())conf.pgconf.username="admin"print("Modified configuration for pg: ")print(conf.pgconf.as_json())UsageThe idea behind this module is to create a configuration object that can be organized as a tree and IDE's code completion features can be used.It should be used as:Define the structure of the whole configuration defining classes that inherit from `confObj``[optional] Assign default values to configuration items on codeOutput the defined configuration tree as a file (either yaml or json)[optional] Fix default values on the generated fileOn runtime, either load configuration or use default hardcoded values.[optional] On runtime, values can be changed and saved to file if necessary