An open API service indexing awesome lists of open source software.

https://github.com/krypton-byte/dict2object


https://github.com/krypton-byte/dict2object

dictionary javascript json object python

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

## Install
```bash
$ pip install git+https://github.com/krypton-byte/dict2object
```
### Convert Dict Datatype to Javascript Object Like
```python
>>> from dict2object import JSObject
>>> js=JSObject(indent=' '*4).fromDict({
'a':3,
'1':10,
'add':(lambda a, b: a.__add__(b))
})
>>> js
{
add: at 0x7f9b5f4bd1b0>,
'1': 10,
a: 3
}

>>> js.add(9, 11)
20
>>> js.add(js['1'], js.a)
13
```