Releases: AnshMNSoni/PythonSTL
pythonstl v0.1.0 - Initial Public Release
We are excited to announce the first public release of pythonstl - a C++ STL-style container library for Python, built using the Facade Design Pattern.
This release introduces a structured, STL-compliant API layer on top of Python, designed for:
- C++ developers transitioning to Python
- DSA learners
- Competitive programming practice
- Educational use cases
Installation
pip install pythonstlPyPI: https://pypi.org/project/pythonstl/
Features
STL-Style Containers
vectorstackqueuestl_setstl_mappriority_queue
All containers maintain C++ STL naming conventions such as:
push()pop()top()insert()erase()empty()size()
🔁 Iterator Support
begin()end()rbegin()rend()- Python-native iteration (
for x in container)
Python Integration
Supports Python magic methods:
len(container)if container:value in container==comparisonscopy()anddeepcopy()
Vector Enhancements
reserve()shrink_to_fit()- Capacity management similar to C++
std::vector
Architecture
- Facade Design Pattern
- Strict encapsulation
- Private implementation layer
- Clean separation of concerns
- Type hints throughout
- Fully test-covered
Modern Packaging
- PEP 517 compliant (
pyproject.toml) - Python 3.10+
- CI/CD via GitHub Actions
- Benchmarks included
Complexity Overview
| Container | Operation | Complexity |
|---|---|---|
| Stack | push/pop | O(1) |
| Queue | push/pop | O(1) |
| Vector | push_back | O(1) amortized |
| Set / Map | insert/find | O(1) average |
| Priority Queue | push/pop | O(log n) |
Thread Safety
Containers are not thread-safe by default.
Users must apply their own synchronization in multi-threaded environments.
Project Vision
pythonstl is not meant to replace Python built-ins.
Instead, it provides:
A familiar STL experience in Python — without losing Python’s ecosystem power.
Roadmap
Planned future enhancements:
dequelist(doubly linked list)multisetmultimap- STL-style algorithms module
Thank you for checking out pythonstl.
Feedback, issues, and contributions are welcome!