Skip to main content

ifcollector

A framework for creating complex if statements.

pip3 install ifcollector

How to

With ifcollector, if statements can be created from lists. For complex if statements, stating all your conditionals in a list has the advantage of making code more readable and reuseable.

To use it, create a list with all the conditionals that will be evaluated against a single value. The conditionals can be a function, a boolean expression in the form of a string, or a lambda. For all boolean expressions and lamdas, the keyword value will be used for the variable being evaluated.

def matches_email_regex(value):
    match_object = search(r'^(\w|\.|\_|\-)+[@](\w|\_|\-|\.)+[.]\w{2,3}$',
                          value)
    return bool(match_object)

is_valid_gmail = [
    "len(value) > 5",
    "'@' in value",
    matches_email_regex,
    "'gmail.com' in value"
]

my_email = "jeff.gruenbaum@gmail.com"

if ifandstatement(my_email, *is_valid_gmail):
    print("The email is valid!")

Output: The email is valid!

Metadata

Release files for ifcollector 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ifcollector 0.0.1
File Size Uploaded Provenance
ifcollector-0.0.1.tar.gz 3.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ifcollector 0.0.1
File Interpreter ABI Platform
ifcollector-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.6 kB

Release files / ifcollector-0.0.1.tar.gz

Download URL ifcollector-0.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b0604ce3e09915079f6667a7eaf6204f3becc45e4ca6a3deafcfb2fadce10fde
BLAKE2b-256 checksum
How to use checksums
29e97c9fe54943d2c76c2ab7ea71e57d1d0d20d99d9372e317b907b48a7be6e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

Release files / ifcollector-0.0.1-py3-none-any.whl

Download URL ifcollector-0.0.1-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6391f3b5d047c2a3447a2b36695bca9f2acbbad67e017d91fa0ae8ffebb60d1
BLAKE2b-256 checksum
How to use checksums
3632fec0240ca0b53d505bccd494835c6a61237652bf779ca43edd5772fa8eb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

Security for ifcollector 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page