Amazon Ion
Actively maintained. Last release 2 weeks ago, commits in 6 of the last 26 weeks. A safe choice.
pip install amazon-ionAmazon Ion Python
An implementation of Amazon Ion for Python.
This package is designed to work with Python 3.8+. Newer language features will be used as deemed valuable. Support may be dropped for versions more than six months past EOL.
Getting Started
Install using pip with the following command.
python3 -m pip install amazon.ion
Start with the simpleion
module, which provides four APIs (dump, dumps, load, loads) that will be familiar to users of Python's
built-in JSON parsing module. Simpleion module's performance is improved by an optional C extension.
For example:
>>> import amazon.ion.simpleion as ion
>>> obj = ion.loads('{abc: 123}')
>>> obj['abc']
123
>>> ion.dumps(obj, binary=False)
'$ion_1_0 {abc:123}'
For additional examples, consult the cookbook.
Git Setup
This repository contains two git submodules.
ion-tests holds test data used by ion-python's unit tests and ion-c speeds up ion-python's simpleion module.
The easiest way to clone the ion-python repository and initialize its ion-tests
submodule is to run the following command.
$ git clone --recursive https://github.com/amazon-ion/ion-python.git ion-python
Alternatively, the submodule may be initialized independently from the clone by running the following commands.
$ git submodule init
$ git submodule update