PYON Reader - Python Object Nation
Project description
pyon
PYON Reader - Python Object Nation
Table of Contents
Installation
pip install pyonr
How to use
Creating PYON file
let's create our PYON file,
i'm going to call it friends.pyon
{
"me": {
"name": "Nawaf",
"age": 15
}
}
Reading File
import pyonr
file = pyonr.read('friends.pyon') # Replace "friends.pyon" with your file name
fileData = file.readfile # {'me': {'name': 'Nawaf', 'age': 15}}
type(filedata) # <class 'dict'>
Writing File
import pyonr
file = pyonr.read('friends.pyon')
fileData = file.readfile
fileData['khayal'] = {
"name": "Khayal",
"age": 14
}
# This will update "fileData" only, we need to save it
file.write(fileData)
File will get updated to
{
'me': {
'name': 'Nawaf',
'age': 15
},
'khayal': {
'name': 'Khayal',
'age': 14
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
pyonr-1.0.0b2-py3.9.egg
(7.7 kB
view hashes)