Skip to main content

SQLAlchemy integration of jQuery DataTables

Project description

Build Status PyPi Version Scrutinizer Coverage

sqlalchemy-datatables is a framework agnostic library providing an SQLAlchemy integration of jQuery DataTables >= 1.10, and helping you manage server side requests in your application.


To install via pip:

Python 3

$ pip3 install sqlalchemy-datatables

To install from source:

$ git clone
$ cd sqlalchemy-datatables
$ pip3 install .

To contribute:

In a virtualenv
$ git clone
$ cd sqlalchemy-datatables
$ make all


@view_config(route_name='data', renderer='json')
def data(request):
    """Return server side data."""
    # defining columns
    #  - explicitly cast date to string, so string searching the date
    #    will search a date formatted equal to how it is presented
    #    in the table
    columns = [
        ColumnDT(func.strftime('%d-%m-%Y', User.birthday)),

    # defining the initial query depending on your purpose
    #  - don't include any columns
    #  - if you need a join, also include a 'select_from'
    query = DBSession.query().\
        filter( > 4)

    # instantiating a DataTable for the query and table needed
    rowTable = DataTables(request.GET, query, columns)

    # returns what is needed by DataTable
    return rowTable.output_result()


You can find working examples in the repository, including an integration with the yadcf plugin:


All notable changes to this project will be documented in this section.

This project adheres to Semantic Versioning and Keep A Changelog.


The project is licensed under the MIT license.

Project details

Download files

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

Source Distribution

sqlalchemy-datatables-2.0.1.tar.gz (12.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page