A simple Python package to check if an object is null or empty.
Project description
is_null_or_empty Package
The is_null_or_empty
package is a lightweight, versatile Python library designed to simplify and streamline the process of checking whether Python objects are None
or empty. It supports a wide range of data types, including strings, lists, dictionaries, and more, making nullity and emptiness checks more efficient and readable.
Key Features
- Multi-Type Support: Works seamlessly with strings, lists, dictionaries, and more.
- Simplicity: Provides a straightforward API that is easy to use in any project.
- Efficiency: Improves code readability by replacing multiple condition checks with a single, intuitive function call.
Installation
Install is_null_or_empty
quickly and easily using pip:
pip install is_null_or_empty
Usage
The is_null_or_empty function can be used to check if an object is None or if it's an empty container (like a string, list, or dictionary). Here are some examples demonstrating its usage:
from is_null_or_empty import is_null_or_empty
print(is_null_or_empty("")) # True
print(is_null_or_empty([])) # True
print(is_null_or_empty({})) # True
print(is_null_or_empty(None)) # True
print(is_null_or_empty("Some text")) # False
print(is_null_or_empty([1, 2, 3])) # False
As you can see, is_null_or_empty
will return True for empty strings, lists, dictionaries, or None objects, and False otherwise, helping you make your code cleaner and more concise.
License
is_null_or_empty
is licensed under the MIT License. Feel free to use it, modify it, and distribute it as you see fit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for isNullOrEmpty-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c8e0176f9645f5b148aa19ffc40d0dabde63c7848dbf7f2ff828949aadf7cb |
|
MD5 | 35a1472279a54c5b82ef7f4562abe248 |
|
BLAKE2b-256 | 8ebaf3ace8653df65fed0ba99b1a193f200f46c3af0fcdd2041af30ac54943b1 |