GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aboutcode-org/saneyaml: Cleaner, simpler, safer and saner YAML parsing/serialization in Python, for YAML meant to be readable first, on top of PyYAML

BranchesTags
Open more actions menu

Latest commit

 

History

239 Commits
239 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
etc
etc
 
 
src
src
 
 
tests
tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.readthedocs.yml
.readthedocs.yml
 
 
AUTHORS.rst
AUTHORS.rst
 
 
CHANGELOG.rst
CHANGELOG.rst
 
 
CODE_OF_CONDUCT.rst
CODE_OF_CONDUCT.rst
 
 
CONTRIBUTING.rst
CONTRIBUTING.rst
 
 
MANIFEST.in
MANIFEST.in
 
 
Makefile
Makefile
 
 
NOTICE
NOTICE
 
 
README.rst
README.rst
 
 
apache-2.0.LICENSE
apache-2.0.LICENSE
 
 
appveyor.yml
appveyor.yml
 
 
azure-pipelines.yml
azure-pipelines.yml
 
 
configure
configure
 
 
configure.bat
configure.bat
 
 
pyproject.toml
pyproject.toml
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements.txt
requirements.txt
 
 
saneyaml.ABOUT
saneyaml.ABOUT
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

saneyaml

This micro library is a PyYaml wrapper with sane behaviour to read and write readable YAML safely, typically when used with configuration files.

With saneyaml you can dump readable and clean YAML and load safely any YAML preserving ordering and avoiding surprises of type conversions by loading everything except booleans as strings.

Optionally you can check for duplicated map keys when loading YAML.

Works with Python 3. Requires PyYAML 5.x or higher.

license: apache-2.0 homepage_url: https://github.com/aboutcode-org/saneyaml

Usage:

pip install saneyaml

>>> from  saneyaml import load
>>> from  saneyaml import dump
>>> a=load('''version: 3.0.0.dev6
...
... description: |
...     AboutCode Toolkit is a tool to process ABOUT files. An ABOUT file
...     provides a way to document a software component.
... ''')
>>> a
dict([
    (u'version', u'3.0.0.dev6'),
    (u'description', u'AboutCode Toolkit is a tool to process ABOUT files. '
    'An ABOUT file\nprovides a way to document a software component.\n')])

>>> pprint(a.items())
[(u'version', u'3.0.0.dev6'),
 (u'description',
  u'AboutCode Toolkit is a tool to process ABOUT files. An ABOUT file\nprovides a way to document a software component.\n')]
>>> print(dump(a))
version: 3.0.0.dev6
description: |
  AboutCode Toolkit is a tool to process ABOUT files. An ABOUT file
  provides a way to document a software component.

About

Cleaner, simpler, safer and saner YAML parsing/serialization in Python, for YAML meant to be readable first, on top of PyYAML

Resources

Readme

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

10 stars

Watchers

8 watching

Forks

5 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.