https://github.com/adriamontoto/criteria-pattern

The Criteria Pattern is a Python ๐Ÿ package that simplifies and standardizes criteria based filtering ๐Ÿค๐Ÿป, validation and selection.

https://github.com/adriamontoto/criteria-pattern

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

criteria development filtering pattern python python3 python311 python312 python313 selection sql tools utilities validation
Last synced: 4 months ago · JSON representation ·

Repository

The Criteria Pattern is a Python ๐Ÿ package that simplifies and standardizes criteria based filtering ๐Ÿค๐Ÿป, validation and selection.

Basic Info
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 4
  • Open Issues: 7
  • Releases: 8
Topics
criteria development filtering pattern python python3 python311 python312 python313 selection sql tools utilities validation
Created over 1 year ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing Funding License Code of conduct Citation Codeowners Security

README.md

๐Ÿค๐Ÿป Criteria Pattern

CI Pipeline Coverage Pipeline Package Version Supported Python Versions Package Downloads Project Documentation

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

๐Ÿ”ผ Back to top



## ๐Ÿ“ฅ Installation You can install **Criteria Pattern** using `pip`: ```bash pip install criteria-pattern ```

๐Ÿ”ผ Back to top



## ๐Ÿ“š 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.

๐Ÿ”ผ Back to top



## ๐Ÿ’ป 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'} ```

๐Ÿ”ผ Back to top



## ๐Ÿค 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! ๐ŸŒŸ_

๐Ÿ”ผ Back to top



## ๐Ÿ”‘ License This project is licensed under the terms of the [`MIT license`](https://github.com/adriamontoto/criteria-pattern/blob/master/LICENSE.md).

๐Ÿ”ผ Back to top

Owner

  • Login: adriamontoto
  • Kind: user
  • Location: /dev/null
  • Company: Amazon

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
enhancement (4)
Pull Request Labels
dependencies (130) github_actions (112) python (18)

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.

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 756 Last month
Rankings
Dependent packages count: 10.5%
Average: 34.7%
Dependent repos count: 58.9%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/coverage.yaml actions
  • actions/download-artifact v4 composite
  • actions/setup-python v5 composite
.github/workflows/format.yaml actions
  • EndBug/add-and-commit v9 composite
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/lint.yaml actions
  • 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
.github/workflows/publish.yaml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
  • pypa/gh-action-pypi-publish v1.8.14 composite
.github/workflows/test.yaml actions
  • 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
pyproject.toml pypi
requirements.txt pypi
requirements_dev.txt pypi