Saravanan666/pypi-org huggingface dataset:
Package: yaml-settings-pydantic
What?A simple tool for loadingYAMLandJSONconfiguration/settings usingpydantic2.There is also a version forpydantic1, seerelease/v1. Major
versions of this package will match the major version of the respectivepydanticrelease.Why?This project can be helpful for projects that have large configuration files,
nested configuration files, or for those of us who don’t like writing large.envfiles. It is also worth noting that due to the backwards compatability betweenYAMLandJSONthat this will also parseJSONconfiguration.This can also be helpful when writing out application settings in kubernetes
/helm, where most configuration is written asYAML. In such a case we may
want to validate/store our settings asYAMLas writingJSONandJSONstrings can be compersome due to syntax error in larger documents.InstallationInstall usingpip:pipinstallyaml-settings-pydanticExamplesAdditional informationFirst, it is worth reading thepydantic_settingsdocs about additional sources:https://docs.pydantic.dev/latest/usage/pydantic_settings/Additionally see the example in./tests/examples/__init__.py. It is gaurenteed to
work as its contents are tested. It contains information on how to write nested
configurations.ToolsThere are three classes worth knowing about:YamlSettingsConfigDict–pydantic_settings.SetttingsConfigDictextended to include the fields used byCreateYamlSettings.CreateYamlSettings– The pydanticPydanticBaseSettingsSourcethat
will analyze your class for the following class variables:Files to be used – under__env_yaml_files__ormodel_config.yaml_files.The reload settings – under__env_yaml_reload__ormodel_config.yaml_reload.CreateYamlSettingsdoes not have to be used at all, but can be helpful if
you don’t want to useBaseYamlSettingsfor any reason.BaseYamlSettings– Use this directly as done in the example below. This
is ‘the easy way’.Minimal ExamplesThe shortest possible example is as follows:fromyaml_settings_pydanticimportBaseYamlSettingsclassMySettings(BaseYamlSettings):__env_yaml_files__="settings.yaml"setttingOne:strsettingTwo:str......Note that the above example can also be written likefromyaml_settings_pydanticimportBaseYamlSettings,YamlSettingsConfigDictclassMySettings(BaseYamlSettings):model_config=YamlSettingsConfigDict(yaml_files="settings.yaml")setttingOne:strsettingTwo:str......which is more like pydantic v2. The ‘dunder’ specifications will take priority
over their equivalentmodel_configspecifications. These map as follows:+-----------------------+------------------+
| dunder                | model_config     |
+-----------------------+------------------+
| __env_yaml_files__    | yaml_files       |
| __env_yaml_reload__   | yaml_reload      |
+-----------------------+------------------+
Package: yaml-source-map
YamlSourceMapCalculate JSON Pointers to each value within a YAML document along with the
line, column and character position for the start and end of that value.For example:python-mpipinstallyaml_source_mapfromyaml_source_mapimportcalculateprint(calculate('foo: bar'))The above prints:{"":Entry(value_start=Location(line=0,column=0,position=0),value_end=Location(line=0,column=8,position=8),key_start=None,key_end=None,),"/foo":Entry(value_start=Location(line=0,column=5,position=5),value_end=Location(line=0,column=8,position=8),key_start=Location(line=0,column=0,position=0),key_end=Location(line=0,column=3,position=3),),}The following features have been implemented:support for primitive types (strings,numbers,booleansandnull),support for structural types (sequenceandmapping).
Package: yamlstratus
YAML Stratus provides extensions to YAML that make it amenable to use with AWS
CloudFormation, as well as a python binding,
and a tool for converting to the standard JSON used by CloudFormation.Standard YAML capabilities not part of JSON:commentsback referencesblock literalsNote also that JSON is YAML, so familiar JSON data can be embedded within YAML.Extension to YAML provided by YAML Stratus:!include - YAML files can include other YAML files!param - YAML files can include parameters!merge - Allows the merging of data from two source data hierarchies
Package: yaml-stripper
YamlStripperYamlStripper is a Python command-line tool for removing specified fields from YAML files.InstallationTo use YamlStripper, you need to have Python 3 installed on your computer. You can download and install Python 3 from the official Python website:https://www.python.org/downloads/After installing Python 3, you can install YamlStripper using pip, the Python package manager:pip install yaml-stripperUsageTo use YamlStripper, open a command prompt or terminal window and type the following command:yaml-stripper input_file output_file -f field1 field2 ...where:input_file- The input YAML file to remove fields from.output_file- The output YAML file without the specified fields.-f field1 field2 ...- The fields to remove from the input YAML file.For example, if you have a YAML file calledexample.yamlwith the following contents:name:Johnage:30email:john@example.comphone:123-456-7890and you want to remove theemailandphonefields from this YAML file and save the result in a new file calledstripped.yaml, you can use the following command:yaml-stripper example.yaml stripped.yaml -f email phoneAfter running the command, a new file calledstripped.yamlwill be created with the following contents:name:Johnage:30ExamplesHere are some more examples of how to use YamlStripper:Example 1Suppose you have a YAML file calleddata.yamlwith the following contents:name:Aliceage:25email:alice@example.comphone:987-654-3210address:street:123 Main Stcity:Anytownstate:CAzip:12345You want to remove theemailandphonefields from this YAML file and save the result in a new file calledstripped.yaml. Here's how you can use YamlStripper to achieve this:yaml-stripper data.yaml stripped.yaml -f email phoneAfter running the command, a new file calledstripped.yamlwill be created with the following contents:name:Aliceage:25address:street:123 Main Stcity:Anytownstate:CAzip:12345Example 2Suppose you have a YAML file calledconfig.yamlwith the following contents:debug:trueport:8000database:host:localhostport:5432name:mydbuser:myuserpassword:mypassYou want to remove thedebugfield from this YAML file and save the result in a new file calledstripped.yaml. Here's how you can use YamlStripper to achieve this:yaml-stripper config.yaml stripped.yaml -f debugAfter running the command, a new file calledstripped.yamlwill be created with the following contents:port:8000database:host:localhostport:5432name:mydbuser:myuser
Package: yaml-structureddata
AboutYAML-StructuredData is a definition of a YAML data store with type
declarations. It is also a set of python libraries and scripts that are used to
manage StructuredData.AuthorGoetz Pfeiffer <Goetz.Pfeiffer@helmholtz-berlin.de>DocumentationDocumentation is available online here:StructuredData documentation.Documentation is also included in the software distribution in HTML format.InstallationYou can install StructuredData withpip(python package manager), asdebianorrpmpackage or fromsource.All is described here:StructuredData install.LicenseStructuredData is licensed under GNU GPL v.3. Here is the license text:StructuredData license.
Package: yamlsub
Project TitleYAML substitutionProject ShieldsTable of ContentsProject TitleProject ShieldsTable of ContentsAboutGetting StartedPrerequisitesInstallingUsageAboutA wrapper around thedotenvandpyaml-envpackages.Getting StartedThis project just serves as a wrapper to load environment variables from a .env file, and then update a YAML configuration file with environment variables as needed / required.It's important to view the documentation for thepyaml-envanddotenvprojects.Prerequisitespython, version 3.11+python'sbuild package:pip install buildInstallingTo install using pip:pip install yamlsubTo include the package from VCS in a project, you can follow thepip documentationto import a GitHub project.For example:pip install yamlsub@git+https://github.com/willmorejg/yamlsub.gitUsageReview the documentation for thepyaml-envanddotenvprojects for additioanl information on how best to incorporate this project into other projects.Using an example .env file containing the following ...DB_HOST=localhost
DB_USER=root
DB_PASS=123456... and a sample config.yaml file ...database:
  host: !ENV ${DB_HOST}
  user: !ENV ${DB_USER}
  pass: !ENV ${DB_PASS}... and the following code ...from yamlsub.config import Config

