跳转到主要内容

DoJSON是一个简单的Pythonic JSON到JSON转换器。

项目描述

https://github.com/inveniosoftware/dojson/workflows/CI/badge.svg https://img.shields.io/coveralls/inveniosoftware/dojson.svg https://img.shields.io/github/tag/inveniosoftware/dojson.svg https://img.shields.io/pypi/dm/dojson.svg https://img.shields.io/github/license/inveniosoftware/dojson.svg

关于

DoJSON是一个简单的Pythonic JSON到JSON转换器。

安装

DoJSON在PyPI上,因此您只需

$ pip install dojson

文档

文档可在https://dojson.readthedocs.io/阅读,或可以使用Sphinx构建

$ pip install dojson[docs]
$ python setup.py build_sphinx

测试

运行测试套件非常简单

$ python setup.py test

示例

如何将MARCXML转换为JSON的简单示例

from dojson.contrib.marc21.utils import create_record, split_stream
from dojson.contrib.marc21 import marc21
[marc21.do(create_record(data)) for data in split_stream(open('/tmp/data.xml', 'r'))]

由以下组织支持