Saravanan666/pypi-org huggingface dataset:
Package: cfgcaddy
Config CaddyConfig Caddy is a tool used for managing your configuration files.One way to version your configuration files is to keep them in agitrepository. This has several drawbacks, among them, git requires the files it manages to be located within a single file tree. You can overcome this limitation by using symbolic links. The links point from locations in your filesystem such as/etc/someconfig.confto files within the git repository like$HOME/tstapler/dotfiles/someconfig.conf.Config Caddy creates symlinks to your dotfiles directory, so you don't have to. Each time you add a new file to your dotfiles repo, runcfgcaddy linkto generate symlinks. By defaultcfgcaddywill create links from files in the dotfiles repo to their relative location in your home directory.cfgcaddywill also read from a configuration file. This allows the user to ignore certain files and create more complex linking relationships.UsageInstall using pippipinstallcfgcaddyGenerate or import a configuration file for cfgcaddycfgcaddyinit--help

Usage:cfgcaddyinit[OPTIONS]SRC_DIRECTORYDEST_DIRECTORYCreateorimportacaddyconfig

Options:-c,--configPATHThepathtoyourcfgcaddy.yml--helpShowthismessageandexit.

cfgcaddyinit$HOME/dotfiles$HOMERun the linkercfgcaddylinkConfiguration File Formatcfgcaddyuses a configuration file to store important information about your configuration. The.cfgcaddy.ymlconsists of several parts. Apreferencessection which contains information like where your dotfiles are located and where you want them linked to, Alinkssection where you can specify more complex symlinks, and anignoresection where you specify files you do not want managed bycfgcaddy.Config files for cfgcaddy are stored in your home directory by default.$HOME/.cfgcaddy.ymlA sample.cfgcaddy.ymlwhich leverages most features can be foundhereDevelopmentClone the repositorygitclonehttps://github.com/tstapler/cfgcaddyInstall cfgcaddy as an editable packagepipinstall--editable./cfgcaddy??????ProfitMotivation/Prior ArtI'm an automation fiend, this tool grew out of a personal need to manage my configurations across multiple machines and operating systems. It fits my needs and I'll add features as I need them (Like Windows support). PRs are always welcome :)Here are several projects that I've drawn inspiration from:https://github.com/charlesthomas/linkerhttps://github.com/thoughtbot/rcm
Package: cfg-diag
A common configuration-storage class with a .diag() methodDescriptionThis module provides four classes that may be used as base classes for
storing program runtime configuration with averboseboolean field.
The classes provide a.diag(func)method that will check the object'sverbosefield and, if it is set to a true value, invoke the specified
function and output the message that it returns. If the message is not
expensive to format (e.g. it does not include stringifying elaborate
data structures), the.diag_(msg)method may be used instead.TheConfigUnfrozenandConfigUnfrozenStdOutclasses are
normal dataclasses, while theConfigandConfigStdOutones
are frozen.TheConfigandConfigUnfrozenclasses will output any
diagnostic messages to the standard error stream, while
theConfigStdOutandConfigUnfrozenStdOutones will output
the diagnostic messages to the standard output stream.For compatibility withcfg-diagversions 0.1.x and 0.2.x, there is
also a parallelConfigDiag*class hierarchy; the classes there are
organized in exactly the same way as those in theConfig*hierarchy,
but they only provide a single.diag(msg)method that accepts
a fixed, already-built, string instead of a callback function.
These classes are deprecated and will most probably be removed in
a future version of thecfg-diaglibrary.ExampleSubclass the frozenConfigclass, add a program-specific field:@dataclasses.dataclass(frozen=True)
class Config(cfg_diag.Config):
    """Runtime configuration for the fribble program."""
    path: pathlib.PathInitialize this class from an argument parser object:return Config(path=args.path, verbose=args.verbose)Output a diagnostic message if requested:cfg.diag_("This will either appear or it will not")
