Saravanan666/pypi-org huggingface dataset:
Package: configtreeview
This is an implementation of a GtkTreeView in python(using pygtk) that
allows for easy, fast, and dynamic setting up of a TreeView, its
TreeViewColumns and CellRenderers. This ConfigTreeView can create a TreeView
with all its properties initialized through the use of a simple config-type
file. This config file can be in a python dictionary format, or even read
in from a JSON object.The Why (Why use a ConfigTreeView?)The ConfigTreeView was designed in such a way to abstract the developer
from having to set up indices for how a ListStore row of data should look.
The config file creates an easy way to do it and allows you to supply a
row of data in python dict form(or a JSON) while initializing all the
properties, columns, cell renderers that could possbily be used in
creating a TreeView.Eliminates the several lines of code it takes to initialize a TreeView.
A TreeView is a very useful but also very complicated widget in the gtk
arsenal and this implementation takes away that complication.Useful for data sets that could change frequently without having
to go in and change the code.–This is actually the use case that I ran
into at my place of work that inspired me to create the ConfigTreeView. We
have an application that many people use in the office that is connected
to a server. The application gets all of the data from the server and
displays it in a GtkTreeView but the data could change in the near future
as we may need to display new columns or different formats of data in the
same TreeView so we wanted a system set in place that could allow for us
to change the data the server was sending without having to go in and
change the code in the clients(i.e. the TreeView) in order to properly
display the newly changed data. With a ConfigTreeView you can do just
this: the server can supply a config structure to initialize the clients,
eliminating the need for changing the client code.How to use itIt’s easy! All you need to do is create a config file(either as a python
dict in a .py file or as a JSON file).Then with a config file, you’re ready to create a ConfigTreeView:from config_treeview import ConfigTreeView
#Import the config structure(it's a python dict named config)
from myconfigfile import config
#Create a ConfigTreeView using config as the configuration structure
treeview = ConfigTreeView(config)
#Apply the config structure to finish initalizing the TreeView
treeview._apply_config()For more informationCheck out the documentation in the source in thehtml/directory starting withindex.htmlor visit the docs:http://packages.python.org/configtreeview/
Package: configu
@configu/pyConfigu SDK for Python published toPyPI.InstallpipinstallconfiguUsageimportosimportconfiguconfig_store=configu.InMemoryConfigStore()test_set=configu.ConfigSet("test")schema=configu.ConfigSchema("get-started.cfgu.json")configu.UpsertCommand(store=config_store,set=test_set,schema=schema,configs={"GREETING":"hello","SUBJECT":"configu python sdk",},).run()data=configu.EvalCommand(store=config_store,set=test_set,schema=schema).run()configuration_data=configu.ExportCommand(data=data).run()print(os.environ["MESSAGE"])# hey, configu python sdk!print(configuration_data)# {'GREETING': 'hey', 'SUBJECT': 'configu python sdk', 'MESSAGE': 'hey, configu python sdk!'}Referenceoss.configu.com/pyContributingRequirementsFollow theDevelopmentsection from theCONTRIBUTING.md.Installpyenv|HomebrewInstallpoetry|HomebrewSetupRun these commands in order:cdpypyenvinstallpyenvlocal3.9.16poetryenvuse$(pyenvwhichpython)poetryinstallContributeFollow theSending a Pull Requestsection from theCONTRIBUTING.md.
Package: configula
ConfigulaCreates a single configuration by merging settings defined in:
1. in environment variables
2. in toml fileValues provided inenvironment variables have priorityover values from
toml configuration file.By default all environment variables are prefixed with 'PAPERMERGE'.
By default__(two underscores) is used as delimiter in environment variables
names. For example, given following toml file:[main]
secret_key = 1234
[ocr]
default_language = 'deu'corespondent environment variables names are PAPERMERGE__MAIN__SECRET_KEY and
PAPERMERGE__OCR__DEFAULT_LANGUAGE - notice two underscores separate section name
from prefix and variable name.
Environment variable name format is (all in uppercase):<prefix><delimiter><section_name><delimiter><variable_name>Although in toml files you can place variable names outside sections, in Papermerge
all variablesmust be placed in sections.By default Configula looks up for following toml file:/etc/papermerge/papermerge.toml/etc/papermerge.tomlpapermerge.tomlIf you have custom location (or custom file name), usePAPERMERGE__CONFIG(notice double underscores) environment variable to point to it:PAPERMERGE__CONFIG=/app/config/pm.tomlInstallation$ poetry add configulaUsagefrom configula import Configula

