Code Monkey home page Code Monkey logo

Comments (2)

kopertop avatar kopertop commented on May 20, 2024

odict works pretty well for me.

On Wed, May 15, 2013 at 3:54 PM, Mitch Garnaat [email protected]:

We want to use OrderedDict to preserve the order of the keys in the JSON
files but 2.6 doesn't have it in stdlib. Need to workaround that and also
then use simplejson on 2.6 to use the object_pairs_hook which json in 2.6
does not support.


Reply to this email directly or view it on GitHubhttps://github.com//issues/51
.

Chris Moyer

from botocore.

jamesls avatar jamesls commented on May 20, 2024

Man, I was really hoping to do this without conditional install_requires but I'm not seeing a good way to do this.

I was planning on just vendoring Hettinger's OrderedDict backport into botocore and adding simplejson to the required packages to install because it works with python2 and python3. However simplejson doesn't work with python3.2 so this isn't really an option. I'm guessing we can just do a conditional install_requires for ordereddict and simplejson for python2.6? We might also want to include simplejson for python2.7 as well because it's much faster than the stdlib json module:

$ python --version
Python 2.7.3
$ python -m timeit -s 'import json' 'json.load(open("data/aws/ec2.json"))'
10 loops, best of 3: 22.3 msec per loop
$ python -m timeit -s 'import simplejson' 'simplejson.load(open("data/aws/ec2.json"))'
100 loops, best of 3: 8.46 msec per loop

You guys have any other suggestions? Otherwise I'll update install_requires. We'll also need to work something out for the requirements.txt file as well.

cc @garnaat @toastdriven

from botocore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.