Skip to main content

Python package to check whether a variable is empty or not.

Project description

is_empty

Python package to check whether a variable is empty or not.

Description

  • The package has two functions named empty() and not_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

is_empty-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

is_empty-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file is_empty-1.0.1.tar.gz.

File metadata

  • Download URL: is_empty-1.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for is_empty-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f0c11d84e91410021a01f20b1271927d641213fec00ab686d2ffcb9cfb8f55b2
MD5 6cff7508dccdb7257a82a4ee490170a5
BLAKE2b-256 4b499ad078142caf40d11d357444f2211941cf78dafdfb8015fd1ea0716c8d0a

See more details on using hashes here.

File details

Details for the file is_empty-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: is_empty-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for is_empty-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2299257acca65ba0b7a7e5958474233d84b2af0655b12b1fd5631a28fb4e150
MD5 a6a7053c512f9082c59fd3de42089d2f
BLAKE2b-256 608228109c4e627adaf92a154b9bab1e4df65638c450311a9574fb96017731d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page