config = Configula()

default_language = config.get('ocr', 'default_language')
secret_key = config.get('main', 'secret_key')Wherepapermerge.tomlhas the following content:[main]
secret_key = 5432

[ocr]
default_language = 'deu'Default language can be overwritten by environment
variablePAPERMERGE__OCR__DEFAULT_LANGUAGEand secret_key can overwritten
by environment variablePAPERMERGE__MAIN__SECRET_KEYIf you want to read variable from a section useconfigula.get(section, var_name, default_value)method.
Package: configura
ConfiguraConfigura is a Python configuration library that enables you to convert a folder of .json files into an easily accessible configuration folder.UsageSay you have a folder with the following structure:config_folder /
    main.json
    server.json
    misc.jsonYou can use configura to access those configurations like so:fromconfiguraimportconfig# Optionally, set your config folder here# base_path defaults to "./config" so if your folder is named config, you don't have to modify this at allconfig.base_path="./config_folder"# Print a misc.json as a dictionaryprint(config.misc)...# Access data inside the misc.json as a dictionaryprint(config.misc["model"])LICENSEMIT LicenseCopyright (c) 2023 Philippe MathewPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without plimitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: configurable
Allows attributes of classes and/or instances to be set directly through configfiles. Config file example followed by code:[sect1]foo=bar[Klass]prop1=qweprop2=456prop3=false[SubKlass]hihi = HEHE------------------------class Klass(Configurable):class SubKlass(Configurable):config = Config(hihi = "hoho")config = Config(prop1="asd",prop2=123,prop3=True)assert Klass.config.prop1 == "asd"assert Klass.config.prop2 == 123assert Klass.config.prop3 == Trueassert Klass.SubKlass.config.hihi == "hoho"c = ConfigFile(path, globals())assert Klass.config.prop1 == "qwe"assert Klass.config.prop2 == 456assert Klass.config.prop3 == Falseassert c.Klass.prop1 == "qwe"assert c.Klass.prop2 == "456"assert c.Klass.prop3 == "false"
Package: configurable-argparse-DavidRodriguezSoaresCUI
configurable_argparse- Argparse-based way of CLI argument handling boosted by YAML reusable configurationsWhen writing a command-line Python script that needs to take many arguments, usability issues may arise:Tediousness: Especially if used often with mostly the same argumentsIncompleteness: It's easy to miss argumentsRTFM fatigue: having to often refer to documentation takes away from actually using the softwareNeed to write execution scripts: Writing scripts with arguments is sensible but locks users into static configurationsConfigurable argparse aims at offloading the "noise" (often used argument configurations) into "recipes" that can be reused, while retaining the ability to override what needs to be adapted (the "signal"), therefore giving the user an experience that allows to efficiently use the program.ExampleThis simple example is there show how to use configurable argparse and how it makes usingWith argparsedef get_args():
    parser = argparse.ArgumentParser()

    parser.add_argument(
        '-t', '--nb_threads',
        type: int, default=4,
        help="Number of threads to use"
    )
    ...
    exclusive_group = parser.add_mutually_exclusive_group()
    exclusive_group.add_argument(
        '--verbose',
        action='store_true',
        help='Show all messages'
    )
    exclusive_group.add_argument(
        '--quiet',
        action='store_true',
        help='Show no messages'
    )
    parser.parse_args()

...

def main():
    args = get_args()Usage example:Every time:python example_program.py -t 4 --use_library=libabc --ignore=E123,E321 --add_src=/homes/user/documents/ --quality=0.65 --no_audio --quietIn this example, if the user wants to change an argument from run to run, the difference is lost in the "noise".With configurable_argparseARGPARSE_PARSER_ARGS = {"prog": "Example program"}
ARGPARSE_ARGUMENTS = [
    Argument(
        ('-t', '--nb_threads'),
        {
            'type': int,
            'default': 4,
            'help': "Number of threads to use"
        }
    ),
    ...
    ArgumentExclusiveGroup([
        Argument(
            '--verbose',
            {
                'action': 'store_true',
                'help': 'Show all messages'
            }
        ),
        Argument(
            '--quiet',
            {
                'action': 'store_true',
                'help': 'Show no messages'
            }
        )
    ])
]
...

