Skip to main content

A beginner-friendly Python package for learning data structures, algorithms, recursion, and logic.

Project description

PyLenza

PyLenza is a beginner-friendly Python package for learning data structures, algorithms, recursion, and logical reasoning. It provides clean, well-documented teaching helpers and small, self-contained algorithms suitable for learners and interview prep.

Quick highlights

  • Lightweight, readable implementations for common data structures (arrays, linked lists, stacks, queues, trees).
  • Algorithm templates for search & sort plus algorithmic patterns and puzzles (N-Queens, Tower of Hanoi, Kadane, etc.).
  • Helpers for recursion, string manipulation, numeric operations and small utilities for learning.

Installation

The package is ready to publish; for local development you can install in editable mode:

python -m pip install -e .

install with:

pip install pylenza

Usage (copy-paste friendly)

from pylenza import PyArray

arr = PyArray([1, 2, 3, 4])
arr.append(5)
print(arr.mean())  # prints the mean

Modules (overview)

  • arrays — PyArray: list-like API + numeric, transform, search & sort helpers
  • linkedlist — Singly LinkedList with traversal, mutators and utilities
  • queue / stack — Teaching-friendly FIFO / LIFO containers with helpers
  • search / sort — Classic search and sorting implementations for learning
  • strings — String helpers (palindromes, parsing, substring utilities)
  • recursion / trees — Recursion exercises and BinaryTree / BST utilities
  • logic — patterns, puzzles, reasoning for algorithmic thinking

Examples & how to run

  • Examples are available in the examples/ folder. Each script is standalone and runnable:

    • python examples/array_examples.py
    • python examples/logic_examples.py
    • python examples/recursion_examples.py

    Publishing to PyPI

    There are two common ways to publish releases:

    1. Manual local publish (useful for quick releases):

      1. Create an API token on PyPI (Account → API tokens) and copy it.
      2. Either create a local ~/.pypirc following .pypirc.example (username token, password = token), or pass credentials directly to twine.
      3. Build and upload:
     python -m pip install --upgrade build twine
     python -m build  # produces dist/ wheel and sdist
     python -m twine upload dist/* --username __token__ --password ${PYPI_TOKEN}
    
    1. Automated CI publishing (recommended):

      • A GitHub Actions workflow is included at .github/workflows/publish.yml. It will:

        • run on pushed git tags that start with v (for example v0.1.0)
        • build wheel and sdist, then publish to PyPI via twine.
      • To enable it create a repository secret named PYPI_API_TOKEN with the token value (generated at https://pypi.org/manage/account/ ). Then push a tag:

     git tag v0.1.0
     git push origin v0.1.0
    

    Security note

    • Do NOT store PyPI tokens or credentials in source control. Use GitHub repository secrets for CI or ~/.pypirc locally.

License

This project is distributed under the MIT License.

Contributing

  • Pull requests and issues are welcome — keep contributions small and well-documented so they are easy to review.

Contact

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

pylenza-0.1.1.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylenza-0.1.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file pylenza-0.1.1.tar.gz.

File metadata

  • Download URL: pylenza-0.1.1.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pylenza-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0349359744a3faa9c853bef3304e21b99ee2a74164d68e8126316fef92447df9
MD5 5faf265c96aecf0101756781ef38f43c
BLAKE2b-256 9ea4c48b7e296faefdef633895f29201fcf71027ba070d8805759c50462479e1

See more details on using hashes here.

File details

Details for the file pylenza-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pylenza-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pylenza-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7809beff39942e39d553819510ef44310f5549e35f31c38b67ddad12ceb35190
MD5 f4db83e988562e4e07b8b13fa5ffbf2f
BLAKE2b-256 d4cd9b959daac8a725d8d28482bd20dec42388bcb06624e740a5a339616815a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page