Skip to main content

Python Version PyPI-Server Project generated with PyScaffold Documentation Status Coverage Status License

logo

🛞 mywheel

High-performance data structures and algorithms in Python

mywheel provides efficient implementations of fundamental data structures optimized for specific use cases in graph algorithms, EDA (Electronic Design Automation), and network optimization. All implementations prioritize memory efficiency and time complexity over Python's standard library alternatives.

🚀 Quick Start

Installation

pip install mywheel

Usage Examples

Doubly Linked List with O(1) Operations

from mywheel import Dllist, Dllink

# Create list
dlist = Dllist(0)  # sentinel node
dlist.append(Dllink("A"))
dlist.append(Dllink("B"))

# O(1) operations
node = dlist.popleft()  # Remove first
dlist.appendleft(Dllink("C"))  # Add to front

Bounded Priority Queue for Small Integer Keys

from mywheel import BPQueue, Dllink

# Efficient for keys in range [-5, 5]
bpq = BPQueue(-5, 5)

# Add items with integer keys
bpq.append(Dllink("task1"), 3)
bpq.append(Dllink("task2"), 5)

# Extract highest priority item
item = bpq.popleft()

Round-Robin Iteration

from mywheel import Robin

# Create 5-part cycle
robin = Robin(5)

# Iterate excluding starting position
for part in robin.exclude(2):
    print(part)  # Prints: 3, 4, 0, 1

Array-Like Utilities

from mywheel import MapAdapter

# Adapt list to dict-like interface
lst = [10, 20, 30, 40]
mapping = MapAdapter(lst)

mapping[0] = 99
assert mapping[0] == 99

📊 Performance Characteristics

Data Structure Insert Delete Lookup Memory Best For
Dllist O(1) O(1) N/A Minimal Frequent front/back operations
BPQueue O(1)* O(k) O(1) O(b-a) Small bounded integer keys
Robin O(n) N/A O(1) O(n) Round-robin scheduling
MapAdapter O(1) N/A O(1) O(n) Dict-like list access

* O(1) amortized for bounded keys

🎯 Used In

  • digraphx - Graph algorithms and data structures
  • netlistx - VLSI netlist partitioning
  • ckpttnpy - Multi-level circuit partitioning

✨ Features

  • Memory Efficient: Uses __slots__ and sentinel nodes to minimize overhead
  • Type Safe: Full type hints with mypy support
  • Well Tested: 100% coverage with pytest and hypothesis
  • Zero Dependencies: Pure Python, no external runtime dependencies
  • Python 3.8+: Supports all modern Python versions

🔧 Development

# Clone and install
git clone https://github.com/luk036/mywheel.git
cd mywheel
pip install -e ".[testing]"

# Run tests
pytest

# Run type checking
mypy src/mywheel

# Run linting
pre-commit run --all-files

See CONTRIBUTING.md for detailed guidelines.

👉 Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.

Metadata

Release files for mywheel 0.7

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

Source distribution (sdist)

Source distribution for mywheel 0.7
File Size Uploaded
mywheel-0.7.tar.gz 76.7 kB Details

Built distribution (wheel)

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

Total release size: 91.4 kB

Release files / mywheel-0.7.tar.gz

Download URL mywheel-0.7.tar.gz
Size 76.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8dd0de0bdc08ff9b17dd8b849b561b0e2c52b3aa7039d3927abef2e881f49ae9
BLAKE2b-256 checksum
How to use checksums
9710eb474b87c62f161786df9c7729f5dbfcd7d4a8bcf8d5ae4eda256ef5d25d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / mywheel-0.7-py3-none-any.whl

Download URL mywheel-0.7-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f0cc46641adc08e9105253ed812714bec20bafb28e30323eb5e7dc72f6e1761
BLAKE2b-256 checksum
How to use checksums
f77c8ad91ed57e46b38b582488c65a528cbca7761346ae88c172190846f97138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7 This release

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

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