https://github.com/adriamontoto/criteria-pattern
The Criteria Pattern is a Python ๐ package that simplifies and standardizes criteria based filtering ๐ค๐ป, validation and selection.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
โCITATION.cff file
Found CITATION.cff file -
โcodemeta.json file
Found codemeta.json file -
โ.zenodo.json file
Found .zenodo.json file -
โDOI references
-
โAcademic publication links
-
โAcademic email domains
-
โInstitutional organization owner
-
โJOSS paper metadata
-
โScientific vocabulary similarity
Low similarity (8.9%) to scientific vocabulary
Keywords
Repository
The Criteria Pattern is a Python ๐ package that simplifies and standardizes criteria based filtering ๐ค๐ป, validation and selection.
Basic Info
- Host: GitHub
- Owner: adriamontoto
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://pypi.org/project/criteria-pattern
- Size: 189 KB
Statistics
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 7
- Releases: 8
Topics
Metadata Files
README.md
๐ค๐ป Criteria Pattern
The Criteria Pattern is a Python ๐ package that simplifies and standardizes criteria based filtering ๐ค๐ป, validation and selection. This package provides a set of prebuilt ๐ท๐ป objects and utilities that you can drop into your existing projects and not have to implement yourself.
These utilities ๐ ๏ธ are useful when you need complex filtering logic. It also enforces ๐ฎ๐ป best practices so all your filtering processes follow a uniform standard.
Easy to install and integrate, this is a must have for any Python developer looking to simplify their workflow, enforce design patterns and use the full power of modern ORMs and SQL ๐๏ธ in their projects ๐.
Table of Contents
## ๐ฅ Installation You can install **Criteria Pattern** using `pip`: ```bash pip install criteria-pattern ```
## ๐ Documentation This [project's documentation](https://deepwiki.com/adriamontoto/criteria-pattern) is powered by DeepWiki, which provides a comprehensive overview of the **Criteria Pattern** and its usage.
## ๐ป Utilization ```python from criteria_pattern import Criteria, Filter, Operator from criteria_pattern.converter import SqlConverter is_adult = Criteria(filters=[Filter(field='age', operator=Operator.GREATER_OR_EQUAL, value=18)]) email_is_gmail = Criteria(filters=[Filter(field='email', operator=Operator.ENDS_WITH, value='@gmail.com')]) email_is_yahoo = Criteria(filters=[Filter(field='email', operator=Operator.ENDS_WITH, value='@yahoo.com')]) query, parameters = SqlConverter.convert(criteria=is_adult & (email_is_gmail | email_is_yahoo), table='user') print(query) print(parameters) # >>> SELECT * FROM user WHERE (age >= %(parameter_0)s AND (email LIKE '%%' || %(parameter_1)s OR email LIKE '%%' || %(parameter_2)s)); # >>> {'parameter_0': 18, 'parameter_1': '@gmail.com', 'parameter_2': '@yahoo.com'} ```
## ๐ค Contributing We love community help! Before you open an issue or pull request, please read: - [`๐ค How to Contribute`](https://github.com/adriamontoto/criteria-pattern/blob/master/.github/CONTRIBUTING.md) - [`๐งญ Code of Conduct`](https://github.com/adriamontoto/criteria-pattern/blob/master/.github/CODE_OF_CONDUCT.md) - [`๐ Security Policy`](https://github.com/adriamontoto/criteria-pattern/blob/master/.github/SECURITY.md) _Thank you for helping make **๐ค๐ป Criteria Pattern** package awesome! ๐_
## ๐ License This project is licensed under the terms of the [`MIT license`](https://github.com/adriamontoto/criteria-pattern/blob/master/LICENSE.md).
Owner
- Login: adriamontoto
- Kind: user
- Location: /dev/null
- Company: Amazon
- Repositories: 9
- Profile: https://github.com/adriamontoto
Software Development Engineer @ Amazon
Citation (CITATION.cff)
cff-version: 1.2.0
title: Criteria Pattern
message: >
If you use this software, please cite it using the metadata below.
type: software
authors:
- given-names: Adriร
family-names: Montoto
repository-code: https://github.com/adriamontoto/criteria-pattern
url: https://pypi.org/project/criteria-pattern
abstract: >
Criteria Pattern is a Python package that simplifies and standardizes
criteria based filtering, validation and selection. This package
provides a set of prebuilt objects and utilities that you can drop into
your existing projects and not have to implement yourself.
keywords:
- python
- validation
- sql
- filtering
- criteria
license: MIT
GitHub Events
Total
- Create event: 77
- Issues event: 4
- Release event: 5
- Watch event: 5
- Delete event: 82
- Member event: 1
- Issue comment event: 53
- Push event: 115
- Pull request review event: 37
- Pull request event: 148
- Fork event: 1
Last Year
- Create event: 77
- Issues event: 4
- Release event: 5
- Watch event: 5
- Delete event: 82
- Member event: 1
- Issue comment event: 53
- Push event: 115
- Pull request review event: 37
- Pull request event: 148
- Fork event: 1
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 4
- Total pull requests: 136
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.5
- Merged pull requests: 59
- Bot issues: 0
- Bot pull requests: 130
Past Year
- Issues: 4
- Pull requests: 132
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.52
- Merged pull requests: 55
- Bot issues: 0
- Bot pull requests: 130
Top Authors
Issue Authors
- adriamontoto (4)
Pull Request Authors
- dependabot[bot] (130)
- adriamontoto (6)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 756 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 7
- Total maintainers: 1
pypi.org: criteria-pattern
The Criteria Pattern is a Python package that simplifies and standardizes criteria based filtering, validation and selection.
- Homepage: https://github.com/adriamontoto/criteria-pattern
- Documentation: https://criteria-pattern.readthedocs.io/
- License: MIT License
-
Latest release: 2024.11.5
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- actions/download-artifact v4 composite
- actions/setup-python v5 composite
- EndBug/add-and-commit v9 composite
- actions/cache v4 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/cache v4 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/upload-artifact v4 composite
- re-actors/alls-green release/v1 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/upload-artifact v4 composite
- pypa/gh-action-pypi-publish v1.8.14 composite
- actions/cache v4 composite
- actions/checkout v4 composite
- actions/download-artifact v4 composite
- actions/setup-python v5 composite
- actions/upload-artifact v4 composite
- re-actors/alls-green release/v1 composite