bottle-rest-serializer
Simple serializers for REST APIs built using BottlePy
Default Python serializers don't work when your dicts/objects contains datetime or Decimal instances. This plugin is meant to fix this "issue".
datetimeinstances will be converted to ISO8601 strings.Decimalinstances will be converted tofloat.
Installation
bottle-rest-serializer is available from PyPI as bottle-rest-serializer:
pip install bottle-rest-serializer
JSON Serializer:
from datetime import datetime
from decimal import Decimal
from bottle import Bottle, run
from truckpad.bottle.rest_serializer import FlexibleJSONPlugin
app = Bottle()
app.install(FlexibleJSONPlugin())
@app.get('/')
def index():
return {
'now': datetime.now(),
'float_number': Decimal(123.4567),
'int_number': Decimal(4567)
}
if __name__ == '__main__':
run(app)
XML Serializer:
To be developed in the future :P
Metadata
Release files for bottle-rest-serializer 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bottle_rest_serializer-0.1.4.tar.gz | 2.3 kB | Without provenance | Details for bottle_rest_serializer-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bottle_rest_serializer-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for bottle_rest_serializer-0.1.4-py3-none-any.whl |
Total release size: 5.4 kB
Release files / bottle_rest_serializer-0.1.4.tar.gz
| Download URL | bottle_rest_serializer-0.1.4.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45f2a2eb89be0f6a517d9427b1b5647fcd67779369fdcbc747812df6beaefe01
|
|
BLAKE2b-256 checksum How to use checksums |
cd115d78f51e1d0e3ff44a75ba7f46572efbc6052617bf3348120ae28990da21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Release files / bottle_rest_serializer-0.1.4-py3-none-any.whl
| Download URL | bottle_rest_serializer-0.1.4-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5559361f94a2f28aa8d5e1262475380132f78b29d8ff1b27dc2d5834ff3d250e
|
|
BLAKE2b-256 checksum How to use checksums |
70645908587e0d6d7442e28fd65f972eb9f680e87877007507ac03f8965acbfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Security for bottle-rest-serializer 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.