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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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