Questions tagged [jsonpickle]

jsonpickle is a Python library for serialization and deserialization of complex Python objects to and from JSON.

jsonpickle is a Python library for serialization and deserialization of complex Python objects to and from JSON. The standard Python libraries for encoding Python into JSON, such as the stdlib’s json, simplejson, and demjson, can only handle Python primitives that have a direct JSON equivalent (e.g. dicts, lists, strings, ints, etc.). jsonpickle builds on top of these libraries and allows more complex data structures to be serialized to JSON. jsonpickle is highly configurable and extendable–allowing the user to choose the JSON backend and add additional backends.

93 questions
0
votes
0 answers

jsonpickle - Wrong JSON format

I'm trying to use jsonpickle to send an Object to front-end in JSON format. Here is the code: #some code here... return render( request, 'template.html', { 'json_values': jsonpickle.encode(values), } ) But, when…
WitnessTruth
  • 539
  • 2
  • 9
  • 27
0
votes
1 answer

Jsonpickle - ensure deterministic encoding

The encoding is basically string representation of a dictionary, containing the object's fields. However, a dictionary does not respect order, and I could potentially get different encoding string on different runs. How do I preclude this from…
Baron Yugovich
  • 3,843
  • 12
  • 48
  • 76
0
votes
2 answers

Serializing Python Object to JSON Created with eulxml.xmlmap.XmlObject

I have a set of python objects that I create using eulxml.xmlmap.XmlObject (I use this method primarily because I'm working with an eXistDB server and eulxml offers a pretty easy mapping function). I am able to successfully query my eXistDB and load…
Shane McGarry
  • 513
  • 1
  • 6
  • 19
0
votes
2 answers

How to add new dataset in existing pickle file in python

I have this pickle file https://github.com/Nilabhra/ethnicity/blob/master/models/ethnicity_classifier_last_name.pkl which is generated from json file https://github.com/Nilabhra/ethnicity/blob/master/json_counts/last_name_ethnicity.json My…
Rizwan
  • 95
  • 1
  • 13
0
votes
1 answer

jsonpickle subclass of OrderedDict not working

What I am doing wrong: class A(collections.OrderedDict): def __init__(self,*largs,**kwargs): super(A,self).__init__(*largs,**kwargs); def __reduce__(self): return super(A,self).__reduce__() dt =…
Gabriel
  • 8,990
  • 6
  • 57
  • 101
0
votes
0 answers

update of the plotted data using matplotlib

I've checked quite a lot of questions related to this same problem, but still I cannot solve my problem. When I print the data through the terminal, I see that the data is correctly updated, but it is not updated correctly in the figure because data…
paulzaba
  • 91
  • 6
0
votes
2 answers

Python 3.3 dump and load pickled dictionary

I am working through the chapter exercises in Tony Gaddis's "Starting Out With Python" 3rd edition from a class I have taken previously. I'm in chapter 9 and Exercise 8 requires me to write a program that pickles a dictionary (name:email) to a file…
0
votes
1 answer

How do I find the current temperature of a city with NCDC API v2?

I'm a beginner with APIs but I feel this one is still a bit more vast and complex. I want to find the air temperature of Boston. Or really, output any useful weather data. Using this URL in JSON I can find the location of…
user3521314
  • 464
  • 6
  • 14
0
votes
1 answer

Generic Python Object Serialization for Docker Integration

I am working on a project with the objective of separating the processes of training and testing in machine learning projects. I designed the code to wrap the used model, and by model I mean a classifier for instance, in the class Model. class…
JackOrJones
  • 304
  • 1
  • 6
  • 15
0
votes
1 answer

cx_freeze programs won't run. Error given about no jsonpickle module. Python 3.4

I have recently tried to make a .exe program with cx_freeze and it usually works. But I have started using jsonpickle as a module and now my programs do not work anymore. They run in the idle but when I turn them into a .exe, they refuse to run. I…
user4304303
0
votes
1 answer

UnicodeDecodeError while executing query or in jsonpickle

I post an arbitrary query to the server side, where it is executed and the result set is sent back to the client. A typical query looks like this: select Наименование from sys_Атрибут where Наименование = 'Район' As you can see, it contains …
Jacobian
  • 10,122
  • 29
  • 128
  • 221
0
votes
1 answer

Overwrite self from json

I am writing a program that should run more or less continously. If I terminate the program, or if it throws an error, I want all object instances to be saved. To do so, I save all instances using jsonpickle. When the program continues, I want to…
Tobias
  • 514
  • 6
  • 17
0
votes
0 answers

decoded string still consist jsonpickle

I have an object which contains another object. I want to encode it and then decode with jsonpickle. Encoded Ok. But when i trying decode encoded string it still consist jsonpickle marks in it. So variable decode_testk not equal to…
Oleg
  • 1
  • 3
0
votes
1 answer

excluding fields from json serialization in python using jsonpickle

I am using jsonpickle to serialize an object to json. The object has certain fields that point to other objects. I'd like to selectively not include those in the serialization, so that the resulting json file is essentially pure human-readable text…
user248237
0
votes
1 answer

Pickle dumps giving garbage value

Hi I am using a JSON Encoder, where pickle.dumps() is giving me weird output. The output is coming as: "cdecimal Decimal p0 (S'2097369' p1 tp2 Rp3 .", While, it should be: 2097369 The code snippet is: class PythonObjectEncoder(JSONEncoder): def…
Jyotiska
  • 255
  • 3
  • 15