Saravanan666/pypi-org huggingface dataset:
Package: yaml-lint-to-junit-xml
Yaml Lint to jUnit XMLConvert yaml-lint outputs to a jUnit valid xml tests result file.Thanks to the author of the original projectansible-lint-to-junit-xmlQuickstartInstallansible-lint-to-junit-xmlwith pip:pip install yaml-lint-to-junit-xmlOr you can simply get this repo and install with setup.pyUsageRunyamllinton the desired files and pipe toyaml-lint-to-junit-xmlyamllint -f parsable <file or directly> | yaml-lint-to-junit-xml > results/yaml-lint-results.xmlAlternatively you can runyamllintseparately fromyaml-lint-to-junit-xmland use a file to pass the outputyamllint -f parsable <file or directly> > yaml-lint-results.txt
yaml-lint-to-junit-xml yaml-lint-results.txt > results/yaml-lint-results.xmlNote:yamllintmust run with-f parsablefor the output to be machine parsableFeaturesPipe output directly fromyamllintcallOutput XML file is compliant withjenkins junit5 Schema.ExampleRunningyamllinton a file results in:roles/test_role/defaults/main.yml:25:121: [warning] line too long (157 > 120 characters) (line-length)
roles/test_role/tasks/main.yml:33:35: [error] no new line character at the end of file (new-line-at-end-of-file)
test_playbook.yml:4:8: [warning] truthy value should be one of [False, True, false, true] (truthy)Runningyamllintand piping the output toyaml-lint-to-junit-xmllooks line this:yamllint -f parsable test_playbook.yml | yaml-lint-to-junit-xmlWould result in:<?xml version="1.0" ?>
<testsuite errors="1" name="yaml-lint" tests="1">
        <testcase name="truthy value should be one of [False, True, false, true] (truthy)">
                <failure message="test_playbook.yml:4:8: [warning] truthy value should be one of [False, True, false, true] (truthy)" type="yaml-lint">
yaml-lint exception type: warning
yaml-lint exception description: truthy value should be one of [False, True, false, true] (truthy)
filename: test_playbook.yml
line nr: 4:8
        </failure>
        </testcase>
