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 .

If published on PyPI, users will be able to 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.0.tar.gz (32.9 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.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylenza-0.1.0.tar.gz
  • Upload date:
  • Size: 32.9 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.0.tar.gz
Algorithm Hash digest
SHA256 d4fef15e4ed8ca2526a51f26a799f309c19f76c08ea364b2a39180c34ca2ce1d
MD5 25f2792e497c85396fc2c94a050b2d25
BLAKE2b-256 64ae95759fd11a7cdfa06cd6aacd9246e22004df63ed28ffca7c80d731fe63c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylenza-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a52bb521f87834020789457a92534ac56a6b6c15663b13417bcdc74ffabc131
MD5 60c2335b41da2b978211d4df2a542f84
BLAKE2b-256 a427e97eda54ac2f9452e9cdc3ddfaa7d4b5f43c7b9d2ff806f0c3e17379ab8e

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