DRF renderer and parser based on orjson
Project description
DRF orjson renderer and parser
Rendering and parsing JSON with orjson. Made on example drf_orjson_renderer package.
Installation
-
Install package
pip install drf_orjson_rp
-
Rewrite settings by example.
REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': [ # replace default json on orjson renderer 'drf_orjson_rp.renderers.ORJSONRenderer', # defaults 'rest_framework.renderers.BrowsableAPIRenderer', ], 'DEFAULT_PARSER_CLASSES': [ # replace default json on orjson parser 'drf_orjson_rp.parsers.ORJSONParser', # defaults 'rest_framework.parsers.FormParser', 'rest_framework.parsers.MultiPartParser' ], # add orjson renderer option 'ORJSON_RENDERER_OPTION': orjson.OPT_APPEND_NEWLINE | orjson.OPT_INDENT_2, }
-
Renderer and parser made by example from source code DRF.
Developing
-
Clone your fork and cd into the repo directory
git clone git@github.com:<your username>/drf_orjson_rp.git cd drf_orjson_rp
-
Create a virtual environment
python3 -m venv .venv source .venv/bin/activate
-
Install uv and dev dependencies
pip install uv bash scripts/install.bash
-
Run tests
bash scripts/test.bash -
Run linters
bash scripts/lint.bash -
Run test coverage
bash scripts/coverage.bash
Links
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 drf_orjson_rp-0.3.0.tar.gz.
File metadata
- Download URL: drf_orjson_rp-0.3.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db9ed3b7e9fca1d0cc9e343b8ececd7149a2fb49970b44869b6806e352206e8e
|
|
| MD5 |
550a081f3b4a2c326efdf50a30d72407
|
|
| BLAKE2b-256 |
1895bde1d19a7a2adfe6723683d6b62c129c5b245bb28f2b15f1598230efa218
|
Provenance
The following attestation bundles were made for drf_orjson_rp-0.3.0.tar.gz:
Publisher:
python-publish.yml on ArtemIsmagilov/drf_orjson_rp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drf_orjson_rp-0.3.0.tar.gz -
Subject digest:
db9ed3b7e9fca1d0cc9e343b8ececd7149a2fb49970b44869b6806e352206e8e - Sigstore transparency entry: 186033019
- Sigstore integration time:
-
Permalink:
ArtemIsmagilov/drf_orjson_rp@d0330ce3671e6269aaf159584b6520ebb37f690d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/ArtemIsmagilov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d0330ce3671e6269aaf159584b6520ebb37f690d -
Trigger Event:
release
-
Statement type:
File details
Details for the file drf_orjson_rp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: drf_orjson_rp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8a70cb73d71797ce852ee6389e0cca77d4b56c1795e26a29a4218ca190cb5bd
|
|
| MD5 |
a842cc4e035d1a37d1fc73a29930ffb6
|
|
| BLAKE2b-256 |
c644ed69bc61866fc9d5586f9421b7da1de14ee5d895a2cb9cee4d8327e14833
|
Provenance
The following attestation bundles were made for drf_orjson_rp-0.3.0-py3-none-any.whl:
Publisher:
python-publish.yml on ArtemIsmagilov/drf_orjson_rp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drf_orjson_rp-0.3.0-py3-none-any.whl -
Subject digest:
c8a70cb73d71797ce852ee6389e0cca77d4b56c1795e26a29a4218ca190cb5bd - Sigstore transparency entry: 186033020
- Sigstore integration time:
-
Permalink:
ArtemIsmagilov/drf_orjson_rp@d0330ce3671e6269aaf159584b6520ebb37f690d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/ArtemIsmagilov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d0330ce3671e6269aaf159584b6520ebb37f690d -
Trigger Event:
release
-
Statement type: