Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

This is a package for encode/decode python objects with json.

Project description

Desc

It's a library for python users to encode python objects to json.Use it just like use default json library.

Install

pip3 install oson

Unusual Usage

from datetime import datetime
import oson

class Student(object):
    name = 'Tom'
    age = 23
    update_at = datetime.now()
    __private = "don't see it"

s = Student()
print(oson.dumps(s))

More

from datetime import datetime
import oson

class Student(object):
    name = 'Tom'
    age = 23
    update_at = datetime.now()
    __private = "don't see it"

oson.set_config(time_format='%Y-%m-%d %H:%M:%S', date_format='%Y-%m-%d %H:%M:%S', private=False)

s = Student()
print(oson.dumps(s))

Config

  • private

    if you need to encode private column, set it True.

  • time_format

    use it to transfer time from datetime to time string

  • date_format

    just like 『time_format』

GOOD LUCK!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for oson, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size oson-0.0.1-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size oson-0.0.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page