</testsuite>
Package: yamlloader
yamlloaderThis module provides loaders and dumpers for PyYAML. Currently, an OrderedDict loader/dumper is
implemented, allowing to keep items order
when loading resp. dumping a file from/to an OrderedDict (Python 3.7+: Also regular dicts are supported and are the default items to be loaded to. As of Python 3.7 preservation of insertion order is a language feature of regular dicts.)This project was originally mirrored fromyamlordereddictMany thanks to the original author François Ménabé!
The library contains several improvements including automated testing and
the much faster C-versions of the Loaders/Dumpers.API DocumentationInstallThere is a pip and a conda version available$pipinstallyamlloaderor$condainstallyamlloader-cconda-forgeBut does [your special case here] also work?Tests are run continuously using randomly generated yaml files.
Also, there are no fails to be expected.Still, if you are concerned thatyourspecial case may breaks in the future, please
add your own tests astest_ext_anyname.pyundertests/or let us know about your needs.
This guarantees that no code will be added that breaksyourcase.C vs non-C versionA significant speedup can be reached by replacing the Loader* and Dumper* classes by CLoader*
and CDumper*. The package hereby relies on the implementations from PyYAML. If they have not
been compiled,yamlloaderautomaticallyfalls back to the non-C versions.Therefore using the C-version is safe: if it is not available, the pure Python version is
automatically used.Usage examplesLoader usageimportyamlimportyamlloaderwithopen('myfile.yml')asyaml_file:data=yaml.load(yaml_file,Loader=yamlloader.ordereddict.CLoader)# CLoader is faster than LoaderNote:For using the safe loader (which takes standard YAML tags and does
not construct arbitrary Python objects), replaceyamlloader.ordereddict.CLoaderbyyamlloader.ordereddict.CSafeLoader.Dumper usageimportyamlimportyamlloaderfromcollectionsimportOrderedDictdata=OrderedDict([('key1','val1'),('key2',OrderedDict([('key21','val21'),('key22','val22')]))])withopen('myfile.yaml','w')asyaml_file:yaml.dump(data,yaml_file,Dumper=yamlloader.ordereddict.CDumper)Note:For using the safe dumper (which produce standard YAML tags and does
not represent arbitrary Python objects), replaceyamlloader.ordereddict.CDumperbyyamlloader.ordereddict.CSafeDumper.FAQC version not workingIf the C version is not working (it falls back by default to a non-C version),
check if yaml.cyaml exists. If not, the cyaml module was not compiled during the installation of
yaml (pyyaml). Make sure that cython is installed (pip install Cython) and the yaml.h file is
there (apt: libyaml-dev).
Package: yamlmagic
anIPythonmagicfor capturing data inYAMLinto a running
IPython kernel.InstallFrom the command line (or with!in a notebook cell):pipinstallyamlmagicEnableAd-hocIn the notebook, you can use the%load_extor%reload_extline
magic.%reload_extyamlmagicConfigurationIn your profile’sipython_kernel_config.py, you can add the
following line to automatically loadyamlmagicinto all your running
kernels:c.InteractiveShellApp.extensions=['yaml_magic']UseThe%%yamlcell magic will either act as simple parser:%%yamla_toplevel_key:1<IPython.core.display.Javascript object>{'a_toplevel_key': 1}which can be accessed by the special last result variable_:_{'a_toplevel_key': 1}Or will update a named variable with the parsed document:%%yamlx-a:1b:2<IPython.core.display.Javascript object>x[{'a': 1, 'b': 2}]By default,yaml.SafeLoaderwill be used, which won’t allow thepowerful but
dangerous(and unportable)`!python/tags <http://pyyaml.org/wiki/PyYAMLDocumentation#YAMLtagsandPythontypes>`__.
If you’d like to use them, provide the-l(or--loader) argument
with aBaseLoadersubclass available via a local variable…fromyamlimportLoaderclassFooLoader(Loader):# some special things you have builtpass%%yaml--loaderFooLoader-a:!!python/float1b:!!python/float2<IPython.core.display.Javascript object>[{'a': 1.0, 'b': 2.0}]…or dotted-notation path to a loader:%%yaml--loaderyaml.Loader-a:!!python/float1b:!!python/float2<IPython.core.display.Javascript object>[{'a': 1.0, 'b': 2.0}]ContributeIssuesandpull
requestswelcome!Licenseyamlmagicis released as free software under theBSD 3-Clause
license.Thank[@tonyfast](http://robclewley.github.io) for asking for this[@robclewley](http://robclewley.github.io) for documentation-shaming
a gist into a module
Package: yaml-models
yaml-modelsPython package generatingtorchmodels from ayamlconfiguration file.
Eachtypeitem in model list need to specify at minimum the default values
needed by thetorch.nnmodule. Arguments not specified will use the default
values.Example config:model:-type:Linearin_features:2out_features:10-type:ReLU-type:Linearin_features:10out_features:1-type:Sigmoidtorch.nn.Linearneeds the default argumentsin_featuresandout_features.Usagepip install yaml-models>>>fromyaml_models.modelimportModel>>>model=Model(config_path="./example_config/model.yaml")>>>print(model)Model((layers): ModuleList((0): Linear(in_features=2, out_features=10, bias=True)(1): ReLU()(2): Linear(in_features=10, out_features=1, bias=True)(3): Sigmoid()))
Package: yamlord
A wrapper for theyamlmodule to easily read and writeOrderedDictobjects
to and fromYAMLformatted files.InstallpipinstallyamlordUsageThe usage is straightforward: make andOrderedDictthen write it to a
specified path, or read aYAMLfile from a specified path to anOrderedDict. That’s it.fromcollectionsimportOrderedDictimportyamlord# Make an Ordered dict for testingd=OrderedDict()d['a']=1d['b']=['str1','str2']# Write OrderedDict to YAML fileyamlord.write_yaml(d,'./test.yaml')# Read YAML file to OrderedDictd=yamlord.read_yaml('./test.yaml')
Package: yamlordereddictloader
DEPRECATED: thePhynix/yamlloaderproject
provide an improved version of this library with unit tests, performance improvements
(by providing access to the C implementation of PyYAML) and is more actively developed.
You should use it!This module provide a loader and a dumper for PyYAML allowing to keep items order
when loading a file (by putting them inOrderedDictobjects) and to manageOrderedDictobjects when dumping to a file.The loader is based on stackoverflow topic (thanks to Eric Naeseth):http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts#answer-5121963Self promotion: I use it a lot withclg, which
allows to generate command-line definition from a configuration file, for keeping
order of subcommands, options and arguments in the help message!To install it$pipinstallyamlordereddictloaderLoader usageimportyamlimportyamlordereddictloaderdata=yaml.load(open('myfile.yml'),Loader=yamlordereddictloader.Loader)Note:For using the safe loader (which want standard YAML tags and does
not construct arbitrary Python objects), replaceyamlorderdictloader.Loaderbyyamlorderedictloader.SafeLoader.Dumper usageimportyamlimportyamlordereddictloaderfromcollectionsimportOrderedDictdata=OrderedDict([('key1','val1'),('key2',OrderedDict([('key21','val21'),('key22','val22')]))])yaml.dump(data,open('myfile.yml','w'),Dumper=yamlordereddictloader.Dumper,default_flow_style=False)Note:For using the safe dumper (which produce standard YAML tags and does
not represent arbitrary Python objects), replaceyamlorderdictloader.Dumperbyyamlorderedictloader.SafeDumper.
Package: yamlpage
Installpip install yamlpageUsage>>> import os
>>> from yamlpage import YamlPage, SingleFolderBackend, MultiFolderBackend
>>> p = YamlPage('./content')Put page>>> url = '/my/url'
>>> p.put(url, (
...     ('title', 'foo'),
...     ('body|md', '- foo\n- bar'),
... ))>>> path = './content/^my^url.yaml'
>>> content = open(path).read()
>>> print(content)
title: foo
body|md: |-
    - foo
    - bar
<BLANKLINE>Get page>>> p.get(url) == {'body|md': '- foo\n- bar', 'title': 'foo'}
True>>> p.get('/not/found/') is None
TrueCheck if page exists>>> p.exists(url)
True
>>> p.exists('/not/found/')
FalseBuilt in backendsSingleFolderBackend (default) maps ‘my/url’ to filename ‘my^url.yaml’>>> p = YamlPage('./content')
>>> p.put('single/folder/backend', 'data')
>>> os.path.exists('./content/single^folder^backend.yaml')
TrueMultiFolderBackend maps ‘my/url’ to filename ‘my/url.yaml’>>> p = YamlPage('./content', backend=MultiFolderBackend)
>>> p.put('multi/folder/backend', 'data')
>>> os.path.exists('./content/multi/folder/backend.yaml')
TrueFiltersYou can automaticaly apply filters to a particular page fields.
As an example let’s renderbodymarkdown to html.>>> import misaka
>>> p = YamlPage('./content', filters={"md": misaka.html})
>>> p.get(url)["body"] == '<ul>\n<li>foo</li>\n<li>bar</li>\n</ul>\n'
True
Package: yaml-patch
yaml-patchApply patches to a yaml string, keeping most of the formatting and comments.Some formatting is not kept due to underlying yaml library limitations:Indentation will be forced to two spacesSpacing before sequence dashes will be forced to two spacesEmpty lines at the start of the string will be removedInstallationpipinstallyaml-patchAs a command line toolYou can pass any number of patches to be applied, they use the following syntax options:Override a single value:<field>.<subfield>=<value>Example:yaml-patch-ftest.yml"spec.replicas=2"Override a value inside a single list item:<field>.[<position]>.<subfield>=<value>Example:yaml-patch-ftest.yml"spec.template.containers.[0].image='mycontainer:latest'"Override a value inside all list items:<field>.[].<subfield>=<value>Example:yaml-patch-ftest.yml"spec.template.containers.[].image='mycontainer:latest'"Append a single value:<field>.<subfield>+=<value>Example (increment int):yaml-patch-ftest.yml"spec.replicas+=2"Example (append string):yaml-patch-ftest.yml"spec.template.containers.[0].image+=':latest'"Example (append item to list):yaml-patch-ftest.yml"spec.template.containers.[0].args+=['--verbose']"As a Python libraryTo useyaml-patchas a library just import the function and pass patches as you would in the CLI examples above.Example:fromyaml_patchimportpatch_yamlfromtextwrapimportdedentdefoverride_list_all_values():source_yaml=dedent("""\some_list:- alice- bob""")patches=["some_list.[]='charlie'"]expected_yaml=dedent("""\some_list:- charlie- charlie""")assertpatch_yaml(source_yaml,patches)==expected_yaml
Package: yaml-patcher
yaml-patcherPatch yaml files.Free software: Apache Software License 2.0Documentation:https://yaml-patcher.readthedocs.io.Installationpipinstallyaml_patcherFeaturesPatch a YAML configuration file with another that specifies the transformations.
For now only supports a replace operation with a literal path.Follows the format inhttps://github.com/krishicks/yaml-patch.To run just use:yaml_patcherbase.yamlpatch.yamlpatched_output.yamlCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-11-27)First release on PyPI.
Package: yaml-pipe
yaml-pipeInstallpipinstallyaml-pipeHow to use--dotindex: extract only.--dotlist: edit only.-f, --file: edit only.Extract Example 1---aaa:bbb:bbbcatsample.yml|yaml-pipe--dotindex"aaa.bbb"outputbbbExtract Example 2---aaa:bbb:bbb---xxx:yyy:yyycatsample.yml|yaml-pipe--block_id1--dotindex"xxx.yyy"outputyyyExtract Example 3---xxx:yyy:zzz:zzzcatsample.yml|yaml-pipe--block_id1--dotindex"xxx"outputyyy:zzz:zzzEdit Example 1sample.yml---
foo:
  bar: BARcatsample.yml|yaml-pipe--dotlistfoo.bar="bar"output---foo:bar:barEdit Example 2sample.yml---foo:bar:BAR---fizz:buzz:BUZZcatsample.yml|yaml-pipe--block_id1--dotlistfizz.buzz="buzz"output---foo:bar:BAR---fizz:buzz:buzzexample3sample.yml---foo:bar:BAR---fizz:buzz:BUZZupdate.ymlfizz:
  buzz: buzzcatsample.yml|yaml-pipe--block_id1--fileupdate.ymloutput---foo:bar:BAR---fizz:buzz:buzzDevelopersLinting and testpyenvlocal3.10.43.9.133.8.13poetryinstall
poetryrunnox
./test_cli.shUpload to PyPIDefault target is testpypi.makepypi-uploadIf you upload to pypi, set empty toTEST_PYPI.makepypi-uploadTEST_PYPI=
Package: yamlpp
yamlppSimple YAML preprocessor, resolves anchors. This is meant for preprocessing.gitlab-ci.ymlfiles. The anchors will be preprocessed, so you can see what the file looks like if you wrote out everything by hand.ExampleHere isexample.yml(taken fromhttps://docs.gitlab.com/ee/ci/yaml/#anchors):.job_template: &job_definition
  script:
    - test project

.postgres_services:
  services: &postgres_definition
    - postgres # urmom
    - ruby

.mysql_services:
  services: &mysql_definition
    - mysql
    - ruby

test:postgres:
  <<: *job_definition
  services: *postgres_definition

test:mysql:
  <<: *job_definition
  services: *mysql_definitionIf you runyamlpp example.ymlthe output will be:.job_template:
  script:
    - test project

.postgres_services:
  services:
    - postgres
    - ruby

.mysql_services:
  services:
    - mysql
    - ruby

test:postgres:
  script:
    - test project
  services:
    - postgres
    - ruby

test:mysql:
  script:
    - test project
  services:
    - mysql
    - ruby
Package: yamlprocessor
YAML ProcessorThis project provides a simple utility for working with YAML files, process
include files, substitute string with variable and date-time values, and
validate against JSON schema.Quick StartTo install from PyPI, run:python3-mpipinstallyamlprocessorCommand line usage:yp-data[options]input-file-nameoutput-file-namePython usage:fromyamlprocessor.dataprocessimportDataProcessorprocessor=DataProcessor()# ... Customise the `DataProcessor` instance as necessary ..., then:processor.process_data(in_file_name,out_file_name)DocumentationSeeUser Guidefor detail.
Package: yaml-query
yaml-queryUsage~ cat configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app: chirper
  name: chirper
data:
  config.yaml: |
    - a
    - b
    - c
  service-config.yaml: |
    service_on: true

~ yaml-query 'metadata labels app' configmap.yaml
chirper
...

~ cat configmap.yaml | yaml-query 'data service-config.yaml'
service_on: true
...
Package: yamlreader
yamlreaderMerge YAML data from a directory, a list of files or a file glob. With a
directory, the YAML files (*.yaml) are sorted alphabetically. The YAML
files are expected to contain a complex key-value structure and merged
with the following rules:lists get appendedhashes get merged by keyscalars (numbers, strings) are overwritteneverything else will failThe purpose is to allow several YAML files instead of a single YAML file. We
use it to help our software read configuration data from an arbitrary amount
of YAML files instead of a single YAML file.Read the unit test to see some examples.Building and InstallationUsing pipyamlreaderis available withpip:pip install yamlreaderManual build and installationIf you want to make changes or use e.g.fpmfor packaging this, you need to
prepare the development environment to make further steps.Prepare the sourcegit clone https://github.com/ImmobilienScout24/yamlreader.git
cd yamlreader
virtualenv venv
source venv/bin/activate
pip install pybuilder
pyb install_dependenciesRunning testspyb verifyGenerating a setup.pypyb
cd target/dist/yamlreader-<VERSION>
./setup.py <whatever you want>RunningThe package installs a command line scriptyamlreaderthat can be used to
read one or many YAML files and dump the merge result as a YAML document.Use it in your softwareWherever you had been using thesafe_loadfunction ofPyYAMLto read a single YAML file you can use
theyamlreader.yaml_loadfunction as a replacement to read all*.yamlfiles in a directory:from yamlreader import yaml_load

defaultconfig = {
        "loglevel" : "error",
        "some" : "value"
}

config = yaml_load("/etc/myapp", defaultconfig)yaml_loaddef yaml_load(source,defaultdata=None):
    """merge YAML data from files found in source

    Always returns a dict. The YAML files are expected to contain some kind of
    key:value structures, possibly deeply nested. When merging, lists are
    appended and dict keys are replaced. The YAML files are read with the
    yaml.safe_load function.

    source can be a file, a dir, a list/tuple of files or a string containing
    a glob expression (with ?*[]).

    For a dir all *.yaml files will be read in alphabetical order.

    defaultdata can be used to initialize the data.
    """
Package: yaml-resume
yaml-resumePurposeThis is an open source initiative to create a YAML-based resume.Getting StartedInstallPackage is available on Pypi :pip install yaml-resumeUsageInit a new resume through an interactive cli:yaml-resume init FILENAMEValidate your yaml resume:yaml-resume validate FILENAMEExport you resume in html or pdf:yaml-resume export FILENAME [-t <theme>] [-e <html|pdf>] [-i <picture>] [-o <output-file>]ContributionsPlease have a look at thecontributing guideand thecode of conduct.TL;DRYou can ask for features/report bugs using Github issues.
You can submit work using Github Pull Requests.To test development version without installing :# To install dependencies
python3 -m pip install -r requirements.txt
python3 -m pip install pytest pytest-cov black pre-commit

# To run the cli
python3 -m yaml_resume

# To run the test suite
python3 -m pytest --cov=yaml_resume tests/

# To install pre-commit hook
pre-commit installCreditsThis project was inspired by :JSON Resume.Special thanks to all contributors of the following projects used by yaml-resume :clickcerberusPyYAMLjinja2WeasyPrint
Package: yaml-scripts
Creating auto install scripts from YAML config filesFeaturesPydantic-like Schema validation: the YAML schema has precise syntax and the build pipeline will yield warnings or stop if your file has errors in itAset of CLIsto interact with config files:yamlrunshows the commandsyamlrun scriptis the script building subcommandyamlrun uploadis the script temp hosting subcommandyamlrun packlocates asetup.ymlfile within the current directory and runs all the commands.An explanationRunning the commandyamlrun?Or equivalentlyyamlrun explainwill output this explanation in the terminal:The setup fileThe YAML setup file (which can also be JSON), is a way for you to describle exactly what type of package/program you
want to auto-install using a single installer.File structureThe file is structured in the following way:<task name 1>:description:<textual description if you wish, OPTIONAL>items:<item name 1>:description:<textual description if you wish, OPTIONAL>type:<type description, if it's a CLI, GUI, what purpose, REQUIRED>priority:<how important it is to install it within the setup REQUIRED>commands:-<powershell line 1>-<powershell line 2><item name 2>:...<item name 3>:...run:# order in which the items are going to be installedsteps:-<item name 1>-<item name 3># look you just swapped the order !-<item name 2><task name 2>:...<task name 3>:...Script & Executable BuilderTwo options:(1) One-liner script install. This script is equivalent to:Building the PS1 core scriptyamlrun script build <task> <path/to/setup.yml>Uploading the PS1 core scriptyamlrun upload f <path/to/setup.ps1>The previous step should give you an URL of the kindhttp://ix.io/Your resulting one liner is just:Set-ExecutionPolicyRemoteSigned-ScopeCurrentUser-Force;irm<url>|iexthis is theyamlrun script BOLoryamlrun script build-one-linercommand.(2) Doing any of the steps above on its own.Sample setup fileYou can peek at the contents of thissetup.yml file.The resulting script from callingyamlrun script buildisthe setup.ps1 file.Finally, callingyamlrun setup render <name>will generate amarkdown formatted version of your setup file like setup.mdInstallationJustpip installit if you have it, but an executable is underway 😎pipinstallyaml-scripts
Package: yaml-serialize
yaml_serializeA simple way to store python objects in yamlUsefromsrcimportyaml_serializeclassMyObject:def__init__(self):self.name="Jake"self.age=16self.favorite_color="Green"self.mylist=["hey","this","is","cool"]my_object=MyObject()serializer=yaml_serialize.Serialize(my_object)# Get serialized object as stringmy_serialized_object=serializer.get()# Write serialized object with class name "MyObject.yml"serializer.write()# Write serialized object with custom name "MyCoolObject.yml"serializer.write("MyCoolObject.yml")Output_object: !!python/object:__main__.MyObject
  age: 16
  favorite_color: Green
  mylist:
  - hey
  - this
  - is
  - cool
  name: Jake