Skip to main content

test codecov pypi Python version license: GPL v3

arXiv API documentation Manual

hdict { A unique data structure }

Website | Latest Release | Current Code | API Documentation

Please see the website for more detailed usage information.

Overview

Shortly: A data structure based on a novel identification paradigm useful for frictionless computing, experiments, distributed data, among others.

Formally: Hosh-based cacheable lazy dict with predictable/deterministic universally (probabilistically guaranteed) unique identifiers.

Context

The concept

hdict is like an ordinary dict with str keys. Each entry, called field, and the hdict itself, are identified by 40-digit hashes (see hosh). A hdict object (say d) provides two extra entries: _id (identifier) and _ids (value identifiers), accessible through square brackets or through the shortcuts d.id and d.ids.

hdict creation

from hdict import hdict

# From named arguments.
d = hdict(x=5, y=7, z=10)

# From a dict object.
d = hdict({"x": 5, "y": 7, "z": 10})

# From an empty 'hdict' object.
d = hdict() >> {"x": 5} >> {"y": 7, "z": 10}

# All three options have the same result.
d.show(colored=False)
"""
{
    x: 5,
    y: 7,
    z: 10,
    _id: "BN-3Q3Z.2Q.9nsbIYnOI75HT7xhgjvF6wErwBPTn",
    _ids: {
        x: "ecvgo-CBPi7wRWIxNzuo1HgHQCbdvR058xi6zmr2",
        y: "eJCW9jGsdZTD6-AD9opKwjPIOWZ4R.T0CG2kdyzf",
        z: "u-Yykj2nDtKaUMGzfqScX5Y14qC7eqJrO7lXrJ1m"
    }
}
"""
from hosh import setup

# For better integration within the documentation, we change the color theme.
setup(dark_theme=False)

d.show(colored=False)

"""
{
    x: 5,
    y: 7,
    z: 10,
    _id: "BN-3Q3Z.2Q.9nsbIYnOI75HT7xhgjvF6wErwBPTn",
    _ids: {
        x: "ecvgo-CBPi7wRWIxNzuo1HgHQCbdvR058xi6zmr2",
        y: "eJCW9jGsdZTD6-AD9opKwjPIOWZ4R.T0CG2kdyzf",
        z: "u-Yykj2nDtKaUMGzfqScX5Y14qC7eqJrO7lXrJ1m"
    }
}
"""

A field contains a value or a function application. A field pointing to an application is only evaluated on demand, i.e., lazily.

Please refer to our website for more examples.

Installation

...as a standalone lib

# Set up a virtualenv. 
python3 -m venv venv
source venv/bin/activate

# Install from PyPI...
pip install --upgrade pip
pip install -U hdict

# use the flag 'full' for extra functionality (recommended if working with persistence or some special values like DataFrames)
pip install -U hdict[full]

# ...or, install from updated source code.
pip install git+https://github.com/davips/hdict

...from source

git clone https://github.com/davips/hdict
cd hdict
poetry install

# use the flag 'full' for extra functionality (recommended if working with persistence or some special values like DataFrames)  
poetry install -E full

Examples

Please refer to our website for examples.

Development

Licensing

The initial license choosen is GPL. Please contact the developer for other licensing needs.

Versioning

The version is a has a meaningful calendar component (minor=yymmdd), but it is still compatible with semantic versioning. For instance, the version 0.230215.1 means major=0, minor=230215, micro/patch=1. Notes:

  • While major=0, some compatibility breaking changes may occur.
  • From major=1 onwards, compatibility breaking changes increment it, and update the minor version to reflect the release date.
  • New (non breaking) features update only the minor version to reflect the release date.
  • Bug fixes (including breaking ones) increment only the micro version.

Contributing

Collaboration

We have ongoing research applying this tool to machine learning and clinical academic experiments. Although, the scope of application is broad as it encompasses software development in general. Feel free to contact us if you are interested in the project/concept or have a suggestion/interesting problem to be solved.

Donation

Currently there are no established forms of donation. Expenses:

  • Programming hours
  • Support
  • Custom features
  • Domain name maintenance yearly costs

Acknowledgement

This work was based on a previous research supported by Fapesp under supervision of Prof. André C. P. L. F. de Carvalho at CEPID-CeMEAI (Grants 2013/07375-0 – 2019/01735-0) until 2021-03-31.

We would like to thank the providers of free tools that make this project feasible:

  • github for hosting the code repository freely
  • Oracle for hosting the website freely
  • Developers of Mint, XFCE, and GNU/Linux for the operating system
  • JetBrains for Intellij IDEA Community Edition
  • Developers of Python packages listed in our project.toml

Metadata

Release files for hdict 0.230205.1

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

Source distribution (sdist)

Source distribution for hdict 0.230205.1
File Size Uploaded Provenance Actions
hdict-0.230205.1.tar.gz 43.1 kB Without provenance Details for hdict-0.230205.1.tar.gz

Built distribution (wheel)

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

Total release size: 101.4 kB

Release files / hdict-0.230205.1.tar.gz

Download URL hdict-0.230205.1.tar.gz
Size 43.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8029bce364a8082ee6155321ea96100051a14fbfaf56dbadac29e14219a1d639
BLAKE2b-256 checksum
How to use checksums
6f9c0645668b3213dd3082394a96f891522d314ab730e87be8cd445a89e3d6c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-58-generic

Release files / hdict-0.230205.1-py3-none-any.whl

Download URL hdict-0.230205.1-py3-none-any.whl
Size 58.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b2fe95e5418aa8d8446b179b3e337115f77da6f0bb51f10bdd2d50607cc73f5
BLAKE2b-256 checksum
How to use checksums
a7669e550ede44665af11bea83ffe98998d02865e8f9ba2ba99cc8b084248e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-58-generic

Security for hdict 0.230205.1

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