Skip to main content

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


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)

Uploaded Source

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

Hashes for pyonr-2.1.7.tar.gz
Algorithm Hash digest
SHA256 b77d94625ddec9a2a93a73cc36b46ffd3f4159c95efd6c44baa43b54ba740ea4
MD5 24e0ea6cdce67a624c9084c1f5f26b3f
BLAKE2b-256 191bbf2f1fdd5a9731ff18ec7edf94932ee552773e618720c64aa91243e52deb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page