semvec/pypi-packages huggingface dataset:
sqla-filters-json 0.0.1
JSON parser for sqla-filters.
License: MIT

# Sqla-filters-json

Add json parser to the sqla-filters package.

## Introduction 

This package 

## Installation

```bash
pip install sqla-filter-json
```

## Getting Started

### JSON format

```json
{
    "type": "and",
    "data": [
        {
            "type": "or",
            "data": [
                {
                    "type": "operator",
                    "data": {
                        "attribute": "name",
                        "operator": "eq",
                        "value": "toto"
                    }
                },
                {
                    "type": "operator",
                    "data":{
                        "attribute": "name",
                        "operator": "eq",
                        "value": "tata"
                    }
                }
            ]
        },
        {
            "type": "operator",
            "data": {
                "attribute": "age",
                "operator": "eq",
                "value": 21
            }
        }
    ]
}
```
:warning: Json format can change in the futur. :warning:



Create an instance of the JSONFilterParser with the json string.

Example:
```python
# Sqlalchemy setup ... + model definition

# Create a JSON parser instance
parser = JSONFiltersParser(raw_json_string)

# you now have a tree available as a property in the parser
print(parser.tree)

# You can finaly filter your query
query = session.query(Post)
filtered_query = parser.tree.filter(query)

# Get the results
query.all()
```

### Result tree

```
                                      +----------------------+
                                      |                      |
                                      |          and         |
                                      |                      |
                                      -----------------------+
                                                 ||
                                                 ||
                                                 ||
                    +----------------------+     ||     +----------------------+
                    |                      |     ||     |                      |
                    |          or          <------------>      age == 21       |
                    |                      |            |                      |
                    +----------------------+            +----------------------+
                               ||
                               ||
                               ||
+----------------------+       ||       +----------------------+
|                      |       ||       |                      |
|     name == toto     <---------------->     name == tata     |
|                      |                |                      |
+----------------------+                +----------------------+
```

# Contribute

Fork the repository and run the following command to install the dependencies and the dev dependencies.

`pip install -e '.[dev]'`
oas3 0.1.13
A library for dealing with OpenAPI v3 specifications in Python
License: MIT

.. |travis-ci| image:: https://img.shields.io/travis/pinntech/oas3/master.svg?style=flat-square
    :target: https://travis-ci.org/#!/pinntech/oas3?branch=master
.. |coveralls| image:: https://img.shields.io/coveralls/pinntech/oas3/master.svg?style=flat-square
    :target: https://coveralls.io/r/pinntech/oas3?branch=master
.. |pypi| image:: https://img.shields.io/pypi/v/oas3.svg?style=flat-square
    :target: https://pypi.python.org/pypi/oas3
.. |license| image:: https://img.shields.io/pypi/l/oas3.svg?style=flat-square
    :target: https://pypi.python.org/pypi/oas3

****
OAS3
****
|travis-ci| |coveralls| |pypi| |license| 

OAS3 is a parser, validator and compiler for dealing with Open API
Specification v3. This library provides an interface for working with
specifications, and loading and dumping to various locations and formats.

Quickstart
===========

To get started load your spec, it will be validated upon dumping.

.. code-block:: python

   from oas3 import Spec

   # Load the Spec from a file
   spec = Spec.from_file('./spec.json')
   spec = Spec.from_file('./spec.yml')

   # Load the Spec from a URL
   spec = Spec.from_url('https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml')

   # Load the Spec from a python native dictionary
   spec = Spec.from_dict(spec_dict)

   # A spec that is sufficiently loaded (i.e. valid OAS3) can now be dumped
   spec.to_file('/tmp/spec.yaml')
   spec.to_dict()
   spec.to_json()
   spec.to_yaml()
0.1.0 2018-10-01
----------------

- Pre-alpha release
sqla-filters-yaml 0.0.1
YAML parser for sqla-filters.
License: MIT

# Sqla-filters-yaml

Add yaml parser to the sqla-filters package.

## Introduction 

Add YAML support to sqla-filters.


## Requirements

This package use the python package `pyyaml`. To install pyyaml you need to have the **yaml.h** header file. If it's not
present on your system you need to install the libyaml-dev package.

- On Fedora
```bash
sudo dnf install libyaml-devel
```

- On Debian based distribution (Ubuntu, ...)
```bash
sudo apt install libyaml-dev
```

## Installation

```bash
pip install sqla-filter-yaml
```

## Getting Started

### YAML format

```yml
---
type: and
data:
- type: or
  data:
  - type: operator
    data:
      attribute: name
      operator: eq
      value: toto
  - type: operator
    data:
      attribute: name
      operator: eq
      value: tata
- type: operator
  data:
    attribute: age
    operator: eq
    value: 21
```

:warning: Yaml format can change in the futur. :warning:

### Example code

Create an instance of the YAMLilterParser from the yaml string / document.

Example:
```python
# Sqlalchemy setup + model definition

# Create a YAML parser instance
parser = YAMLiltersParser(raw_json_string)

# You can finaly filter your query
query = session.query(Post)
filtered_query = parser.tree.filter(query)

# Get the results
query.all()
```

### Result tree

```
                                      +----------------------+
                                      |                      |
                                      |          and         |
                                      |                      |
                                      -----------------------+
                                                 ||
                                                 ||
                                                 ||
                    +----------------------+     ||     +----------------------+
                    |                      |     ||     |                      |
                    |          or          <------------>      age == 21       |
                    |                      |            |                      |
                    +----------------------+            +----------------------+
                               ||
                               ||
                               ||
+----------------------+       ||       +----------------------+
|                      |       ||       |                      |
|     name == toto     <---------------->     name == tata     |
|                      |                |                      |
+----------------------+                +----------------------+
```

# Contribute

Fork the repository and run the following command to install the dependencies and the dev dependencies.

`pip install -e '.[dev]'`