PYON Reader - Python Object Notation
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.read # {'me': {'name': 'Nawaf', 'age': 15}}
type(fileData) # <class 'dict'>
Writing File
import pyonr
file = pyonr.read('friends.pyon')
fileData = file.read
fileData['khayal'] = {
"name": "Khayal",
"age": 14
}
# This will update "fileData" only, we need to save it
file.write(fileData)
File will get updated too
{
'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 Distribution
pyonr-2.1.7.tar.gz
(6.0 kB
view details)
File details
Details for the file pyonr-2.1.7.tar.gz
.
File metadata
- Download URL: pyonr-2.1.7.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b77d94625ddec9a2a93a73cc36b46ffd3f4159c95efd6c44baa43b54ba740ea4 |
|
MD5 | 24e0ea6cdce67a624c9084c1f5f26b3f |
|
BLAKE2b-256 | 191bbf2f1fdd5a9731ff18ec7edf94932ee552773e618720c64aa91243e52deb |