Coder Social home page Coder Social logo

alexandruparaschivdumitru / yaml_wrapper Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 175 KB

YamlWrapper's purpuse is to made easier to interact with .yaml files.

Home Page: https://alexandruparaschivdumitru.github.io/yaml_wrapper/src/API/yaml_wrapper.html

License: MIT License

Python 100.00%

yaml_wrapper's Introduction

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

yaml_wrapper's People

Contributors

alexandruparaschivdumitru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.