Skip to content

This is my Python practice sessions, using functional and OOP paradigms with mypy and pytest.

Notifications You must be signed in to change notification settings

Kinetics20/Python_practice_sessions_05

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Practice Sessions

Python Notebook mypy pytest uv PyCharm

About the Repository

This repository is dedicated to my Python programming practice. It contains programs written in both functional and object-oriented paradigms. I explore various techniques, including:

  • Static typing (mypy)
  • Unit testing (pytest)
  • Working with notebooks (Jupyter Notebook)
  • Managing dependencies using uv

uv

An extremely fast Python package and project manager, written in Rust.

uv Benchmark

Highlights

  • 🚀 A single tool to replace pip, pip-tools, pipx, poetry, pyenv, twine, virtualenv, and more.
  • ⚡️ 10-100x faster than pip.
  • 🐍 Installs and manages Python versions.
  • 🛠️ Runs and installs Python applications.
  • ❇️ Runs scripts, with support for inline dependency metadata.
  • 🗂️ Provides comprehensive project management, with a universal lockfile.
  • 🔩 Includes a pip-compatible interface for a performance boost with a familiar CLI.
  • 🏢 Supports Cargo-style workspaces for scalable projects.
  • 💾 Disk-space efficient, with a global cache for dependency deduplication.
  • ⏬ Installable without Rust or Python via curl or pip.
  • 🖥️ Supports macOS, Linux, and Windows.

uv is backed by Astral, the creators of Ruff.

About the Repository

This repository is dedicated to my Python programming practice. It contains programs written in both functional and object-oriented paradigms. I explore various techniques, including:

  • Static typing (mypy)
  • Unit testing (pytest)
  • Working with notebooks (Jupyter Notebook)
  • Managing dependencies using uv
  • Object-Oriented Programming (OOP) concepts:
    • Classes
    • Inheritance
    • Decorators
    • Logging
    • Abstract classes
    • Exceptions
    • Context managers

Repository Structure

  • Functional Programming
    Programs written following the principles of functional programming.
  • Object-Oriented Programming
    Projects based on object-oriented programming using classes and methods.
  • Tests and Typing
    Contains unit tests and code with static typing.
  • Jupyter Notebooks
    Interactive notebooks with experiments and analyses.

How to Run?

  1. Install uv (a recommended way to manage Python tools):

    pipx install uv

For Linux and macOS, determine your shell (e.g., with echo $SHELL), then run one of:

# For Bash
echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc

# For Zsh
echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc

To enable shell autocompletion for uvx:

For Linux and macOS, determine your shell (e.g., with echo $SHELL), then run one of:

# For Bash
echo 'eval "$(uvx --generate-shell-completion bash)"' >> ~/.bashrc

# For Zsh
echo 'eval "$(uvx --generate-shell-completion zsh)"' >> ~/.zshrc
  1. Activate uv for for project :

    uv init
  2. Install dependencies :

    uv add mypy ruff pytest --dev 
  3. Active venv :

    source .venv/bin/activate

🧑‍💻 Author

Piotr Lipiński

Feel free to contribute, submit issues, or ask questions! 😊