cfg = Config(env_path='.env', yaml_path='config.yaml'), you can access configuration values as follows:database_config = cfg.get_config_key('database')
dbhost = database_config['host']
dbuser = database_config['user']
dbpass = database_config['pass']

print(f'Host: {dbhost}, User: {dbuser}, Pass: {dbpass}')
Package: yaml-sync
yamlsyncYaml Sync is averylightweight YAML-based cache for when you want to preserve the state of something on disk in a human readable way.InstallationTo install Yaml Sync, simply run:pipinstallyaml-syncExample usageHere's a quick example of how to use Yaml Sync:from yaml_sync import YamlCache

# Create a cache that reads and writes to the specified file
cache = YamlCache('cache.yaml', mode='rw')

# Save a key to the cache and write to disk
cache['hello'] = 'world'

# Check if a key is in the cache
assert 'hello' in cache

# Retrieve a key from the cache
variable = cache['hello']

# Save a list to the cache
cache['list_example'] = [1, 2, 3]The resulting yaml will be:hello: world
list_example:
  0: 1
  1: 2
  2: 3You can passnumber_lists=Trueat init to save any lists as a numbered dictionary. Since the goal of Yaml Sync is a human-readable file, the numbering may be desired in some cases.If a value is None, that key is not returned forkey in cache. e.g.cache['empty_key']=Noneassert'empty_key'incache# AssertionErrorFinally, you can specify a preferred order to the keys, to control what is shown first in the yaml.cache=YamlCache('cache.yaml',order=['b','a'])cache['a']='hello'cache['b']='world'withopen('cache.yaml')asf:print(f.read())b:world
