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
1
vote
0 answers

Getting ujson error while installing Rasa-x on ubuntu 20.04LTS

I am trying to install Rasa-x using pip. I am getting a weird ujson error. pip version --> pip 20.1.1 python3 version --> python 3.6 ubuntu 20.04 I am attaching the error below. Building wheel for ujson (setup.py) ... error
1
vote
0 answers

Scala - Custom Encoder for Upickle/Ujson Library

I am working with the Upickle/Ujson and want to write a custom encoder to get the hang of things. Suppose I have the following hierarchy (from the tutorial here: Link) import upickle.default._ object TestDrive extends App { sealed trait…
finite_diffidence
  • 893
  • 2
  • 11
  • 20
1
vote
2 answers

Parsing a file having content as Json format in Scala

I want to parse a file having content as json format. From the file I want to extract few properties (name, DataType, Nullable) to create some column names dynamically. I have gone through some examples but most of them are using case class but my…
Stark
  • 604
  • 3
  • 11
  • 30
1
vote
1 answer

Decode json using uJson for delphi

I have a JSON file that looks like this and I'm trying to decode it, but with no luck: [ { "FirstName": "Kim", "Surname": "Jensen" }, { "FirstName": "Amery", "Surname": "Mcmillan" }, { "FirstName": "Denton", …
Kim HJ
  • 1,183
  • 2
  • 11
  • 37
1
vote
2 answers

Fastest pythonic way of parsing dictionary where values are bytes stringfied json object

So I have a dictionary which is a hash object I'm getting from Redis, similar to the following dictionary: source_data = { b'key-1': b'{"age":33,"gender":"Male"}', b'key-2': b'{"age":20,"gender":"Female"}' } My goal is extract all the values…
Sam
  • 605
  • 9
  • 19
1
vote
2 answers

is it possible to ujson.dumps() python class instance (faster deepcopy)

I am trying to make a fast copy of a class instance. cPickle.loads(cPickle.dumps(),-1) works fine, almost 5 times faster than copy.deepcopy, but I read that ujson is much faster than cPickle. I could not get ujson to work with a custom class, is it…
muon
  • 12,821
  • 11
  • 69
  • 88
1
vote
0 answers

json-API issue (Taiga-python)

I am using Taiga (taiga.io) to handle my projects. I found that there's a python-based API which I am trying to use. I can create items in my projects but I cannot extract anything. When I try to extract data, I keep getting this error: File…
zimo117
  • 11
  • 2
1
vote
1 answer

How to use ujson with Google App Engine

According to the official list of built-in libraries, ujson is available. However, the following app.yaml snippet: libraries: - name: ujson version: '1.35' ...generates this error: Usage: appcfg.py [options] update | [file,…
hamx0r
  • 4,081
  • 1
  • 33
  • 46
1
vote
1 answer

Specifying how ujson handles serialization of a custom object?

I have a custom object that I want to log using python's logger module. I log it with a dict: logger.info({ 'message': 'something happened', 'object': my_custom_object, }) The problem is logger uses ujson.dumps() to serialize the inputs to…
Razor Storm
  • 12,167
  • 20
  • 88
  • 148
1
vote
0 answers

How does this code works?

The Python source code of the ujson library is as follows. # encoding: utf-8 # module ujson # from /home/marty/dj/local/lib/python2.7/site-packages/ujson.so # by generator 1.136 # no doc # no imports # Variables with simple values __version__ =…
All Іѕ Vаиітy
  • 24,861
  • 16
  • 87
  • 111
0
votes
1 answer

So I wanted to install something using pip install … but I get this error message, how can I fix it?

Building wheels for collected packages: ujson Building wheel for ujson (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for ujson (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [128 lines of…
0
votes
1 answer

Can only load json file from python terminal and not from script, neither works with ujson package

I originally only used ujson as follows. This code has been working for sometime and I'm not sure how I broke it. import ujson as json with open('performance_data.json', 'r') as f: data = json.load(f) It just today started throwing a…
Gustavo Costa
  • 107
  • 1
  • 1
  • 8
0
votes
1 answer

Deep flatten Scala Maps (or uJson Objs) - how to?

How can I flatten deep nested Maps in Scala returning a new map with the relevant nested key in dot notation? Background: I am trying to do so for uJson.Objs, but since they are just mutable.LinkedHashMap[String, Value] under-the-hoods, answers for…
YFl
  • 845
  • 7
  • 22
0
votes
1 answer

Speed up json conversion with pypy3

Is there a way to speed up converting streams of strings to json/dictionary using pypy3? I know ujson in python3 could be faster than python3's json, but its not really faster than pypy3's json.loads(). More info on what I have, I have a program…
user1179317
  • 2,693
  • 3
  • 34
  • 62
0
votes
1 answer

scala ujson.read() returns ujson.Obj

I am trying to read a json string using Li Haoyi's ujson. This is the string: { "dataflows": [ { "name": "test", "sources": [ { "name": "person_inputs", "path": "/data/input/events/person/*", …
MrMuppet
  • 547
  • 1
  • 4
  • 12