A Python package for stack data structures and stack-based utilities
Project description
stackifier
A Python package for stack data structures and stack-based utilities.
Installation
pip install stackifier
Features
- Stack Data Structure: Full-featured stack implementation with push, pop, peek operations
- String Reversal: Reverse strings using a stack
- Bracket Matching: Check if brackets/parentheses are balanced
- Text Formatting: Create beautiful ASCII stack visualizations
Usage
Basic Hello Function
from stackifier import hi
print(hi("Bryan Lai"))
Stack Operations
from stackifier import Stack
stack = Stack()
stack.push(1)
stack.push(2)
stack.push(3)
print(stack)
print(f"Top element: {stack.peek()}")
print(f"Size: {stack.size()}")
print(f"Popped: {stack.pop()}")
String Reversal
from stackifier import reverse_string
text = "Hello, World!"
reversed_text = reverse_string(text)
print(reversed_text)
Bracket Matching
from stackifier import is_balanced
print(is_balanced("()[]{}"))
print(is_balanced("({[]})"))
print(is_balanced("([)]"))
ASCII Stack Visualization
from stackifier import create_ascii_stack
items = ["Python", "Java", "C++", "JavaScript"]
print(create_ascii_stack(items))
Text Formatting
from stackifier import stackify_text
print(stackify_text("Welcome to Stackifier!", width=40, char="="))
Build & Publish
- Install build tools:
python -m pip install build twine
- Build the package:
python -m build
- Upload to PyPI:
python -m twine upload dist/*
Test Locally
Before publishing, you can test locally:
pip install -e .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stackifier-0.1.0.tar.gz
(3.1 kB
view details)
Built Distribution
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 stackifier-0.1.0.tar.gz.
File metadata
- Download URL: stackifier-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46a717382a78235b63eb594e698ae953149f9d40ef0af70ba11dadd835b79a22
|
|
| MD5 |
46d8d4a9e2d5b783998b12771b1bb44d
|
|
| BLAKE2b-256 |
585df3272a43a7612a24d75450c089561cb13f9427cd53df1fd76487d37cc58b
|
File details
Details for the file stackifier-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stackifier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2715b880ac8a00d049daa375ab27237c64cfecd2f9ee1f760e635bc9579abd92
|
|
| MD5 |
d6265d6154ff2dc38c8c1011b958a3f6
|
|
| BLAKE2b-256 |
e41f12a2db4d7dfd7d028982a14678f90bfa23446b482978dc0689fdc354fc0b
|