Introduction

Welcome to the Condition package.

Goals

This package aims to achieve the following goals:

  1. Provides a user friendly way to construct condition objects. Support common operators: <, <=, >, >=, ==, in, not in.

  2. Supports composite conditions with And, Or with arbitrary structure;

  3. Supports various usage contexts, for example, pandas dataframe filtering, SQL generation and pyarrow partition filtering.

  4. Supports extensibility to new usage contexts.

Benefits

  1. A condition object can be passed to the back end.

  2. A condition object can be interpreted consistently in different contexts.

  3. A support usage context takes care of formatting and syntax details.

Installing

This project is distributed via pip. To get started:

pip install condition

To install jinja2 package used for sql generation, do the following

pip install "condition[sql]"

To install all packages for development, do the following

pip install "condition[dev]"

Author

Weiyang Zhao <wyzhao@gmail.com>

License

This package uses the MIT license. Check LICENSE file.

Contributing

If you’d like to contribute, fork the project, make a patch and send a merge request. Please see CONTRIBUTING.md in the root of this project.