a:helloLicenseThis project is licensed under theMIT License.
Package: yamltable
YamlTableDocumentation:https://wolfgangwazzlestrauss.github.io/yamltableSource Code:https://github.com/wolfgangwazzlestrauss/yamltableYamlTable is a Python command line utility for working with YAML files organized
similar to a relational database table. It supports YAML files organized as a
list of dictionaries, which share key names and value types. YamlTable provides
commands for listing, searching, sorting, etc. data from the supported files.Supported YAML File OrganizationsYamlTable works with YAML files organized as a list of dictionaries with similar
key names and value types.-name:awsclidescription:Amazon Web Services command line clientwebsite:https://aws.amazon.com/-name:glancesdescription:operating system monitoring interfacewebsite:https://github.com/nicolargo/glancesThe JSON schema support is included for YAML files organized as:schema:$schema:http://json-schema.org/draft-07/schema#description:pipx package metadata schematype:objectproperties:name:type:stringpattern:"^[\\w-]+$"description:type:stringwebsite:type:stringrequired:-name-description-websiteadditionalProperties:falserows:-name:awsclidescription:Amazon Web Services command line clientwebsite:https://aws.amazon.com/-name:glancesdescription:operating system monitoring interfacewebsite:https://github.com/nicolargo/glancesGetting StartedInstallationYamlTable can be installed for Python 3.6+ withpipx.pipx install yamltableTo reuse its library functions install withpip.pip install --user yamltableThe latest release can also be downloaded and installed from GitHub.pip install --user https://github.com/wolfgangwazzlestrauss/yamltable/releases/latest/download/yamltable-py3-none-any.whlCommandsYamlTable provides the following commands for working with YAML files:list: list dictionary key valuessearch: search dictionaries by key and valuesort: sort dictionaries by key and valuevalidate: validate that dictionaries conform to the given JSON schemaContributingSince YamlTable is in an early development phase, it is not currently open to
contributors.LicenseLicensed under theMIT license.
Package: yamltool
YAML tool, a clone of the json.tool Python module for YAML.This tool provides a simple command line interface to validate and pretty-print
YAML documents while trying to preserve as much as possible from the original
documents (like comments and anchors).Usageusage:yt[-h][-i][files...]YAMLtool,acloneofthejson.toolPythonmoduleforYAML.Thistoolprovidesasimplecommandlineinterfacetovalidateandpretty-printYAMLdocumentswhiletryingtopreserveasmuchaspossiblefromtheoriginaldocuments(likecommentsandanchors).positionalarguments:filesaYAMLfiletobevalidatedorpretty-printedoptionalarguments:-h,--helpshowthishelpmessageandexit-i,--in-placePerformthepretty-printinplace,overwritingtheexistingfiles.Whenenabling--in-place,allfilesareprocessedasinputfiles.When--in-placeisnotenabledandtherearemorethen2filespassed,thelastfilesisconsideredastheoutputfile.Ifyouwishtopretty-printmultiplefilesandoutputtostandardout,specifythelastfileas"-".Pleasenotethatspecifyingmultipleinputfileswillconcatenatethem,resultinginasinglefilethathasmultipledocuments.pre-commit hookYAML tool can be used as apre-commithook by
adding the following to your.pre-commit-config.yamlfile:---repos:-repo:https://git.shore.co.il/nimrod/yamltool.gitrev:0.1.2hooks:-id:yamltoolLicenseThis software is licensed under the MIT license (see theLICENSE.txtfile).AuthorNimrod Adar,contact meor visit mywebsite. Patches are welcome viagit send-email. The repository is located
at:https://git.shore.co.il/nimrod/.
Package: yamltopy
yamltopyInstallpipinstallyamltopyUsageusage: yamltopy [-h] [-i INPUT] [-o OUTPUT] [-n NAME] [-v]

