json
autocorpus.ac_bioc.json
¤
This module provides a custom JSON encoder for BioCCollection objects.
It includes:
- BioCJSONEncoder: A subclass of JSONEncoder to handle BioC objects with a to_dict
-like structure.
- dump: Function to serialize BioCCollection to a JSON file-like object.
- dumps: Function to serialize BioCCollection to a JSON-formatted string.
Classes¤
BioCJSON
¤
JSON serialization for BioC objects.
Functions¤
dump(obj, fp, **kwargs)
staticmethod
¤
Serialize a BioCCollection object to a JSON file-like object.
Source code in autocorpus/ac_bioc/json.py
30 31 32 33 |
|
dumps(obj, **kwargs)
staticmethod
¤
Serialize a BioCCollection object to a JSON-formatted string.
Source code in autocorpus/ac_bioc/json.py
35 36 37 38 |
|
loads(json_str)
staticmethod
¤
Deserialize a JSON-formatted string to a BioCCollection object.
Source code in autocorpus/ac_bioc/json.py
40 41 42 43 44 |
|
BioCJSONEncoder
¤
Bases: JSONEncoder
Custom JSON encoder for BioC-related objects.
Functions¤
default(o)
¤
Return a serializable object for JSON encoding, using to_dict if available.
Source code in autocorpus/ac_bioc/json.py
18 19 20 21 22 23 24 |
|