https://github.com/torxed/python-pyson
Like JSON, but for Python data types.
https://github.com/torxed/python-pyson
dump json pickle python storage
Last synced: about 2 months ago
JSON representation
Like JSON, but for Python data types.
- Host: GitHub
- URL: https://github.com/torxed/python-pyson
- Owner: Torxed
- License: mit
- Created: 2020-11-01T18:40:34.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-04T17:39:33.000Z (over 4 years ago)
- Last Synced: 2025-01-25T17:05:47.059Z (4 months ago)
- Topics: dump, json, pickle, python, storage
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-pyson
Like JSON, but for Python.
Supports any `eval()` in `key` and `value` pairs.
*(So don't go around using it in production)*# Example
```python
import time
import randomimport pyson
content = """
{
"time" : time.time(),
random.randint(0, 1) : "a random number",
"another_level" : {
"test" : 5
},
"main level" : True
}
"""print(pyson.loads(content, globals(), locals()))
```Produces:
```python
{
'time': 1604261222.4304745,
1: 'a random number',
'another_level': {
'test': 5
},
'main level': True
}
```