Skip to content

python

Python Type Checking Tools: mypy vs. pyright vs. pydantic vs. pandera vs. jaxtyping vs. check_shapes vs. typeguard

Introduction

Are you tired of runtime type errors that could have been caught earlier? Do you work with numerical computing, data science, or ML workflows where shape mismatches cause mysterious bugs?

python-code-carbon

The Python ecosystem offers a rich variety of type checking tools, from traditional static type checkers to modern runtime validation libraries and specialized shape checkers for scientific computing.

This comprehensive guide explores the landscape of Python type checking tools, helping you choose the right combination for your specific needs.

Generating API Documentation for Your Python Package with Sphinx-apidoc

Introduction

In this guide, we will explore how to generate API documentation for your Python package using Sphinx-apidoc. Effective documentation is crucial for understanding, maintaining, and collaborating on software projects. Sphinx-apidoc is a tool that automates the process of creating documentation from docstrings within your Python codebase. Let's dive into the steps required to set up and utilize this tool effectively.

Publishing Your Python Project with Poetry

Are you ready to share your Python project with the world and make it accessible to users and developers alike?

Publishing your work not only showcases your creation but also enables others to benefit from and contribute to your project. Discover the simplest way to publish Python projects using Poetry, a powerful dependency management and packaging tool.

In this guide, we'll walk you through setting up your project with Poetry and publishing it on both test.pypi and production PyPI.

Get ready to make your project accessible for testing and distribution. Let's get started!

Integrating Requirements.txt with Poetry

Managing dependencies is a crucial aspect of any software project. Whether you're starting a new project or inheriting an existing one, handling dependencies effectively can greatly impact your workflow. Often, projects utilize a requirements.txt file to specify their dependencies, but when it comes to Python projects, integrating these dependencies seamlessly with a package manager like Poetry can streamline the process.

So, when working with Poetry, you might need to integrate your existing requirements.txt file into your project so you can improve reusability and publishing. This document outlines how to achieve that efficiently.

Exploring Python Code Formatters and Linters: black vs. flake8 vs. isort vs. autopep8 vs. yapf vs. pylint vs. ruff and more

Introduction

Are you struggling to maintain consistent formatting in your Python code? Do you find yourself spending too much time organizing imports or adjusting code style manually?

python-code-carbon

Navigating the landscape of Python code formatters and linters can be overwhelming, especially for beginners.

This guide serves as your roadmap to mastering Python code formatters and linters, simplifying the process and providing practical examples for effective code formatting, organization, and analysis.

Logging for Deployment in Python: A Practical Guide to Effective Debugging and Monitoring

Introduction

Are you still using print() statements for debugging in Python? Upgrade your logging game with Python's built-in logging module or the Loguru library!

If you're tired of scattered print statements cluttering your codebase, it's time to embrace the power of logging in Python. Whether you're a beginner or an experienced developer, mastering logging techniques is essential for effective debugging, monitoring, and troubleshooting of your Python applications.

logging-demo

Logging in Python allows you to set different levels of logging, such as DEBUG, INFO, WARNING, ERROR, and CRITICAL. With these levels, you can control the verbosity of log messages and focus on the information relevant to your current task.

Managing Python Projects with Poetry

python-poetry

Poetry simplifies Python project management and dependency handling. It's beginner-friendly and offers advantages like streamlined dependency management, integrated virtual environments, and simplified workflow. Give it a try to experience efficient Python development.

Follow these steps to initialize, add dependencies, and manage your project effortlessly:

1. Install Poetry

If Poetry is not installed, use the following command:

pip install poetry

Evolution of a Project: From Python Apps to a Web Interface

How a solo coder turned a repo full of data scripts into a full-stack web app with beautiful interface in one day ?

In the world of development, projects tend to evolve, morphing and reshaping themselves to meet ever-changing needs and preferences. What starts as a collection of Python applications can transform into something entirely different—a cohesive web interface with a backend to match.

This evolution was made possible by harnessing a comprehensive tech stack, blending various cutting-edge technologies:

  • Python: Served as the foundational language for backend logic and functionality.
  • FastAPI: Empowered the backend with rapid server capabilities and smooth API integration.
  • Next.js: Spearheaded the frontend development, providing dynamic and responsive user interfaces.
  • Prisma: Efficiently managed databases, optimizing data operations and queries.
  • Clerk: Handled authentication and user management, ensuring secure and streamlined user experiences.
  • Docker: Ensured modern development practices and facilitated seamless execution across various environments.

Pathlib Tutorial: Transitioning to Simplified File and Directory Handling in Python

Introduction

Are you still using import os for file handling after 2020 ? Use pathlib instead !

If you're moving away from command line operations or 'os' module to Python's pathlib, you're at the right place.

Well, in this tutorial, we'll dive into the powerful pathlib module in Python. It offers a clean transition for users accustomed to CLI or 'os' for file and directory handling, providing an elegant and intuitive approach.