Metadata-Version: 2.1
Name: datasifter
Version: 0.0.3
Summary: A module that simplifies working with conditions through filtering. For example: determining whether a text is a link
License: LICENSE
Author: Rekoni
Author-email: nilka.gacha@gmail.com
Requires-Python: >3.9
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

# What's new in 0.0.3?
+ Added license (Read in file "LICENSE")
+ Fixed bug with incorrect version of module "typing"


# DataSifter - Add filters to your code

With the DataSifter module, you can use filters for your conditions in your code.

## Without using DataSifter:
```python
import re

text = "Hello Python!"

if bool(re.match(r"^((https?|ftp|file)://)?(www\.)?([-A-Za-z0-9+&@#/%?=~_|!:,.;]*)$", text, re.IGNORECASE)):
    print("Text is link")
else:
    print("Text isn't link")
```

👎 **Why** write long RegExp patterns, if you can:

## Using DataSifter:
```python
import DataSifter as ds

text = "pypi.org"

if ds.is_url(text):
    print("Text is link")
else:
    print("Text isn't link)
```

# All possible filters and what is specified in them:
```python
is_url(
    text: str
) -> bool

contains(
    text: str,
    what_contains: str | dict
) -> bool

regexp_matches(
    text: str,
    pattern: str,
    ignore_case: bool = True
) -> bool

in_range(
    value: int,
    minimum: int,
    maximum: int
) -> bool

length(
    value: str | int,
    length: int
) -> bool

length_is(
    value: str | int,
    length: int,
    condition: str #(Constant from Module)
) -> bool
```

# Constants
```
1. EQUALS (==)
2. LOWER (<)
3. GREATER (>)
4. LOWER_OR_EQUALS (<=)
5. GREATER_OR_EQUALS (>=)
6. NOT_EQUALS (!=)
```

# Example of work with constants:
```python
import DataSifter as ds

text = "Hello Python!"

if ds.length_is(text, 5, GREATER_OR_EQUALS):
    print("Text greater or equals then 5")
else:
    print("Text lower then 5")
```

