Skip to main content

PyPI-Status PyPI-Versions Build-Status Codecov LICENCE

A small pure-python package for data structure 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 five sub-modules:

2.1 dicts

Getting values from nested dicts in various ways; operations on number-valued dicts; merging, normalizing, reversing and printing dicts (nicely)

2.2 lists

Index and element shifts that preserve order.

2.3 sets

Operations on sets:

  • Getting a set element by a priority list.

2.4 sortedlists

Operations on sortedcontainers.SortedList objects.

2.5 hash

Provide cross-kernel stable hash functions that work for built-in data structures and types, and for any custom data structure complying with the iterable or dict schemes.

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

Metadata

Release files for strct 0.0.35

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strct 0.0.35
File Size Uploaded Provenance Actions
strct-0.0.35.tar.gz 15.3 kB Without provenance Details for strct-0.0.35.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for strct 0.0.35
File Interpreter ABI Platform Actions
strct-0.0.35-py3-none-any.whl Python 3 none any Details for strct-0.0.35-py3-none-any.whl

Total release size: 30.5 kB

Release files / strct-0.0.35.tar.gz

Download URL strct-0.0.35.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
82ed6a7d4ab520f5eb1e75f059fb8eb1fb44cc2840e4ca97b48bd9080689c776
BLAKE2b-256 checksum
How to use checksums
cb10a46d5df5fda3cabf24a0ff4bb39ff1e2139e56df9a41aa1cde2388b1c037
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / strct-0.0.35-py3-none-any.whl

Download URL strct-0.0.35-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc56ba62268ee70bd375223f9f5ac6a1c586747df833472f9f261264fb0153df
BLAKE2b-256 checksum
How to use checksums
227126aa1a149faa20211af886b90c5134486aeaad0093b4f2c5dc82e9a2de8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Security for strct 0.0.35

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page