Convert YAML configuration file to a Python modulefor better performance

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        The input Yaml file (YML or YAML)
  -o OUTPUT, --output OUTPUT
                        The output Py file
  -n NAME, --name NAME  The name of the exported variable containg the Yaml data
  -v, --verboseConvert YAML file to PY:yamltopy-ipath/to/file.yaml-opath/to/output.py-nNAME_OF_VARIABLEYou can import the output file (if modules set up properly):frompath.to.outputimportNAME_OF_VARIABLEprint(NAME_OF_VARIABLE)
Package: yaml-to-sqlite
yaml-to-sqliteLoad the contents of a YAML file into a SQLite database table.$ yaml-to-sqlite --help
Usage: yaml-to-sqlite [OPTIONS] DB_PATH TABLE YAML_FILE

  Convert YAML files to SQLite

Options:
  --version             Show the version and exit.
  --pk TEXT             Column to use as a primary key
  --single-column TEXT  If YAML file is a list of values, populate this column
  --help                Show this message and exit.UsageGiven anews.ymlfile containing the following:-date:2021-06-05body:|-[Datasette 0.57](https://docs.datasette.io/en/stable/changelog.html#v0-57) is out with an important security patch.-date:2021-05-10body:|-[Django SQL Dashboard](https://simonwillison.net/2021/May/10/django-sql-dashboard/) is a new tool that brings a useful authenticated subset of Datasette to Django projects that are built on top of PostgreSQL.Running this command:$yaml-to-sqlitenews.dbstoriesnews.ymlWill create a database file with this schema:$sqlite-utilsschemanews.db
CREATETABLE[stories]([date]TEXT,[body]TEXT);The--pkoption can be used to set a column as the primary key for the table:$yaml-to-sqlitenews.dbstoriesnews.yml--pkdate
$sqlite-utilsschemanews.db
CREATETABLE[stories]([date]TEXTPRIMARYKEY,[body]TEXT);Single column YAML listsThe--single-columnoption can be used when the YAML file is a list of values, for example a file calleddogs.ymlcontaining the following:-Cleo-Pancakes-NixieRunning this command:$yaml-to-sqlitedogs.dbdogs.yaml--single-column=nameWill create a singledogstable with a singlenamecolumn that is the primary key:$sqlite-utilsschemadogs.db
CREATETABLE[dogs]([name]TEXTPRIMARYKEY);$sqlite-utilsdogs.db'select * from dogs'-t
name
--------
Cleo
Pancakes
Nixie
Package: yaml-transformer
yaml-transformerIntroductionyaml-transformeris a powerful Python package designed to enhance YAML processing capabilities. It introduces advanced features like including other YAML files, executing JSONPath queries, applying JQ queries, and flattening lists within YAML files.InstallationTo installyaml-transformer, run the following command:pipinstallyaml-transformerFeatures!include: Include and merge other YAML files.!jsonpath: Perform JSONPath queries on YAML nodes.!jq: Apply JQ queries and modifications to YAML nodes.!flatten: Flatten nested lists into a single list.UsageTheyaml-transformerpackage enhances YAML processing with advanced features. Below are examples demonstrating its capabilities using a Transformers theme. These examples show how to include external YAML files, apply JSONPath queries, use JQ queries, and flatten lists, all within a YAML context.Including External YAML FilesAutobots YAML (autobots.yaml):-name:Optimus Primerole:Leader-name:Bumblebeerole:ScoutDecepticons YAML (decepticons.yaml):-name:Megatronrole:Leader-name:Starscreamrole:FighterLeaders YAML (leaders.yaml):autobots:-name:Optimus Primerole:LeaderMain YAML:autobots:&autobots!includeautobots.yamldecepticons:&decepticons!includedecepticons.yamlIn this setup,autobots.yamlanddecepticons.yamlare included and referenced in the main YAML file using YAML anchors (&autobotsand&decepticons).Applying JQ QueryTo find a specific Transformer leader (e.g., Optimus Prime) using JQ:leaders:&leaders!includeleaders.yamlleader:!jq{object:*leaders,filter:'[.autobots[]|select(.name=="OptimusPrime")]'}This JQ query selects "Optimus Prime" from the includedleaders.yaml.Combining JSONPath Queries with FlattenCombining the names of all Transformers (both Autobots and Decepticons) into a single list:all_names:!flatten-!jsonpath{object:*autobots,path:'$[*].name',all:true}-!jsonpath{object:*decepticons,path:'$[*].name',all:true}Here,!jsonpathqueries are used to extract the names of all Autobots and Decepticons, and!flattencombines these names into a single list.Running TestsTo run tests, install the package with development dependencies:pipinstallyaml-transformer[dev]Then, execute the test suite using pytest:pytestContributingContributions toyaml-transformerare welcome!Licenseyaml-transformeris released under theMIT License.
Package: yaml-translator
yaml-translatorA simple translator using YamlUsageCreate a translation file in your package.your_package
your_package/__init__.py
your_package/translator/__init__.py
your_package/translator/en.yaml
your_package/translator/ko.yamlyour_package/translator/en.yamlfile:menu:
  title: "Title"
  subtitle: "{sub} Subtitle"your_package/translator/ko.yamlfile:menu:
  title: "제목"
  subtitle: "소제목 {sub}"See "Installing Package Data"
for how to add a yaml file to your deployment package.Import package:from yaml_translator import Translator
from your_package import translationsCreateTranslatorinstance:t = Translator.from_module_dir(translations, "ko")Get translated text:t("menu.title")
t("menu.subtitle", sub="TEMP")Change language code:t.lang = "ko"LicenseSee theLICENSEfile for details. In summary,yaml-translatoris licensed under theMIT license.
Package: yaml-update-last-modified-date
yaml-update-last-modified-dateAutomatically set the last modified date in YAML front matter of edited markdown files.Quick startcdinto a folder containing a git repository.git adda modified markdown (.md) file that haslast_modified_atin its YAML front matter.Get this script:curl --location --remote-name https://raw.githubusercontent.com/proinsias/yaml-update-last-modified-date/main/yaml-update-last-modified-dateRun the script:bash yaml-update-last-modified-date.This script will:Look for markdown files that differ from the currentHEAD,Check to see if they contain the specified last-modified-date variable (last_modified_atby default)
in their YAML front matter, if present, andUpdate the value of that variable to the current Universal Time Coordinated (UTC) time.See below for instructions on how to install this script as a local command or as apre-commitgit hook.Table of ContentsCreditsUpdating the Table of Contents of this fileInstallation yaml-update-last-modified-date via homebrewIf necessary, first installhomebrew!Then:brewinstallproinsias/yaml-update-last-modified-date/yaml-update-last-modified-dateUsing yaml-update-last-modified-date with pre-commitAdd this to your.pre-commit-config.yaml:-repo:https://github.com/proinsias/yaml-update-last-modified-daterev:''# Use the sha / tag you want to point athooks:-id:yaml-update-last-modified-dateCreditsThanks toMichael Rosefor theoriginal script.LicenseSeeLICENSE.Updating the Table of Contents of this fileWe usemarkdown-tocto automatically generate the table of contents for this file. You can
update the TOC using:# npm install --global markdown-tocmarkdown-toc-iREADME.md
Package: yaml-utils
yaml-utilsIt will help to read and get parent key & target value for given target key from yamlInstallationpip install yaml-utilsHow to use it?fromyaml_utilsimportget_parent_key_and_target_valuedict_data=[{'id':{'home_welcome_lbl':'username'}},{'id':{'test.test1':'test1','test.test2':'test2','test.test3':'test3','test.test4':'test4'},'xpath':{'test.test5':'test5','test.test6':'test6','test.test7':'test7','test.test8':'test8'}},{'id':{'login_username_txt':'username123','login_password_txt':'password'}}]loc,val=get_parent_key_and_target_value(dict_data,"login_username_txt")print(loc,val)# Output:# id username123Available methods and usage samplefromyaml_utilsimportget_file_list,yaml_reader,get_parent_key_and_target_value,get_parent_and_dynamic_target_valuedir_name_list=get_file_list(dir_name)dict_data=yaml_reader(dir_name_list)parent_key,target_value=get_parent_key_and_target_value(dict_data,tarket_key)dynamic_parent_key,dynamic_target_value=get_parent_and_dynamic_target_value(dict_data,tarket_key,replace_list,replaceable_word="replace")LicenseMIT LicenseCopyright (c) 2021 Muralidharan RajendranPermission 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 limitation 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: yaml-validate
Permission 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 limitation 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.Description: UNKNOWN
Platform: UNKNOWN