Skip to content

Releases: AnshMNSoni/PythonSTL

pythonstl v0.1.0 - Initial Public Release

11 Feb 16:30
79fb400

Choose a tag to compare

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 pythonstl

PyPI: https://pypi.org/project/pythonstl/


Features

STL-Style Containers

  • vector
  • stack
  • queue
  • stl_set
  • stl_map
  • priority_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
  • == comparisons
  • copy() and deepcopy()

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:

  • deque
  • list (doubly linked list)
  • multiset
  • multimap
  • STL-style algorithms module

Thank you for checking out pythonstl.

Feedback, issues, and contributions are welcome!