C extension module for common data structures
Project description
Structura is a Python library that provides data structures that are implemented in C for better performance. Its main purpose is to provide a simple and easy interface for data structures. The name comes from the Latin word structura which means structure.
Installation
From The Python Package Index
pip install structura
General Information
Source code: https://github.com/sekomer/structura
Documentation: https://github.com/Sekomer/structura/tree/main/docs
Issue tracker: https://github.com/sekomer/structura/issues
Using Structura
Structura API follows the pythonic way of doing things. It has a simple and straightforward interface. Its works with any type of data and python objects. Heres a quick example of how to use it with RingBuffer data structure.
from structura import RingBuffer
buffer = RingBuffer(capacity=3)
buffer.enqueue(0) # [0]
buffer.enqueue(1) # [0, 1]
buffer.enqueue(2) # [0, 1, 2]
buffer.enqueue(3) # [1, 2, 3]
buffer.is_full() # True
buffer.peek() # 1
a = buffer.dequeue() # [2, 3]
b = buffer.dequeue() # [3]
c = buffer.dequeue() # []
print(a, b, c) # 1 2 3
for i in range(3):
buffer.enqueue(i)
buffer.clear() # []
buffer.is_empty() # True
Detailed documentation and examples can be found in the docs folder
Build Instructions
To build structura from source, you should clone the repo and run the following command
sudo python3 setup.py install
What’s New
- 0.1.2
RingBuffer
- 0.2.0
Stack
LinkedList
- 0.2.1
Bug fixes
Documentation
- 3.0.0
Queue
HashMap
PriorityQueue
Bug fixes
What’s Coming
Trees, Ropes, Graphs, iterables.
Contributing
All contributions, suggestions, and optimization ideas are welcome!
Proposals for enhancement
You can create an issue or mail me at a.serkanaksoz@gmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file structura-0.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structura-0.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 17.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2c9a53ca852964208180c4f6116b2f1ff8f421294e87d9b7eadd44e894cff19
|
|
| MD5 |
cfd222e1456d49a88042a63059cc872c
|
|
| BLAKE2b-256 |
e9454b9a54a6b3893226d8bfb9a45f1979ce3f441eadfeb5355f4367be62e778
|
File details
Details for the file structura-0.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structura-0.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 17.4 kB
- Tags: CPython 3.10, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3ce04b20e771987fa81b0b3cafebed2b136be45aa8d501abb0d58edaf786935
|
|
| MD5 |
06850be5e912531899f93a076ccddf89
|
|
| BLAKE2b-256 |
ab2b1f9ecd66d8e1318ee44b51f21ca2fd36ce6e6a41bf02421cbb510ad95906
|
File details
Details for the file structura-0.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structura-0.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 17.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d067bd407f473fd0319e370e4f61425cb5fb3f60ae715a244ecf6f34b60ce726
|
|
| MD5 |
8358caa9a7d41319a6fda1fe49b890c2
|
|
| BLAKE2b-256 |
81dcd1a8a99c18e4c4b9ef54e65adebb479ce55d1e7975f110c45d29abf2e355
|
File details
Details for the file structura-0.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structura-0.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 48.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34384bcdddede03ca384cf510af6b05a01723a2a6ee3dddb1b12f6278e9bf11d
|
|
| MD5 |
c9c7391a8e4a47d6e571ddc58a3556bc
|
|
| BLAKE2b-256 |
37aeee821a7a6551a6ca4abe303e598ea56b9d9714549e96c87f5de67fe62c1e
|
File details
Details for the file structura-0.3.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structura-0.3.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 48.5 kB
- Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ee7dfda9be53463b23f4b0ac05b428b51899a51e1d54a3e86d4019a31f08864
|
|
| MD5 |
cef1e398c34efdbb5a920c07bf0fb2d4
|
|
| BLAKE2b-256 |
cc8e0a7e55d7b86d23b5c5be19d8e244df43dc2d282e957fe9bcb880cbdf35ba
|
File details
Details for the file structura-0.3.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structura-0.3.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 47.6 kB
- Tags: CPython 3.6m, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3928dd1ef28fa2a38c35bde519fc4d6d6fadefee52344e93681771ff0e167055
|
|
| MD5 |
421d7ccf3104189bc5f4f4a8eb89353b
|
|
| BLAKE2b-256 |
8cd69c9a19fdfc5174be0643965ef07469122b38fdcd4eb680c06e4cb5df6ab2
|