Skip to main content
Avatar for lgs from


18 projects


Last released on Dec 4, 2018

Python implementation of SAML Version 2 Standard


Last released on Aug 29, 2018

pysaml2 integration for Django


Last released on Jan 23, 2017

Public Endpoint Entities Registry


Last released on Jun 1, 2016



Last released on May 6, 2016

A set of useful hooks for Mercurial


Last released on Jul 26, 2015

Pyramid Social Network Authentication


Last released on Apr 2, 2015

Okapi ===== Python Library to send API info to Storage Server Okapi setup =========== In an existing project you should at least modify the following files: requirements/base.txt --------------------- Add the following requirement to the project's settings. It won't be needed to add ``requests`` if the project is already using it. ``requests`` version should be >= 2.2.11: .. code-block:: python okapi==X.Y.Z ----------- Add the following configuration to the project's settings: .. code-block:: python ########## OKAPI CONFIGURATION OKAPI_PROJECT = 'your-project-name' OKAPI_URI = None if settings.has_section('okapi'): OKAPI_URI = 'mongodb://{0},{1},{2}/{3}?replicaSet={4}'.format( settings.get('okapi', 'host0'), settings.get('okapi', 'host1'), settings.get('okapi', 'host2'), settings.get('okapi', 'name'), settings.get('okapi', 'replica'), ) ########## END OKAPI CONFIGURATION Note that if the project is already using *MongoDB*, you shouldn't store Okapi's data into the same database. Okapi creates collections dynamically and could conflict with your the project's. Initialization -------------- Initialize Okapi in the ```` file of a basic application of the project. This way Okapi will be imported at startup time: .. code-block:: python import requests from django.conf import settings from okapi.api import Api project_name = getattr(settings, 'OKAPI_PROJECT') mongodb_uri = getattr(settings, 'MONGODB_URI') okapi_client = Api(project_name, requests, mongodb_uri) Usage ----- Once initialized you can use Okapi wherever you use ``requests`` library. Think of Okapi as if you were using ``requests`` because they both have the same API. Requests documentation: Activating/deactivating okapi in your project --------------------------------------------- In the file ``settings/`` under the ``OKAPI CONFIGURATION`` section, you can add a boolean setting in order to enable/disable okapi for your project. It could be interesting to have it enabled in QA or staging environment and after it has been properly tested, activate it also in production. You can have a section into ``your-project-name/settings/``: .. code-block:: python ########## OKAPI CONFIGURATION OKAPI_ENABLED = True ########## END OKAPI CONFIGURATION Another one into ``your-project-name/settings/``: .. code-block:: python ########## OKAPI CONFIGURATION OKAPI_ENABLED = False ########## END OKAPI CONFIGURATION And so on. Note that ``get_custom_setting`` is a wrapper around ``getattr``. Then you could initialize it conditionally as shown below: .. code-block:: python http_lib = requests if (get_custom_setting('OKAPI_ENABLED') and okapi_uri is not None): project_name = get_custom_setting('OKAPI_PROJECT', required=True) okapi_uri = get_custom_setting('OKAPI_URI', required=True) okapi_client = Api(project_name, requests, okapi_uri) http_lib = okapi_client 0.12.0 (2015-04-01) ------------------- - New Features: - Method `get_mongodb_client` to get a MongoDB connection client. - Bugfixes: - None - Incompatible changes: - `Okapi.__init__` has changed to have a new mandatory `db` parameter. Parameters `mongodb_uri` and `connect_timeout_ms` have been removed. 0.11.0 (2014-12-29) ------------------- - New Features: - Changed blank space to a T letter as indicator of the beginning of the time element to be more iso-friendly: 0.10.0 (2014-11-11) ------------------- - New Features: - Don't hardcode the name of the database but expect it to be in the mongodb_uri parameter. 0.9.0 (2014-10-16) ------------------ - New Features: - Decouple okapi from requests so that any library following requests interface can be used. This introduces a backward incompatible change because now the __init__ method for okapi Api class requires a new argument 0.8.0 (2014-09-26) ------------------ - New features: - Use one collection per project instead of saving all projects in the same collection - Add a time_bucket attribute to make time based queries faster 0.7.1 (2014-07-28) ---------------- - Bug Fixes: -Make sure to raise the exception if an error occurs so the user know exactly what is happening instead of code crashing


Last released on Apr 7, 2013

A library for making charts with Python


Last released on Mar 24, 2013

JSLint wrapper


Last released on Jul 21, 2011

An advanced search form application for Django


Last released on Apr 28, 2011

Buildout recipe for compiling uwsgi


Last released on Mar 21, 2011

Buildout recipe for creating self signed certificates


Last released on Jan 29, 2011

Hamster Remote Control


Last released on Dec 22, 2010

Buildout recipe for sym linking media files in Django projects


Last released on Nov 17, 2010

Buildout recipe for compiling pycairo


Last released on Nov 2, 2010

A simple repoze.what plugin useful for Mercurial hgwebdir


Last released on Oct 18, 2010

Extensions to hghooks used at Yaco Sistemas


Last released on Sep 26, 2010

Google Address Book Importer

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