Skip to content

Commit 0083fcb

Browse files
committed
New date validators and filters
1 parent 28fb9f5 commit 0083fcb

File tree

85 files changed

+913
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+913
-191
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
**.md
22
.gitignore
3+
.git
34
.github
45
.idea
56
.vscode
7+
__pycache__

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
set -e # Exit immediately if a command exits with a non-zero status
3232
set -u # Exit immediately if a variable is not defined
3333
34-
docker run flask-inputfilter flake8
34+
docker run flask-inputfilter flake8

CHAGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
6+
## [0.0.6] - 2025-01-12
7+
8+
### Added
9+
10+
- New date validators and filters
11+
12+
### Changed
13+
14+
- Dropped support for Python 3.6
15+
16+
517
## [0.0.5] - 2025-01-12
618

719
### Added
@@ -11,3 +23,10 @@ All notable changes to this project will be documented in this file.
1123
### Changed
1224

1325
- Switched external_api config from dict to class. [Check it out](src/flask_inputfilter/Model/ExternalApiConfig.py)
26+
27+
28+
## [0.0.4] - 2025-01-09
29+
30+
### Added
31+
32+
- New external api functionality. [Check it out](EXTERNAL_API.md)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6-slim
1+
FROM python:3.7-slim
22

33
WORKDIR /app
44

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
autoflake
22
black
3-
flake8
4-
flask==0.10
3+
flake8==4.0.0
4+
flask==2.1
55
isort
6-
pillow==2.0.0
6+
pillow==8.0.0
77
pytest
8-
requests==2.12.0
8+
requests==2.22.0
99
setuptools
1010
twine

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="flask_inputfilter",
5-
version="0.0.5",
5+
version="0.0.6",
66
author="Leander Cain Slotosch",
77
author_email="[email protected]",
88
description="A library to filter and validate input data in"
@@ -13,14 +13,14 @@
1313
packages=find_packages(where="src"),
1414
package_dir={"": "src"},
1515
install_requires=[
16-
"Flask>=0.10",
17-
"pillow>=2.0.0",
18-
"requests>=2.12.0",
16+
"Flask>=2.1",
17+
"pillow>=8.0.0",
18+
"requests>=2.22.0",
1919
],
2020
classifiers=[
2121
"Programming Language :: Python :: 3",
2222
"License :: OSI Approved :: MIT License",
2323
"Operating System :: OS Independent",
2424
],
25-
python_requires=">=3.6",
25+
python_requires=">=3.7",
2626
)

src/flask_inputfilter/Condition/ArrayLengthEqualCondition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ class ArrayLengthEqualCondition(BaseCondition):
99
"""
1010

1111
def __init__(self, first_field: str, second_field: str) -> None:
12-
1312
self.first_field = first_field
1413
self.second_field = second_field
1514

1615
def check(self, data: Dict[str, Any]) -> bool:
17-
1816
return len(data.get(self.first_field) or []) == len(
1917
data.get(self.second_field) or []
2018
)

src/flask_inputfilter/Condition/ArrayLongerThanCondition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ class ArrayLongerThanCondition(BaseCondition):
99
"""
1010

1111
def __init__(self, longer_field: str, shorter_field: str) -> None:
12-
1312
self.longer_field = longer_field
1413
self.shorter_field = shorter_field
1514

1615
def check(self, data: Dict[str, Any]) -> bool:
17-
1816
return len(data.get(self.longer_field) or []) > len(
1917
data.get(self.shorter_field) or []
2018
)

src/flask_inputfilter/Condition/BaseCondition.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ class BaseCondition:
88
"""
99

1010
def check(self, data: Dict[str, Any]) -> bool:
11-
1211
raise NotImplementedError("Condition must implement 'check' method.")

src/flask_inputfilter/Condition/CustomCondition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class CustomCondition(BaseCondition):
99
"""
1010

1111
def __init__(self, condition: Callable[[Dict[str, Any]], bool]) -> None:
12-
1312
self.condition = condition
1413

1514
def check(self, data: Dict[str, Any]) -> bool:
16-
1715
return self.condition(data)

0 commit comments

Comments
 (0)