Skip to main content

A simple installable app for testing app testcases

Project description

Django-Simple-Pagination
=========================

.. image:: https://badge.fury.io/py/test-todo.svg
:target: https://badge.fury.io/py/test-todo

.. image:: https://coveralls.io/repos/github/nikhila05/Todo/badge.svg
:target: https://coveralls.io/github/nikhila05/Todo

.. image:: https://travis-ci.org/nikhila05/Todo.svg?branch=master
:target: https://travis-ci.org/nikhila05/Todo

.. image:: https://img.shields.io/pypi/dm/django-simple-pagination.svg
:target: https://pypi.python.org/pypi/django-simple-pagination
:alt: Downloads

.. image:: https://img.shields.io/pypi/v/django-simple-pagination.svg
:target: https://pypi.python.org/pypi/django-simple-pagination
:alt: Latest Release

.. image:: https://landscape.io/github/MicroPyramid/django-simple-pagination/master/landscape.svg?style=flat
:target: https://landscape.io/github/MicroPyramid/django-simple-pagination/master
:alt: Code Health

.. image:: https://img.shields.io/github/license/micropyramid/django-simple-pagination.svg
:target: https://pypi.python.org/pypi/django-simple-pagination/


Django-Simple-Pagination
=========================

Documentation_ -- GitHub_ -- BitBucket_ -- Travis-CI_

Simple python library to deal with `URI Templates`_. The API looks like

.. code-block:: python

from uritemplate import URITemplate, expand

# NOTE: URI params must be strings not integers

gist_uri = 'https://api.github.com/users/sigmavirus24/gists{/gist_id}'
t = URITemplate(gist_uri)
print(t.expand(gist_id='123456'))
# => https://api.github.com/users/sigmavirus24/gists/123456

# or
print(expand(gist_uri, gist_id='123456'))

# also
t.expand({'gist_id': '123456'})
print(expand(gist_uri, {'gist_id': '123456'}))

Where it might be useful to have a class

.. code-block:: python

import requests

class GitHubUser(object):
url = URITemplate('https://api.github.com/user{/login}')
def __init__(self, name):
self.api_url = url.expand(login=name)
response = requests.get(self.api_url)
if response.status_code == 200:
self.__dict__.update(response.json())

When the module containing this class is loaded, ``GitHubUser.url`` is
evaluated and so the template is created once. It's often hard to notice in
Python, but object creation can consume a great deal of time and so can the
``re`` module which uritemplate relies on. Constructing the object once should
reduce the amount of time your code takes to run.

Installing
----------

::

pip install uritemplate.py

Support
-----------

Contact US contactus_


.. _url: https://micropyramid.com/contact-us/

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

test-todo-0.1.3.tar.gz (6.3 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