Metadata-Version: 2.4
Name: saneyaml
Version: 0.6.1
Summary: Read and write readable YAML safely preserving order and avoiding bad surprises with unwanted infered type conversions. This library is a PyYaml wrapper with sane behaviour to read and write readable YAML safely, typically when used for configuration.
Home-page: https://github.com/aboutcode-org/saneyaml
Author: nexB. Inc. and others
Author-email: info@aboutcode.org
License: Apache-2.0
Keywords: utilities,yaml,pyyaml,block,flow
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: apache-2.0.LICENSE
License-File: NOTICE
License-File: AUTHORS.rst
License-File: CHANGELOG.rst
License-File: CODE_OF_CONDUCT.rst
Requires-Dist: PyYAML
Provides-Extra: testing
Requires-Dist: pytest!=7.0.0,>=6; extra == "testing"
Requires-Dist: pytest-xdist>=2; extra == "testing"
Requires-Dist: aboutcode-toolkit>=7.0.2; extra == "testing"
Requires-Dist: twine; extra == "testing"
Requires-Dist: black; extra == "testing"
Requires-Dist: isort; extra == "testing"
Provides-Extra: docs
Requires-Dist: Sphinx>=3.3.1; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=0.5.0; extra == "docs"
Requires-Dist: doc8>=0.8.1; extra == "docs"
Dynamic: license-file

========
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.
