strct


Namestrct JSON
Version 0.0.34 PyPI version JSON
download
home_pagehttps://github.com/shaypal5/strct
SummaryA small pure-python package for data structure relatedutility functions.
upload_time2024-05-02 12:56:57
maintainerNone
docs_urlNone
authorShay Palachy Affek
requires_python>=3.8
licenseMIT
keywords python list dict set sortedlist
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            strct
#####
|PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|

A small pure-python package for data structure related utility functions.

.. code-block:: python

  from strct.dict import get_nested_val

  >>> dict_obj = {'a': {'b': 7}}
  >>> get_nested_val(('a', 'b'), dict_obj)
  7

.. contents::

.. section-numbering::


Installation
============

Install ``strct`` with:

.. code-block:: bash

  pip install strct


Use
===

``strct`` is divided into five sub-modules:

dicts
-----

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


lists
-----

Index and element shifts that preserve order.


sets
----

Operations on sets:

- Getting a set element by a priority list.


sortedlists
-----------

Operations on ``sortedcontainers.SortedList`` objects.

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.


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.

Installing for development
--------------------------

Clone:

.. code-block:: bash

  git clone git@github.com:shaypal5/strct.git


Install in development mode with test dependencies:

.. code-block:: bash

  cd strct
  pip install -e ".[test]"


Running the tests
-----------------

To run the tests, use:

.. code-block:: bash

  python -m pytest --cov=strct --doctest-modules


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`_.

.. _`numpy docstring conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
.. _`these conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt


Credits
=======
Created by Shay Palachy  (shay.palachy@gmail.com).

.. |PyPI-Status| image:: https://img.shields.io/pypi/v/strct.svg
  :target: https://pypi.python.org/pypi/strct

.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/strct.svg
   :target: https://pypi.python.org/pypi/strct

.. |Build-Status| image:: https://github.com/shaypal5/strct/actions/workflows/test.yml/badge.svg
  :target: https://github.com/shaypal5/strct/actions/workflows/test.yml

.. |LICENCE| image:: https://img.shields.io/badge/License-MIT-yellow.svg
  :target: https://pypi.python.org/pypi/strct

.. |Codecov| image:: https://codecov.io/github/shaypal5/strct/coverage.svg?branch=master
   :target: https://codecov.io/github/shaypal5/strct?branch=master

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shaypal5/strct",
    "name": "strct",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, list, dict, set, sortedlist",
    "author": "Shay Palachy Affek",
    "author_email": "shaypal5@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b1/19/a249a8682b1b62afd78fd53d19a1c88f8b4552d5fea74932170b7ea226d7/strct-0.0.34.tar.gz",
    "platform": "any",
    "description": "strct\n#####\n|PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|\n\nA small pure-python package for data structure related utility functions.\n\n.. code-block:: python\n\n  from strct.dict import get_nested_val\n\n  >>> dict_obj = {'a': {'b': 7}}\n  >>> get_nested_val(('a', 'b'), dict_obj)\n  7\n\n.. contents::\n\n.. section-numbering::\n\n\nInstallation\n============\n\nInstall ``strct`` with:\n\n.. code-block:: bash\n\n  pip install strct\n\n\nUse\n===\n\n``strct`` is divided into five sub-modules:\n\ndicts\n-----\n\nGetting values from nested dicts in various ways; operations on number-valued dicts; merging, normalizing, reversing and printing dicts (nicely)\n\n\nlists\n-----\n\nIndex and element shifts that preserve order.\n\n\nsets\n----\n\nOperations on sets:\n\n- Getting a set element by a priority list.\n\n\nsortedlists\n-----------\n\nOperations on ``sortedcontainers.SortedList`` objects.\n\nhash\n----\n\nProvide 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.\n\n\nContributing\n============\n\nPackage 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.\n\nInstalling for development\n--------------------------\n\nClone:\n\n.. code-block:: bash\n\n  git clone git@github.com:shaypal5/strct.git\n\n\nInstall in development mode with test dependencies:\n\n.. code-block:: bash\n\n  cd strct\n  pip install -e \".[test]\"\n\n\nRunning the tests\n-----------------\n\nTo run the tests, use:\n\n.. code-block:: bash\n\n  python -m pytest --cov=strct --doctest-modules\n\n\nAdding documentation\n--------------------\n\nThis 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`_.\n\n.. _`numpy docstring conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt\n.. _`these conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt\n\n\nCredits\n=======\nCreated by Shay Palachy  (shay.palachy@gmail.com).\n\n.. |PyPI-Status| image:: https://img.shields.io/pypi/v/strct.svg\n  :target: https://pypi.python.org/pypi/strct\n\n.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/strct.svg\n   :target: https://pypi.python.org/pypi/strct\n\n.. |Build-Status| image:: https://github.com/shaypal5/strct/actions/workflows/test.yml/badge.svg\n  :target: https://github.com/shaypal5/strct/actions/workflows/test.yml\n\n.. |LICENCE| image:: https://img.shields.io/badge/License-MIT-yellow.svg\n  :target: https://pypi.python.org/pypi/strct\n\n.. |Codecov| image:: https://codecov.io/github/shaypal5/strct/coverage.svg?branch=master\n   :target: https://codecov.io/github/shaypal5/strct?branch=master\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small pure-python package for data structure relatedutility functions.",
    "version": "0.0.34",
    "project_urls": {
        "Homepage": "https://github.com/shaypal5/strct"
    },
    "split_keywords": [
        "python",
        " list",
        " dict",
        " set",
        " sortedlist"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "806cd8dbd24f13b7a1f2117fa23a078e762f0e8b50b164cb789f3fbd4be6d9a4",
                "md5": "29c367fea838b22019383ccbc508a024",
                "sha256": "462d04408b77b33388d2f4f71378b5a54ffe9b85e8ac4df4f887cdfba1f563fc"
            },
            "downloads": -1,
            "filename": "strct-0.0.34-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "29c367fea838b22019383ccbc508a024",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15138,
            "upload_time": "2024-05-02T12:56:55",
            "upload_time_iso_8601": "2024-05-02T12:56:55.340537Z",
            "url": "https://files.pythonhosted.org/packages/80/6c/d8dbd24f13b7a1f2117fa23a078e762f0e8b50b164cb789f3fbd4be6d9a4/strct-0.0.34-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b119a249a8682b1b62afd78fd53d19a1c88f8b4552d5fea74932170b7ea226d7",
                "md5": "86cba9a74c943f9ff150b260f2035ac8",
                "sha256": "c46d38628e442de341601958bc3fb9d7fa2adba4131bdecdf76c20d7079fe885"
            },
            "downloads": -1,
            "filename": "strct-0.0.34.tar.gz",
            "has_sig": false,
            "md5_digest": "86cba9a74c943f9ff150b260f2035ac8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 15156,
            "upload_time": "2024-05-02T12:56:57",
            "upload_time_iso_8601": "2024-05-02T12:56:57.131265Z",
            "url": "https://files.pythonhosted.org/packages/b1/19/a249a8682b1b62afd78fd53d19a1c88f8b4552d5fea74932170b7ea226d7/strct-0.0.34.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 12:56:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shaypal5",
    "github_project": "strct",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "strct"
}
        
Elapsed time: 0.25220s