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
File details
Details for the file isNullOrEmpty-1.0.0.tar.gz
.
File metadata
- Download URL: isNullOrEmpty-1.0.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41d7eb42889fb5acd8eaf6c542a94133b320b262a59cf0f38e03d3ce09f0a309 |
|
MD5 | 08d67cac056c0eef0ac4be0e2bd42d70 |
|
BLAKE2b-256 | 1c7fe9b50686210dc859eef0eaa9e32859fb29b7a409572687141420e532b029 |
File details
Details for the file isNullOrEmpty-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: isNullOrEmpty-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c8e0176f9645f5b148aa19ffc40d0dabde63c7848dbf7f2ff828949aadf7cb |
|
MD5 | 35a1472279a54c5b82ef7f4562abe248 |
|
BLAKE2b-256 | 8ebaf3ace8653df65fed0ba99b1a193f200f46c3af0fcdd2041af30ac54943b1 |