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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06c607397cef2ac9f8e45992951ee2cb0c7f2e61189aedfd0ab3b5cd04f48538
|
|
| MD5 |
e5ae915c94b71c2bdfefa685d6a5b075
|
|
| BLAKE2b-256 |
f98d4ac4810761c82b549447a6428ea08b4aedf66f1a05266611b5fb5ba071dd
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eeef3ad9485f995e82e5c9c27cf6d0d212bd5dfce988d2f8ef55967614276ea
|
|
| MD5 |
59b5da498d4bb3a8a60a8242d3e02c56
|
|
| BLAKE2b-256 |
9d561355a9a1b3c06d7c1603720369cfcf7e1718bf015d5f747e60899817c1e7
|