cfg.diag(lambda: f"Here's the thing: {thing!r}")ContactThis module isdeveloped in a GitHub repository.
Contactthe StorPool support teamfor information.
Package: cfgdir
cfgdirRead envdir style configuration directory and output as JSON or YAMLhttps://github.com/rstms/cfgdirInspired bydjb'sexcellentenvdir, a component ofdaemontoolsLeverage the powerful simplicity of the filesystem as your configuration database, and the
freedom to fluidly manipulate configuration data from your shell.Unlike envdir's mechanism of running another program with the configuration in environment variables,
this program outputs a stream in JSON or YAML format.  This output can be captured in a file
or piped into stdin of another program.Interfacecfgdir [OPTIONS] d [INPUT] [OUTPUT]optionally reads a JSON or YAML object from INPUT (use - to read stdin) , then reads the directory named d, outputting a JSON or YAML object modified according to files in d.The format of d is as follows: (adapted from envdir's documentation)If d contains a file named s whose first line is t, cfgdir's output will contain an element named s with string value t. The name s must not contain =. Spaces and tabs at the end of t are removed. Nulls in t are changed to newlines.If the file s is completely empty (0 bytes long) cfgdir will remove the element named s if it exists.Arguments:ArgumentdefaultDescriptionDIRECTORYoptional/dev/nullDirectory containing configuration data filesINPUToptional/dev/nullInput filename or - for stdinOUPUToptionalstdoutOutput Filename or - for stdoutOptions:-c, --compact  minimize output
  -s, --sort     sort output
  -j, --json     JSON format
  -y, --yaml     YAML format
  -r, --recurse  process subdirectories
  -o, --overlay  overlay JSON/YAML formatted string onto output
  --help         Show this message and exit.
Package: cfgenvy
OverviewKeep secrets out of env variables in production by using env files. Merge env files into configuration dynamically. Keep env file and env variable handling out of the application by making application dependent only on the configuration file. Prefer deserilization from yaml over configuration of partially initialized objects.An argument parser that accepts:A required yaml file for configuration/deserialization.An optional env file for secrets.Features:MIT licenseInterpolate environment variables directly into yaml configuration.Optional replacement of environment variables with an environment variable file.Use C Yaml safe load/dump or yaml safe load/dump.Pass in env to parser with os.environ as a default.Pass in argv to parser with sys.argv[1:] as a default.Yaml type registration functions.Relative configargparse, python-dotenv, envyaml, and yamlenv:Dependency injection through depth-first deserialization of yaml is better than two-pass, breadth-first initialization followed by a configuration.Contract for env variables is between configuration file and env xor the env file, the app no longer cares much about env or secrets as it uses the interpolated configuration file.No ${MY_VAR:my-default} --unexpected env var syntax for default values, an expensive pattern match, and allows typos of MY_VAR to pass silently--.No "N/A" or null default when environment variable does not exist --allows configuration errors to pass silently to become runtime errors--.Env file is optional, but when provided it does not merge with existing environment variables --better tracability in production deployment--.Yaml type registration retains the registered yaml tag in a closure.Env yaml type registration retains the registered env variable set in a closure.Installpip install "."Develop, Lint & TestSetup virtual environment:python3.10 -m venv .venvOr setup homebrew environment:brew install python@3.10
/opt/homebrew/Cellar/python@3.10/.../Frameworks/Python.framework/Versions/Current/python@3.10 -m venv .venvOnce virtual environment is setup:. .venv/bin/activate
pip install -U pip setuptools wheel
pip install -e ".[dev]"
pre-commit installSession:. .venv/bin/activate
...
pytest
...
pre-coommit run --all-files
...
git commit -m 'Message'
...
deactivateDocker, Lint & Testdocker compose up test
docker compose up pre-commit
docker compose up build-wheel && docker compose up install-wheel
...
docker compose down
Package: cfgeom
CFGeomA Python Reference Implementation for Representing Geometries in NetCDF Following the CF ConventionsThis project demonstrates how points, lines, polygons, and their multipart equivalents can be represented in NetCDF-CF. The project includes a Python reference implementation for reading and writing geometries in a netCDF file.For more on this project, see thedocumentation, or get started with thetutorial.To view the geometries specification including examples, seeChapter 7 of the
CF
Conventions.You may also be interested in theR reference implementation.Use CasesEncode watershed model time series and polygons in a single file to archive model output and geometry.Encode a streamflow value for each river line in the conterminous U.S. at a given point in time.ContributorsTim WhiteakerBen KoziolDavid Blodgett
Package: cfgman
cfgmanA configuration manager for Python application.FeaturesConfigure from files (yaml, toml, json).Environment variables.Custom variables (e.g. command line arguments).Type annotations.Usagefromcfgmanimport(configclass,load_config,get_default_config,env_loader,file_loader,MISSING,)fromapischema.metadataimportconversiondeffrom_isoformat(s:str)->datetime:returndatetime.fromisoformat(s)defto_isoformat(d:datetime)->str:returnd.isoformat()@configclassclassWebServerConfig:host:str="localhost"port:int=80timeout:int=30@configclassclassConfig:web:WebServerConfig# nest configsstart:datetime=field(default_factory=lambda:datetime.now(datetime.utc),metadata=conversion(from_isoformat,to_isoformat),)argparser=ArgumentParser(Config)argparser.add_argument("-c","--config",dest="config_files",metavar="FILENAME",action="append",default=["~/.config/myapp/config.yaml"],)argparser.add_argument("--host",metavar="HOSTNAME",default=MISSING)argparser.add_argument("-p","--port",metavar="PORT",type=int,default=MISSING)argparser.add_argument("-s","--start",metavar="ISODATETIME",default=MISSING)args=argparser.parse_args()config=load_config(Config,file_loader(files=args.config_files,supported_formats=(FileFormat.YAML,FileFormat.TOML)),env_loader(prefix="APP_",mapping={"HOST":"web.host","PORT":"web.port"},),{"web":{"host":args.host,"port":args.port,},"start":args.start,},)time.sleep((datetime.now(datetime.utc)-config.start).total_seconds)asyncdefrun_server():# you can retrieve your module specific config without depending on the rest of the configurationwebconfig=get_default_config(WebServerConfig)server=start_server(webconfig.host,webconfig.port)awaitserver.serve_forever()asyncdefrequest_handler(request):experiment=select_experiment()withreplace_default(WebServerConfig,changes=experiment.changes):webconfig=get_default_config(WebServerConfig)response=awaitprepare_response(headers={"X-Experiment-Name":webconfig.experiment})
Package: cfgmdl
# The cfgmdl package## Set-upFrom bash using pip` $ pip install cfgmdl `From source` git clonehttps://github.com/KIPAC/cfgmdl.gitcd cfgmdl python setup.py install (or python setup.py develop) `## Testing` $ pip install pytest $ pytest cfgmdl `## Demo## People
* [Eric Charles](https://github.com/KIPAC/cfgmdl/issues/new?body=@eacharles) (KIPAC/SLAC)## License, etc.This is open source software, available under the BSD license. If you are interested in this project, please do drop us a line via the hyperlinked contact names above, or by [writing us an issue](https://github.com/KIPAC/cfgmdl/issues/new).
Package: cfgovbuild
# cfgov-setupThis package provides a central home for our logic for building front-end assets as part of the Python build process (for example, when generating a [wheel](https://pypi.python.org/pypi/wheel)), which has until now simply been duplicated everywhere. Open source examples:https://github.com/cfpb/complaint/blob/v1.2.3/setup.py#L20https://github.com/cfpb/retirement/blob/0.5.0/setup.py#L20We’ve also added a crucial check that allows front-end build failures to propogate up to Python. They previously ignored the result ofsubprocess.calland happily continued even if the frontend build failed.## DependenciesPython 2.7## InstallationEdit your package’s ‘setup.py’ to require this module at build-time (setup_requires=[‘cfgov-setup’]), and set the ‘do_frontend_build’ keyword in the setup arguments. [This pull request](https://github.com/cfpb/complaint/pull/10) demonstrates the kind of changes to make.## Open source licensing info
1. [TERMS](TERMS.md)
2. [LICENSE](LICENSE)
3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)
Package: cfgov-setup
cfgov-setupThis package provides a central home for our logic for building front-end assets as part of the Python build process (for example, when generating awheel), which has until now simply been duplicated everywhere. Open source examples:https://github.com/cfpb/complaint/blob/v1.2.3/setup.py#L20https://github.com/cfpb/retirement/blob/0.5.0/setup.py#L20We've also added a crucial check that allows front-end build failures to propogate up to Python. They previously ignored the result ofsubprocess.calland happily continued even if the frontend build failed.DependenciesPython 2.7InstallationEdit your package's 'setup.py' to require this module at build-time (setup_requires=['cfgov-setup']), and set the 'do_frontend_build' keyword in the setup arguments.This pull requestdemonstrates the kind of changes to make.TestingTo lint and run the unit tests you will need to:Install Tox in a virtualenv or your local Python environment:pip install toxRun tox:toxOpen source licensing infoTERMSLICENSECFPB Source Code Policy
Package: cfg-param-wrapper
cfg_param_wrapper 1.0.1a config wrapper I made. It's made to wrap simple functions, and intercept configurations in tandem with a CfgDict object.Check theGithubREADME! It's likely more up to date.Installation# from pypi:pipinstallcfg-param-wrapper# from github:gitclone"https://github.com/zeptofine/cfg-param-wrapper"cdcfg-param-wrapper
pipinstall-e.@wrap_configThewrap_configdecorator is meant to wrap a function, take their parameters and create a config file from it. Once a function is wrapped using@wrap_config, either the cfg can change and the function's default parameters are updated according to the argument names and such.This is very useful inTyperandClickcommands (wrap it before declaring a command).CfgDictThis is a dictionary subclass that takes a filename, and saves all the changes to the file usingjsonortoml.It allows custom encoders and decoders for the file formats it supports.Examplefromcfg_param_wrapperimportwrap_config,CfgDictcfg=CfgDict("test.json")@wrap_config(cfg)deftest_function(s:str,is_real:bool=True):# I'd advise only wrapping functions with default parametersreturnf"{s}is{'real'ifis_realelse'fake'}"if__name__=="__main__":print(test_function("We"))cfg['s']="us"print(test_function())# Linters hate him!
Package: cfgparse
cfgparse is a more convenient, flexible, and powerful module for parsing
configuration files than the standard library ConfigParser module. cfgparse uses
a more declarative style modelled after the popular optparse standard library
module.cfgparse can optionally cooperate with the optparse module to provide
coordination between command line and configuration file options. In addition,
the cooperation can be used to allow the user to control features of the parser
from the command line.
Package: cfgparse.py
cfgparse is a more convenient, flexible, and powerful module for parsing
configuration files than the standard library ConfigParser module. cfgparse uses
a more declarative style modelled after the popular optparse standard library
module.cfgparse can optionally cooperate with the optparse module to provide
coordination between command line and configuration file options. In addition,
the cooperation can be used to allow the user to control features of the parser
from the command line.
Package: cfgparser
PythonConfigParsertruly fully-typed python configs - not more, not less.Usagedefine your config structure in a dataclass likefromdataclassesimportdataclassfromtypingimportList@dataclassclassDummyConfigElement:name:strlist:List[int]another_list:List[float]initialize the config parser with the path to the module with the config definitions.parser=ConfigParser(datastructure_module_name="mysrc.datastructures.configs")parse a config from file or dictfrom filemy_config=parser.parse_from_file("myconfig.json")from dictionarymy_config_dict={"type_name":"mysrc.datastructures.configs.a","value":1}my_config=parser.parse(my_config_dict)Type definitionThere are two ways to define the configs type:specified in the config itselfstore fully qualified name of the config class under the key "type_name" in the confige.g in the code example abovespecified when parsing the configif the config has no key "typed_config" set, the type can be specified when parsing the configfrommysrc.datastructures.configsimportamy_config_dict={"some_key":"some_value"}# config has no key "type_name" but type is specified when parsingmy_config=ConfigParser().parse_typed(my_config_dict,a)Optional & Union fieldsBy default every field can be explicitly set to None. If you don't what this behavior you can set the flag "allow_none" to False.fromcfgparserimportsettingssettings.allow_none=FalseUnion fieldsWhenever a Union type is encountered the parser tries to parse the config with the first type in the union. If this fails it tries the next type and so on. If all types fail the parser raises an exception. For instance, in the example below the parser tries to parse the config as a Bird. If this fails it tries to parse it as a Cat. If this fails too the parser raises an exception.fromdataclassesimportdataclassfromtypingimportUnion@dataclassclassBird:name:strwingspan:float@dataclassclassCat:name:strpaws:int@dataclassclassAnimalOwnership:owner:stranimal:Union[Bird,Cat]Features✅ fully typed json and yaml configs✅ nested configs✅ complex union and optional types✅ dict object into typed dataclass✅ support for enums (value given as string or int)✅ support for typed tuples (e.g. Tuple[int, str, float])✅ override type_name if type is specified when parsingInstallationpipinstallcfgparserFeature Roadmap⬜ specify config from cli⬜ post hock⬜ distributed configs⬜ typed dicts (e.g. Dict[str, MyType])⬜ typed functions (e.g. torch.functional.relu)⬜ save config to file (json, yaml) with and without typeinfo
Package: cfgrep
cfgrepcfgrep(c4grep, ccccgrep) is Cisco-like Config Context-aware Check grepInstallingpip from PyPIpip install cfgrep, or pip from githubpip install wheel git+https://github.com/tk-hayashi/cfgrep, or running setup.pygit clone https://github.com/tk-hayashi/cfgrep
cd cfgrep
python setup.py installUsageRegular expressions can be used as PATTERN similar to grep.>cfgrep-h
Overview:cfgrep(c4grep,ccccgrep)isCiscoConfigContext-awareCheckgrep

Usage:cfgrep<PATTERN><FILE>[-i|--interface][-b|--bgp][-d|--description]cfgrep-h|--help

Options:-i,--interfaceinterfacemode-b,--bgpbgpmode-d,--descriptiontospecifyPATTERNbydescription-h,--helpdisplayhelpoptionsSeeexamples-xr.mdandexamples-ios.mdfor details of optionsoptiondescription-iInterface mode. To display a config related to ipv4 and ipv6 address of the interfaces.-bBGP mode. To display a config related to route-policy(route-map) and bgp-group of the neighbors.-dDescription mode. To use a parent indent of description as PATTERN.AuthorsToshiki Hayashi-Initial workLicenseThis project is licensed under the Apache License - see theLICENSEfile for details
Package: cfgs
Simple, correct handling of config, data and cache filesLike everyone else, I wrote a lot of programs which saved config files
as dotfiles in the user’s home directory like~/.my-program-nameand now
everyone’s home directory has dozens of these.Then I readthis article.Great was my embarrasment to discover that there was aneat little specificationfor data, config and cache directories in Linux that prevents this problem, and
that I was not using it:So I implemented a small and simple Python API as a single file,cfgs.py.It works on all versions of Python from 2.7 to 3.7, has complete test coverage,
and all the functionality is reachable from a single class,cfgs.AppHow it works in one sentenceCreate acfgs.Appfor your application, project, or script which
handles finding, reading and writing your data and config files, and
managing your cache directories.How to installYou can either use pip:pipinstallcfgsOr if you don’t like dependencies (and who does?), you can drop the source filecgfs.pyright into your project.Usage examplesimportcfgsapp=cfgs.App('my-project')print(app.xdg.XDG_CACHE_HOME)#   /home/tom/.cache/my-projectapp.xdg.XDG_CONFIG_DIRS#   /etc/xdgwithapp.config.open()asf:f.update(name='oliver',species='dog')f['description']={'size':'S','fur':'brown'}print(f.filename)#    /home/tom/.cache/my-project/my-project.json# Later:withapp.config.open()asf:print(f['name'])#    oliverprint(f.as_dict())#     {'name': 'oliver', 'species': 'dog',#      'description': {'size': 'S', 'fur': 'brown'}Cacheimportcfgscache_size=0x10000000app=cfgs.App('my-project')directory=app.cache.directory(cache_size=cache_size)# TODO: rewrite cache or add features.UsingcfgsIn legacy codeIf you already have code to handle your config, data and cache files, then you
can just usecgfsto get theXDG variablesfromcfgsimportXDGxdg=XDG()config_dir=xdg.XDG_CONFIG_HOME# Your code here - eg:my_config_file=os.path.join(config_dir,'my-file.json')withopen(my_config_file)asf:legacy_write_my_file(f)cfgsautomatically handles data and config files, and independently, cache
directories.API DocumentationAPI documentation ishere.
Package: cfgsaver
cfgsaverPython library to save and fetch configuration data in a standard/conventional path and format.InstallationpipinstallcfgsaverUsageImport thecfgsavermodule to save/read configuration values in your source files:fromcfgsaverimportcfgsaverdefsave_config():# saves configuration data to ~/.config/<your_package>/cfg.json# unless cfgpath parameter is overridden:config={'name':'Prahlad','language':'Python','framework':'Flask'}cfgsaver.save('<your_package>',config)defget_config():# gets configuration data from ~/.config/<your_package>/cfg.json# unless cfgpath parameter is overridden:config=cfgsaver.get("<your_package>")#returns None if config file doesn't existIn case you want to ship some default configuration data packaged with your app, then read the below instructions carefully:Ensure to include the path to your cfg.json inMANIFEST.inas follows (you'll have to copy this file from ~/.config/<your_package> to your source directory for packaging purpose):include<your_package>/cfg.jsonOverride the PostInstall class in your setup.py like this in order to save your config file to the user's machine after installation:fromsetuptoolsimportsetup,find_packagesfromsetuptools.command.installimportinstallimportshutilclassPostInstallCommand(install):"""Post-installation for installation mode."""defrun(self):install.run(self)fpath=os.path.join(self.install_lib,your_package)fpath=os.path.join(fpath,"cfg.json")tpath=os.path.join(os.path.expanduser("~"),".config/<your_package>/cfg.json")ifnotos.path.isdir(tpath):os.makedirs(tpath)shutil.move(fpath,tpath)s=setup(name="your_package",packages=find_packages(),......cmdclass={'install':PostInstallCommand,},)AttributionIcons made bySmashiconsfromwww.flaticon.comis licensed byCC 3.0 BY