def main():
    args = get_args(
        parser_args=ARGPARSE_PARSER_ARGS,
        arguments=ARGPARSE_ARGUMENTS,
        yaml_config_base=Path(__file__)
    )Usage example:First run:python example_program.py -t 4 --use_library=libabc --ignore=E123,E321 --add_src=/homes/user/documents/ --quality=0.65 --no_audio --quiet(save config asusual)Subsequent runs:python example_program.py --use_config=usual --quality=0.55In this example, if the user wants to change an argument from run to run, the difference is immediately apparent since the "noise" is abstracted away in ausualconfiguration.
Package: configurable-http-proxy
configurable-http-proxyThis is a pure python implementation of theconfigurable-http-proxywritten in nodejs. It is meant to be a drop in replacement.InstallPrerequisite: Python 3.6+pipinstallconfigurable-http-proxyFeature supportThe following items are supported:Proxying for Websocket and HTTP requestsConfiguring the proxy using API requestsAuth token for API requestsError management using error_path and error_targetPrepend path or include prefixTimeoutsX-Forward related headersCustom HeadersCustomizable storage backendsPID file writingLoggingConfigurable storage backendThe following options are additional (not available in nodejs CHP currently):Ready to use DBMS storage backendThe following options are not supported (yet):SSL for proxy, client, API is not available (--ssl-*,--api-ssl-*,--client-ssl-*,--insecure)Redirecting:--redirect-portand--redirect-toChange Origin:--change-originRewrites in Location header:--protocol-rewriteand--auto-rewriteMetrics server:--metrics-portand--metrics-ipDatabase-backed storage backendUsing a SQL DBMS instead of the default in-memory store enables chp to be replicated
in a High Availability scenario.To use a SQL DBMS as the storage backend:Install DBMS support$pipinstallconfigurable-http-proxy[sqla]Set the CHP_DATABASE_URL env var to any db URL supported by SQLAlchemy. The default issqlite:///chp.sqlite.$exportCHP_DATABASE_URL="sqlite:///chp.sqlite"$configurable-http-proxy--storage-backendconfigurable_http_proxy.dbstore.DatabaseStoreOptionally you may set the table name by setting the CHP_DATABASE_TABLE. The default is 'chp_routes'$exportCHP_DATABASE_TABLE="chp_routes"
Package: configurable-shell
Configurable-ShellBuild a remote shell with configuration of yours (It doesnt give you actual shell but makes you feel like you have one)WorkingShell is built by stdin and stdout. Take stdin and give stdout. This module is useful during RCE.fromconfigurable-shellimportLinuxShellTo develop a shell definestdoutyourself. Thestdinis predefined as keyboard input (you can override that too)defsample_stdout(self,cmd):""" Write RCE Code to send command and return cmd output """returnoutputdefsample_stdin(self):""" Must return user_input """user_input=input("$> ")returnuser_inputLinuxShell.stdin=sample_stdin#must return user inputLinuxShell.stdout=sample_stdout#pwd should return /home/usernameBoom, You got a shellrootshell=LinuxShell('root')rootshell.interact()root@machine:/root#
Package: configuration-master
config-masterconfig-masteris a Python package designed for easy configuration management. It offers flexibility in storing and retrieving configuration data through global variables or environment variables.InstallationYou can installconfig-mastervia pip:pipinstallconfig-masterBasic Usagefromconfig_masterimportConfigMaster# Set a configuration valueConfigMaster.set_config("my_key","my_value")# Get a configuration valuevalue=ConfigMaster.get_config_value("my_key")print(value)Configuration MethodsYou can manage your configuration in one of two ways based on your coding style.Using Environment VariablesBy default, configuration values are stored as environment variables. This is recommended for security and encapsulation.ConfigMaster.set_config("my_key","my_value")Using Global VariablesIf you prefer to manage configuration values using global variables, set theuse_globalparameter to True. Note that with global variables, you can only access them using theConfigMaster.get_config_value()method.ConfigMaster.use_global=TrueConfigMaster.set_config("my_key","my_value")Working with JSON FilesYou can load configuration data from a JSON file:# Set configuration from a JSON fileConfigMaster.set_config_from_json_file("config.json")Working with DictionariesSet multiple configuration values using a dictionary. The keys in the dictionary should match the variable names you intend to set.data={"my_key":"my_value","another_key":"another_value"}ConfigMaster.set_config_from_dict(data)# Get a configuration valuevalue=ConfigMaster.get_config_value("my_key")print(value)config-mastermakes configuration management in Python a breeze, allowing you to choose the approach that best fits your project's needs.
Package: configuration-registry
Python Configuration Registry API=================================Purpose-------The objective of this module is to provide a common API to the configurationregisty used to store service instance properties using KeyValue storeslike consul, etcd or zookeeper.Usage examples--------------Basic usage examples::import registryregistry.connect()# Register a new service template using default template type: json+jinja2registry.register(name, version, description, template, options)# using template type: yaml+jinja2cluster = registry.register(name, version, description, template,options, templatetype='yaml+jinja2')# Instantiate a new cluster from a given service templatecluster = registry.instantiate(user, servicename, version, options)# Retrieve a previously instantiated cluster instancecluster = registry.get_cluster(user='jlopez', framework='cdh', flavour='5.7.0', id='1')# Alternatively you can retrieve it by DNcluster = registry.get_cluster(dn='jlopez/cdh/5.7.0/1')# Retrieve a previously registered Product objectproduct = registry.get_product(name, version)template = templateProxy.templateoptions = templateProxy.optionsdescription = templateProxy.descriptionnodes = cluster.nodesservices = cluster.servicesfor node in nodes:print node.statusnodes[0].status = 'running'# Deregister a service template (removes it)registry.deregister(service_name, service_version)# Deinstantiate a cluster instance (removes it)registry.deinstantiate(user, framework, flavour)Notes-----Copy recursively an instance into a new one:```slave0 = kv.recurse('instances/jlopez/cdh/5.7.0/1/nodes/slave0')slave1 = {k.replace('slave0', 'slave1'): slave0[k] for k in slave0.keys()}for k in slave1.keys():kv.set(k, slave1[k])```Sample service Template:------------------------- service-template.json- service-template.yamlErrors------FIXME: yaml+jinja2 fails the test 40% of the times:```.E..........======================================================================ERROR: test_add_instance_yamltemplate (__main__.RegistryTemplatesTestCase)----------------------------------------------------------------------Traceback (most recent call last):File "tests_integration.py", line 122, in test_add_instance_yamltemplateself.assertEqual(cluster.nodes[0].networks[0].networkname, 'admin')File "/home/jlopez/home_common/Reference/src/python/bigdata/configuration-registry/registry.py", line 372, in networkssubtree = _kv.recurse(self._endpoint + '/networks')File "/home/jlopez/home_common/Reference/src/python/bigdata/configuration-registry/venv/local/lib/python2.7/site-packages/kvstore.py", line 68, in recurseraise KeyDoesNotExist("Key " + k + " does not exist")KeyDoesNotExist: Key instances/testuser/__unittests__/0.1.0/44/nodes/master0/networks does not exist----------------------------------------------------------------------Ran 12 tests in 14.156sFAILED (errors=1)```
Package: configurator
This is a Python library for building a configuration store
from one or more layered configuration sources.
These are most commonly files, with YAML, TOML and JSON support included
and other formats easily added.
The sources don’t have to be files, and support is included for both environment
variables and command line options.In addition to an easy to use interface, configuration information is also made available
as nested, simple python data types so that you can validate the schema of your configuration
using the tool of your choice.QuickstartTo install the library, go for:pipinstallconfigurator[yaml,toml]Here’s how you would handle a layered set of defaults, system-wide config
and then optional per-user config:fromconfiguratorimportConfigdefaults=Config({'cache':{'location':'/tmp/my_app','max_files':100,},'banner':'default banner','threads':1,})system=Config.from_path('/etc/my_app/config.yaml')user=Config.from_path('~/.my_app.yaml',optional=True)config=defaults+system+userNow, if we wanted configuration from the environment and command line
arguments to override those provided in configuration files, we could do so
as follows:importosfromargparseimportArgumentParserfromconfiguratorimportconvert,target,requiredconfig.merge(os.environ,{convert('MYAPP_THREADS',int):'threads',required('MYAPP_CACHE_DIRECTORY'):'cache.location',})parser=ArgumentParser()parser.add_argument('--threads',type=int)parser.add_argument('--max-files',type=int)args=parser.parse_args()config.merge(args,{'threads':'threads','max_files':'cache.max_files',})To check the configuration we’ve accumulated is sensible we can use a data validation library
such asVoluptuous:fromos.pathimportexistsfromvoluptuousimportSchema,All,Required,PathExistsschema=Schema({'cache':{'location':All(str,PathExists()),'max_files':int},'banner':Required(str),'threads':Required(int),})schema(config.data)So, with all of the above, we could use the following sources of configuration:>>> import os, sys
>>> print(open('/etc/my_app/config.yaml').read())
cache:
  location: /var/my_app/
