Skip to content

processing nested data structure with ease

License

Notifications You must be signed in to change notification settings

Leibniz-HBI/sympath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sympath

Processing nested data structure with ease

Usage

from sympath import Sympath

a = {
        "nested": {
            "key1": "Captain",
            "key2": "Picard"
        }
    }

b = {
    "nested": {
        "key1": "Venetian",
        "key2": "Trobones",
        "key3": "Really"
    }
}

sydestructure = Sympath().nested.select(name="key1", last_name="key2")

sydestructure(a)
>>> {"name": "Captain", "last_name": "Picard"}

sydestructure(b)
>>> {"name": "Venetian", "last_name": "Trombone"}

sysdestructure({})
>>> None

Developer Installation

  1. Install poetry if you don't have it: pipx install poetry.
  2. Clone this repo, go into the repo's folder.
  3. Install the dependencies with poetry install and spawn a shell in your new virtual environment with poetry shell.
  4. To run tests type pytest.

Philipp Kessling under the MIT license, 2022.

About

processing nested data structure with ease

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages