This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description


This module helps you to manage large data with pagination.

How this module work?

This module sqlalchemy_paginator.Paginator take an SQLAlchemy query - e.g.: Session.query(MyModel) and on calling page for specific page number it will fetch only required records from database instead of fetching all the records.

This class will also optimized the query for fetching total number of records from database against given query_set. Optimization will be applied only on the query that will be used for fetching total number of records. You can also provide the separate query in optional_count_query_set argument for fetching total number of records.


You can use this paginator module in python scripting code and in web based application code as well.


> from sqlalchemy_paginator import Paginator
> query = session.query(MyModel)
> paginator = Paginator(query, 5)
> for page in paginator:
>     print "page number of current page in iterator", page.number
>     print "this is a list that contains the records of current page", page.object_list


> from sqlalchemy_paginator import Paginator
> query = session.query(MyModel)
> paginator = Paginator(query, 5)
> page =
> print "to get total number of records against given query", page.paginator.count
> print "to get total number of pages", page.paginator.total_pages
> print "to get range of pages in list", page.paginator.pages_range
> print "to get index of the first object on this page", page.start_index
> print "to get index of the last object on this page", page.end_index
> if page.has_previous():
>     print "to get previous page number", page.previous_page_number
> if page.has_next():
>     print "to next previous page number", page.next_page_number

How to install?

When pip is available, the distribution can be downloaded from PyPI and installed in single step

> pip install SQLAlchemy-Paginator

or you can use easy_install

> easy_install SQLAlchemy-Paginator

You can find more document in sqlalchemy_paginator/ module and a complete example in the tests/ file of this Python module.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SQLAlchemy-Paginator-0.1.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source Oct 26, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting