Questions tagged [ujson]

UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 2.5+ and 3.

Ultra fast JSON encoder and decoder for Python

UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 2.5+ and 3.

For a more painless day to day C/C++ JSON decoder experience please checkout ujson4c, based on UltraJSON.

Please checkout the rest of the projects in the Ultra series: http://github.com/esnme/ultramemcache http://github.com/esnme/ultramysql

To install it just run Pip as usual:

$ pip install ujson

Usage

May be used as a drop in replacement for most other JSON parsers for Python

Source

46 questions
0
votes
0 answers

How to fix memory error caused by ujson.loads

I am trying to load a 2GB json file using ujson.loads, and getting a memory error: File "dict.py", line 70, in dct = load_dict_file() File "dict_load.py", line 25, in load_latest_dict dct = ujson.loads(dict_txt) MemoryError I'm…
Haminator
  • 11
  • 1
0
votes
1 answer

Idiomatic handling of JSON null in scala upickle / ujson

I am new to Scala and would like to learn the idiomatic way to solve common problems, as in pythonic for Python. My question regards reading JSON data with upickle, where the JSON value contains a string when present, and null when not present. I…
LukeL
  • 28
  • 5
0
votes
0 answers

Rails UJS not submitting form when submit button pressed

I have a problem where, when I upgraded to Rails 5.1, one of my forms does not work. Specifically, if I click on the submit button, it gets disabled and the form does not submit. I think the issue is UJS, which was not present in my app in previous…
Jack R-G
  • 1,778
  • 2
  • 19
  • 25
0
votes
1 answer

ujson Package Installation Error in Python

When I try to install ujson package in python 3.6 on Windows 10, (which is needed for binance-python library installation) I got this error: C:\Users\MHT\python_projects\crypto\env\Scripts (env) λ pip install ujson Collecting ujson Using cached…
0
votes
1 answer

Understanding this Mutable Recursive Function using the uJson library

I am trying to implement an insert function using the ujson library: Here is my attempt: import ujson.{Obj, Value} import upickle.default._ object Example extends App { def r = transform( List(Map( "a" -> Map("b" -> Obj("c" ->…
finite_diffidence
  • 893
  • 2
  • 11
  • 20
0
votes
0 answers

Minimal Python object that can't be uJson'd

Ujson (and probably other json libraries) for python will reject some objects. A good example is Ulid; you can't put a Ulid into a dict and then expect uJson to correctly dump it. However if I make an empty class, uJson will happily encode it. I'd…
Eamonn M.R.
  • 1,917
  • 2
  • 17
  • 23
0
votes
1 answer

How can I include private attributes in my ujson dump?

I want to dump my Python object at certain points in time for troubleshooting. I am trying to use ujson to dump the object into a file. However, only the public attributes in my object are getting written into the file. The protected attributes are…
Vaibhav Tripathi
  • 323
  • 2
  • 10
0
votes
2 answers

Ujson works on MacOS, but doesn't work on Ubuntu

I've cloned a Python project I was working on on MacOS to a new Ubuntu (virtual) machine. I've managed to get it to run, but the program crashes at the following line: ujson.dumps(plist_as_file) # crash The error is: TypeError: � is not JSON…
Karlovsky120
  • 6,212
  • 8
  • 41
  • 94
0
votes
0 answers

Python: ujson print with newline

Trying to ujson.dump with newlines after every line, but I cannot seem to do it with the dump options (ujson doesn't seem to support the separators keyword). Is there some other way to do this?
azazelspeaks
  • 5,727
  • 2
  • 22
  • 39
0
votes
0 answers

How to debug ValueError with ultra-json loads?

I am trying to read a huge json file (9 GB). I switched from json.load to using ultra-json instead with ujson.load in order to speed up the reading of json data, but I keep running into the below ValueError: with open(json_file_path, 'r') as fh: …
D.prd
  • 605
  • 1
  • 7
  • 21
0
votes
0 answers

Get Jira details using python

I have installed ujson and jira package in my server. I want to fetch details from jira using python in beginning Code: from jira import JIRA jira = JIRA('https://jira.corp.xyz.com') (comment) jac = JIRA(server='https://jira.corp.xyz.com',…
Himanshu Pant
  • 37
  • 1
  • 4
  • 11
0
votes
1 answer

diagnosing when I'm being limited by disk i/o

I'm running Python 2.7 on a Linux machine, and by far the slowest part of my script is loading a large json file from disk (a SSD) using the ujson library. When I check top during this loading process, my cpu usage is basically at 100%, leading me…
George
  • 1,843
  • 2
  • 13
  • 24
0
votes
1 answer

Deleting an Index from ElasticSearch using Id from terminal

Given below is my UJSON (Ultra JSON) object of the index which I want to delete from ElasticSeach { u'_type': u'ratings', u'_source': { u'foo': u'fookey', u'bar': u'barvalue', u'fu': u'fuvalue', …
Prem
  • 630
  • 2
  • 11
  • 25
0
votes
0 answers

Trying to run Mac Python code on Windows machine

I received a piece of Python code which runs alright on Mac machines. I had to install Python on my Windows machine from scratch and when I try to run the code I get this error: File "x.py", line 7, in import ujson ImportError: No module named…
SZA
  • 71
  • 2
  • 2
  • 3
0
votes
1 answer

using ujson instead of django default json serializer

as you known django uses json library for serializing querysets to json and DjangoJSONEncoder class uses json.JSONEncoder as it's superclass and there is no such class in ujson library. how can i use ujson instead of json in django serializer?
SantaXYZ
  • 27
  • 1
  • 7