<BLANKLINE>
>>> os.environ['MYAPP_THREADS']
'2'
>>> os.environ['MYAPP_CACHE_DIRECTORY']
'/var/logs/myapp/'
>>> sys.argv
['myapp.py', '--threads', '3', '--max-files', '200']With the above sources of configuration, we’d end up with a configuration store that we can use as
follows:>>> config.cache.location
'/var/logs/myapp/'
>>> config.cache.max_files
200
>>> config.banner
'default banner'
>>> config.threads
3
Package: configurave
ConfiguraveConfigurave is a one-stop configuration engine that permits writing your configuration as a simple decorated class, and then loading the values from a series of configuration files or providers.Values loaded from later sources override values provided by earlier sources. Types of the loaded configuration values are checked.While not currently functional, there are plans and code to write out a default configuration generated directly from the configurave decorated class with .defaults_toml().This project has undergoneMINIMALtesting and work. It is likely very buggy at this time. Stay tuned for more!Example usage:fromtypingimportListfromconfiguraveimportmake_config,ConfigEntryasce@make_config()classMyConfig:site_root:str=ce(comment="The root url the site should be mounted on")template_root:str=ce(comment="Directory under which templates should be found")allowed_hosts:List[str]=ce(comment="A comma separated list of hosts that we are permitted to server content to",validator=lambdaconfig,value:len(value)>0,)token:str=ce(comment="The discord auth token",secret=True)config=MyConfig(sources=["tests/test-config/readme.toml"])print(config.site_root,config.template_root,config.allowed_hosts[0],sep="\n")This will load from a file that looks like:template_root="./templates"allowed_hosts="mydomain.com,example.example,localhost:8080"[site]root="/"orTEMPLATE_ROOT="./templates"
ALLOWED_HOSTS="mydomain.com,example.example,localhost:8080"
SITE_ROOT="/"and print:/
./templates
["mydomain.com", "example.example", "localhost:8080"]
Package: configure-django
configure-djangoA package for configuring Django in non-traditional environments.Free software: Apache Software License 2.0FeaturesTODOFeaturesUsageCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.3.6 (2018-10-21)Bust weird cache issue with version0.3.5 (2018-10-21)Remove version.py because of package woes0.3.4 (2018-10-21)Remove version.py because of package woes0.3.3 (2018-10-21)Fix django apps default0.3.2 (2018-10-21)Removedjango.setup()to fix tox failures0.3.1 (2018-10-20)Use Cast properly0.3.0 (2018-10-20)Flatten architectureAdd some tests0.2.4 (2018-10-20)Fix variable name typo0.2.3 (2018-10-20)Simplify BASE_DIR and sqlite3 paths0.2.2 (2018-10-20)Add missing BASEDIR variable0.2.1 (2018-10-20)Switch to using python-decouple for env var management0.2.0 (2018-10-20)Switch to using python-decouple for env var management0.1.7 (2018-10-12)Variable naming correction0.1.6 (2018-10-12)Address settings namespace issue0.1.5 (2018-10-12)Correction of arguments0.1.4 (2018-10-12)Add legacyrun_migrationargument0.1.3 (2018-10-12)Corrected import path0.1.2 (2018-10-12)First pass at working functionality0.1.1 (2018-10-12)Second release on PyPI.0.1.0 (2018-10-12)First release on PyPI.