ponte

A mini-library to process arrays to .json files and viceversa. Developed to pass arrays between Python and C++ through the use of json DOK files.


Keywords
json, python
License
MIT
Install
pip install ponte==0.0.1

Documentation

ponte

A mini-library to process arrays to .json files and viceversa. Developed to pass arrays between Python and C++ through the use of json DOK files.

Installation

pip install ponte

Contributors

Contributing

  1. Fork it (https://github.com/your-github-user/tensorscout/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Usage Example

For full application, i.e. passing array structures between Python and C++ code, see bridge

Try running this code in a terminal

import ponte as bridge
import numpy as np

'CREATE A 1-D VECTOR'
X = np.random.choice([0,1,2,3],10,p=[0.7,0.1,0.1,0.1])
'pack vector to .json file'
bridge.tojson('sample.json',X)

'PROCESS JSON FILE BACK TO VECTOR'
array_form = bridge.jsonload('sample.json')
'print vector'
print('array:\n',array_form)