Skip to main content

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.

Source Distribution

oson-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oson-0.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file oson-0.0.1.tar.gz.

File metadata

  • Download URL: oson-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.1

File hashes

Hashes for oson-0.0.1.tar.gz
Algorithm Hash digest
SHA256 06c607397cef2ac9f8e45992951ee2cb0c7f2e61189aedfd0ab3b5cd04f48538
MD5 e5ae915c94b71c2bdfefa685d6a5b075
BLAKE2b-256 f98d4ac4810761c82b549447a6428ea08b4aedf66f1a05266611b5fb5ba071dd

See more details on using hashes here.

File details

Details for the file oson-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: oson-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.1

File hashes

Hashes for oson-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9eeef3ad9485f995e82e5c9c27cf6d0d212bd5dfce988d2f8ef55967614276ea
MD5 59b5da498d4bb3a8a60a8242d3e02c56
BLAKE2b-256 9d561355a9a1b3c06d7c1603720369cfcf7e1718bf015d5f747e60899817c1e7

See more details on using hashes here.

Supported by

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