Skip to content

Instantly share code, notes, and snippets.

@psykzz
Created August 12, 2014 00:34
Show Gist options
  • Select an option

  • Save psykzz/c482667c1f6ef6405c96 to your computer and use it in GitHub Desktop.

Select an option

Save psykzz/c482667c1f6ef6405c96 to your computer and use it in GitHub Desktop.
"""Speeds up helper to promote 3rd parties"""
from __future__ import print_function
""" JSON replacement
Load order:
> ujson
> yajl
> simplejson
> jsonlib2
> std json
"""
__all__ = ['json']
try:
import ujson as json
except ImportError:
try:
import yajl as json
except ImportError:
try:
import simplejson as json
except ImportError:
try:
import jsonlib2 as json
except ImportError:
import json
print("Didn't load any replacement json modules, considering install some to speed up your application.\npip install ujson")
# we are using regular python standard json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment