is_empty
Python package to check whether a variable is empty or not.
Description
- The package has two functions named
empty()andnot_empty()which can check if a variable is empty or not. - The following values evaluate to empty:
- 0
- 0.0
- ""
- None
- False
- []
- ()
- {}
- set()
- b""
Installation
To install, write the following command in your terminal.
pip install is_empty
Examples
Import the functions to your code.
from is_empty import empty, not_empty
- Check whether a list is empty or not using empty().
#The function will return True in this case
items = []
if empty(items):
#Do something
else:
#Do something else
- Check whether a tuple is not empty using not_empty.
#The function will return True in this case
items = (1,2,3)
if not_empty(items):
#Do something
Author
Wahid Sadique Koly
License
This project is licensed under the MIT License - see the LICENSE file for details
Metadata
Release files for is-empty 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| is_empty-1.0.1.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| is_empty-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / is_empty-1.0.1.tar.gz
| Download URL | is_empty-1.0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0c11d84e91410021a01f20b1271927d641213fec00ab686d2ffcb9cfb8f55b2
|
|
BLAKE2b-256 checksum How to use checksums |
4b499ad078142caf40d11d357444f2211941cf78dafdfb8015fd1ea0716c8d0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / is_empty-1.0.1-py3-none-any.whl
| Download URL | is_empty-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2299257acca65ba0b7a7e5958474233d84b2af0655b12b1fd5631a28fb4e150
|
|
BLAKE2b-256 checksum How to use checksums |
608228109c4e627adaf92a154b9bab1e4df65638c450311a9574fb96017731d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|