A small pure-python package for data structure relatedutility functions.
Project description
A small pure-python package for data strcture related utility functions.
from strct.dict import get_nested_val
>>> dict_obj = {'a': {'b': 7}}
>>> get_nested_val(('a', 'b'), dict_obj)
7
1 Installation
Install strct with:
pip install strct
2 Use
strct is divided into four sub-modules.
2.1 dict
Getting values from nested dicts in various ways; operations on number-valued dicts; merging, normalizing, reversing and printing dicts (nicely)
2.2 list
Index and element shifts that preserve order.
2.3 set
Getting a set element by a priority list.
2.4 sortedlist
Operations on sortedcontainers.SortedList objects.
3 Contributing
Package author and current maintainer is Shay Palachy (shay.palachy@gmail.com); You are more than welcome to approach him for help. Contributions are very welcomed.
3.1 Installing for development
Clone:
git clone git@github.com:shaypal5/strct.git
Install in development mode with test dependencies:
cd strct
pip install -e ".[test]"
3.2 Running the tests
To run the tests, use:
python -m pytest --cov=strct --doctest-modules
3.3 Adding documentation
This project is documented using the numpy docstring conventions, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings (in my personal opinion, of course). When documenting code you add to this project, please follow these conventions.
4 Credits
Created by Shay Palachy (shay.palachy@gmail.com).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for strct-0.0.14-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 790885a827777a3cb1ca8d6585e5634fb5a052de6f15b5398ac0913f3682f5b4 |
|
MD5 | 1b49ecb1ea768a5472f16e1f2c3ba0e9 |
|
BLAKE2b-256 | 6d0d8faaaf9b5c47d8edd548de33445563098320acb1c08d447ffef34dcd0833 |