of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Description: =============
filteralchemy
=============
.. image:: https://img.shields.io/pypi/v/filteralchemy.svg
:target: http://badge.fury.io/py/filteralchemy
:alt: Latest version
.. image:: https://readthedocs.org/projects/filteralchemy/badge/?version=latest
:target: https://filteralchemy.readthedocs.org/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/travis/jmcarp/filteralchemy/dev.svg
:target: https://travis-ci.org/jmcarp/filteralchemy
:alt: Travis-CI
.. image:: https://img.shields.io/codecov/c/github/jmcarp/filteralchemy/dev.svg
:target: https://codecov.io/github/jmcarp/filteralchemy
:alt: Code coverage
**filteralchemy** is a declarative query builder for SQLAlchemy. **filteralchemy** uses marshmallow-sqlalchemy_ to auto-generate filter fields and webargs_ to parse field parameters from the request. Use it to filter data with minimal boilerplate.
For Django users: the design of **filteralchemy** is strongly inspired by django-filter_.
Install
-------
.. code-block::
pip install filteralchemy
Quickstart
----------
.. code-block:: python
import flask
from models import Album, session
from webargs.flaskparser import parser
from filteralchemy import FilterSet
from filteralchemy.operators import Equal, Less, Greater
class AlbumFilterSet(FilterSet):
class Meta:
model = Album
query = session.query(Album)
operators = (Equal, Less, Greater)
parser = parser
app = flask.Flask(__name__)
@app.route('/albums')
def get_albums():
query = AlbumFilterSet().filter()
return flask.jsonify(query.all())
.. code-block::
http :5000/albums artist==Queen genre==rock sales__gt==1000000
.. _marshmallow-sqlalchemy: https://marshmallow-sqlalchemy.readthedocs.org/
.. _webargs: https://webargs.readthedocs.org/
.. _django-filter: https://github.com/alex/django-filter
Keywords: filteralchemy
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Metadata
Release files for filteralchemy-fork 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| filteralchemy-fork-0.1.0.tar.gz | 5.8 kB | Without provenance | Details for filteralchemy-fork-0.1.0.tar.gz |
Release files / filteralchemy-fork-0.1.0.tar.gz
| Download URL | filteralchemy-fork-0.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7af3c5d2be1fb5cfa5701c7bdfa71dcbd3e99a95adb23b13f55bd37dfe735ad3
|
|
BLAKE2b-256 checksum How to use checksums |
ba794b39ef7e32e610e789aa987a4ae1723a937cd1cbf16a0ac5865b37dd6ca3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
|
Security for filteralchemy-fork 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.