Python: How to extract only tables from raw HTML
Updated: Feb 14, 2024
Overview Extracting tables from raw HTML strings can be incredibly useful for data scientists, web developers, and anyone needing to parse and analyze web data. This tutorial will walk you through how to accomplish this task using......
Fixing Python NameError – name ‘List’ is not defined
Updated: Feb 14, 2024
Understanding the Issue Experiencing a NameError in Python, particularly one that mentions ‘List’ is not defined, can be a stumbling block for both newcomers and experienced developers alike. This error indicates the Python interpreter......
Python: Using Type Hints when Handling Exceptions with Try/Catch
Updated: Feb 14, 2024
Introduction Python’s type hinting system, introduced in PEP 484, has steadily gained traction for promoting code clarity and aiding in static analysis. While commonly used for variables and function return types, type hints can......
Python typing.Annotated examples
Updated: Feb 14, 2024
Introduction Type checking in Python serves as a syntax for declaring types of variables, function parameters, and return values. It helps in early detection of potential errors, makes code more understandable, and facilitates better......
Python: Search and download photos by keyword from Unsplash API
Updated: Feb 14, 2024
Overview Ever stumbled upon the perfect photo on Unsplash for your project or presentation but didn’t know how to automatically retrieve similar ones using code? In this guide, we’ll explore how to search and download......
Python: Add Type Annotations when Unpacking Tuples
Updated: Feb 14, 2024
Introduction In modern Python development, adding type annotations has become increasingly popular for enhancing code readability, maintainability, and leveraging static type checking tools like Mypy. Type annotations add a layer of......
Using TypeVar in modern Python: A practical guide
Updated: Feb 14, 2024
Overview Type variables in Python, introduced via the TypeVar function, are a significant part of the type hinting system that has been gradually integrated into Python since version 3.5. With the introduction of PEP 484, Python made a......
Recursive Types in Modern Python: A Practical Guide
Updated: Feb 14, 2024
Overview Recursive types allow for the definition of data structures that can recursively include instances of themselves. This concept is particularly useful in languages like Python, where the dynamic nature of the language provides......
Python: Using dependent types for input/return of function
Updated: Feb 14, 2024
Introduction In the expanding world of software development, type systems play a crucial role in defining the behavior of variables and functions. Recently, the concept of dependent types has been gaining traction, offering more......
Python: Using type hints with datetime and timestamp
Updated: Feb 14, 2024
Introduction Type hinting in Python is a great feature that came along with Python 3.5 through PEP 484. It allows programmers to explicitly declare the expected data types of function arguments and return values. While it does not......
Python: Using Faker to generate i18n random text
Updated: Feb 13, 2024
Introduction In this tutorial, we will dive deep into how to use Faker, a Python library, to generate internationalized (i18n) random text. Faker is a powerful tool for generating mock data, which is often needed for testing and......
Python + Faker: How to Set Min/Max Length for Random Text
Updated: Feb 13, 2024
Overview In the world of testing or data anonymization, generating random data is an everyday necessity. Python, with the Faker library, encompasses an incredibly versatile set of tools for these tasks. In this tutorial, we delve into......