Skip to main content

YamlWrapper is a wrapper for yaml files, that creates an abstraction layer in order to handle yaml files in a easy way.

Project description

PythonYamlWrapper

GitHub GitHub tag (latest by date) GitHub top language

Description

YamlWrapper is an abstraction over PyYAML library. Its purpuse is to made easier to interact with .yaml files. This is made possible by create/update/remove operations with two main abstract data types: YamlDictionary and YamlList.

Documentation

You can find the official documentation at this link

Installation

   pip install PythonYamlWrapper

Importing

   from yaml_wrapper import YamlWrapper
   
   yaml_wrapper: YamlWrapper = YamlWrapper("tmp/file_path.yaml")

Abstract data types and examples

The core functionalities provided by YamlWrapper work with YamlDictionary and YamlList.

  • Dictionary
    key_1: "value"
    key_2:
       sub_key_1: "sub_value"
       sub_key_2: 1

Is rappresented by:

  data = [
            YamlDictionary("key", "value"),
            YamlDictionary("sub_key", [
                                          YamlDictionary("sub_key_1", "sub_value"),
                                          YamlDictionary("sub_key_2", 1)
                                       ])
  
         ]
  • Lists
- "first_value"
- "second_value"
- "third_value"

Is rappresented by:

  data = [
            YamlList(["first_value", "second_value", "third_value"])
         ]
  • Dictionary with list
   key: 
      - "first_value"
      - "second_value"
      - "third_value"

Is rappresented by:

  data = [  
            YamlDictionary("key", YamlList(["first_value", "second_value", "third_value"]))
         ]

Special thanks

PyYaml

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PythonYamlWrapper-1.2.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PythonYamlWrapper-1.2.1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file PythonYamlWrapper-1.2.1.tar.gz.

File metadata

  • Download URL: PythonYamlWrapper-1.2.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for PythonYamlWrapper-1.2.1.tar.gz
Algorithm Hash digest
SHA256 a4cef2eba6e49e1817e1d3586b8f2f7aba8b312db0a365a426bde795b2e11dee
MD5 ace3b387a5298d167109d46f5a4a0aa4
BLAKE2b-256 73ce230636d903e9271ab845c900649cbf1f8b3b57eb5bc97ccf702a96438bdb

See more details on using hashes here.

File details

Details for the file PythonYamlWrapper-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: PythonYamlWrapper-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for PythonYamlWrapper-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ceac3676c150bfba467881ce8071781bdd71c591a8ef47a8e8bcdb1d468e358
MD5 549769afadb6abc04d6c5b4205b632cc
BLAKE2b-256 d7ca7ea3a0153fa55fa134730f0670c6bebabf939651e51131dc13b2bfcb0389

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page