I am making a python script with jython and I need to use the json module that dosent exist in jython 2.5 . Do any of you guys know a way to include a module as a single file that can be moved around with the script without installing it on the host's jython . I was planning on using the simple json module i found on pypi
If it helps.
Try http://opensource.xhaus.com/projects/jyson
A fast JSON codec for jython 2.5, written in java.
Jython 2.7.0 now includes the standard library json module, which is reasonably fast now that it has been ported to Java. I ran the JSON benchmarks in the standard Python benchmark suite:
### json_dump ###
Min: 0.385395 -> 0.634000: 1.65x slower
Avg: 0.388340 -> 0.831400: 2.14x slower
Significant (t=-3.59)
Stddev: 0.00331 -> 0.27605: 83.3334x larger
### json_dump_v2 ###
Min: 2.642799 -> 3.480000: 1.32x slower
Avg: 2.680320 -> 3.715000: 1.39x slower
Significant (t=-6.72)
Stddev: 0.04087 -> 0.34167: 8.3607x larger
### json_load ###
Min: 0.816147 -> 2.266000: 2.78x slower
Avg: 0.832826 -> 2.578800: 3.10x slower
Significant (t=-8.27)
Stddev: 0.01652 -> 0.47203: 28.5677x larger
Other options like GSon, Jackson, or Jyson would likely be faster, given the API of the json module.