Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/informatter/lookup
A custom hashtable implementation in python
https://github.com/informatter/lookup
data-structures hashtable python3
Last synced: about 2 months ago
JSON representation
A custom hashtable implementation in python
- Host: GitHub
- URL: https://github.com/informatter/lookup
- Owner: informatter
- License: mit
- Created: 2024-04-25T11:07:46.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-09-08T12:09:25.000Z (4 months ago)
- Last Synced: 2024-09-08T13:33:58.090Z (4 months ago)
- Topics: data-structures, hashtable, python3
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lookup ๐
Custom Hash table implementation in Python ๐ just for fun, but also to understand a little deeper the different types of implementations that can be done for
resizing and collision handling ๐ค Who knows, perhaps I will end up implementing a basic cache system which can be deployed in a cloud provider! lets see ๐คทIn the future I would also like to implement it in Golang as an excuse to start learning the language ๐
All the coding sessions will be recorded live ๐ฅ and uploaded to [nicodes](https://www.youtube.com/channel/UCKGZLR6ETz-Z3e1hzkuy2Ig)
## Initial Resources ๐
- https://en.wikipedia.org/wiki/Hash_function
- https://en.wikipedia.org/wiki/Hash_table
- **Collision handling - open addressing**
- https://github.com/aliaamohamedali/Algorithms/blob/master/introduction-to-algorithms-3rd-edition.pdf (Chapter 11 Hash tables)
- https://courses.csail.mit.edu/6.006/fall11/lectures/lecture10.pdf
- https://webdocs.cs.ualberta.ca/~holte/T26/open-addr.html
- https://en.m.wikipedia.org/wiki/Linear_probing
- https://en.m.wikipedia.org/wiki/Quadratic_probing
- https://en.m.wikipedia.org/wiki/Double_hashing## Install dependencies
The only dependency used is **pytest**
`pip install -r requirements.txt`
## Tests ๐งช
**Activate virtual environment**
Windows ๐ช
`env/scripts/activate.ps1`
macOS ๐ / Linux ๐ง
`source env/bin/activate`
**Run tests**
To run all unit tests:
- `pytest` to include print statements : `pytest -s`To run a specific test:
- `pytest tests/test_lookup.py::test_resize_up`Stress test:
- `python main.py`## TODO
- Turn in to cache?
- API?
- CLI client?
- How does it handle concurrency?
- Make a Go version