Skip to main content

Sophisticate Hashed Data Structures

Project description

hashall

PyPI version License: MIT

This library was created to use indexed data structures such as list, tuple, str, bytes, and bytearray with keys like those used in dict (hash table)

Installation

You can install hashall via pip:

pip install hashall

Usage

hlist

from hashall import hlist


x = hlist([1, 2, 3, 4, 5, 6])
print(x[3])
print(x[+3])
print(x["3"])
print(x["+3"])
print(x[-3])
print(x["-3"])
print(x["three"])
print(x["+three"])
print(x["-three"])

Output

4
4
4
4
4
4
4
4
4

htuple

from hashall import htuple


x = htuple([1, 2, 3, 4, 5, 6])
print(x[3])
print(x[+3])
print(x["3"])
print(x["+3"])
print(x[-3])
print(x["-3"])
print(x["three"])
print(x["+three"])
print(x["-three"])

Output

4
4
4
4
4
4
4
4
4

hstr

from hashall import hstr


x = hstr("hashall")
print(x[3])
print(x[+3])
print(x["3"])
print(x["+3"])
print(x[-4])
print(x["-4"])
print(x["three"])
print(x["+three"])
print(x["-four"])

Output

h
h
h
h
h
h
h
h
h

hbytes

from hashall import hbytes


x = hbytes(b"hashall")
print(x[3])
print(x[+3])
print(x["3"])
print(x["+3"])
print(x[-4])
print(x["-4"])
print(x["three"])
print(x["+three"])
print(x["-four"])

Output

104
104
104
104
104
104
104
104
104

hbytearray

from hashall import hbytearray


x = hbytearray(b"hashall")
print(x[3])
print(x[+3])
print(x["3"])
print(x["+3"])
print(x[-4])
print(x["-4"])
print(x["three"])
print(x["+three"])
print(x["-four"])

Output

104
104
104
104
104
104
104
104
104

Note

You can use all the methods you've been using with these data structures

License

This project is licensed under the MIT LICENSE - see the LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashall-1.0.2.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

hashall-1.0.2-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page