Better Programming

Advice for programmers.

Follow publication

Member-only story

Python Modules That Make Handling JSON Even Faster

Tate Galbraith
Better Programming
Published in
5 min readSep 8, 2022
Photo by Ferenc Almasi on Unsplash

Parsing JSON is a necessary evil of software development. If you’re interacting with an API, sending messages between hosts or scraping data then it’s probably in JSON. Python ships with the standard json library, and in most cases it is plenty sufficient, but for some scenarios you might want something more flexible and a bit faster.

If you’re building an application or a library that does a lot of heavy JSON lifting then it is worthwhile to invest in a more robust module. In this article we’ll look at some standout modules that let you slice and dice JSON in ways the vanilla modules could only dream of. Some of these modules also make significant speed improvements over the standard json library.

1. orjson

If you handle a high volume of complex JSON objects and need things to happen super fast then the orjson module is for you. This module is faster than the default Python json library and is capable of handling many different data types (including NumPy).

The primary benefits of this library are speed and efficiency, and it has some pretty impressive statistics:

Source.

Although this isn’t a direct replacement for the default json module, the speed and efficiency benefits make it especially enticing for data pipelines. If you’re struggling with parsing bottlenecks then this might be your holy grail of modules.

2. tortilla

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Tate Galbraith
Tate Galbraith

Written by Tate Galbraith

Software Engineer @mixhalo & die-hard Rubyist. Amateur Radio operator with a love for old technology. Tweet at me: https://twitter.com/@Tate_Galbraith

Responses (2)

Write a response