Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Filter queries to json and back

Project description

Build Status

With FilterQL you can write filter queries with the use of python objects. These objects can be translated to json and send over the wire to be used in some other backend. This allows you to not be limited to the way you can define filters in (front-end) applications that communicate with and API.


Currently actively used and watched.



  • python 2.7
  • python 3.3, 3.4, 3.5
  • (optional) django >= 1.8


pip install filterql


from filterql import L, STARTSWITH

# Filter query for name to start with `spindle` or `devhouse`
lookup = L('name', 'spindle', lookup=STARTSWITH) | L('name', 'devhouse', lookup=STARTSWITH)

# Convert to json to be able to send it to other systems.
lookup_json = lookup.dumps()

# On the other side either convert back to L objects or to Django Q objects.

# L
l_filters = L.from_json(lookup_json)

# Django
from filterql.serializers import DjangoSerializer

django_filters = DjangoSerializer().from_json(lookup_json)


See the file on how to contribute to this project.


See the file for a list of contributors to the project.



The changelog can be found in the file.

In progress

  • Publish on pypi


  • Improve logic for combining lookup elements
  • (De)serialization for other data types like XML

Get in touch with a developer

If you want to report an issue see the file for more info.

We will be happy to answer your other questions at

Project details

Release history Release notifications

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for filterql, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size filterql-0.1.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page