Skip to main content

DRF orjson renderer and parser

CI Upload Python Package pypi

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,
    }
    
  • Check settings by default in source code DRF. DEFAULTS

  • 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
    

Metadata

Release files for drf-orjson-rp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drf-orjson-rp 0.3.0
File Size Uploaded Provenance Actions
drf_orjson_rp-0.3.0.tar.gz 5.0 kB With provenance Details for drf_orjson_rp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for drf-orjson-rp 0.3.0
File Interpreter ABI Platform Actions
drf_orjson_rp-0.3.0-py3-none-any.whl Python 3 none any Details for drf_orjson_rp-0.3.0-py3-none-any.whl

Total release size: 9.6 kB

Release files / drf_orjson_rp-0.3.0.tar.gz

Download URL drf_orjson_rp-0.3.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
db9ed3b7e9fca1d0cc9e343b8ececd7149a2fb49970b44869b6806e352206e8e
BLAKE2b-256 checksum
How to use checksums
1895bde1d19a7a2adfe6723683d6b62c129c5b245bb28f2b15f1598230efa218
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2025.

Transparency log

Release files / drf_orjson_rp-0.3.0-py3-none-any.whl

Download URL drf_orjson_rp-0.3.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8a70cb73d71797ce852ee6389e0cca77d4b56c1795e26a29a4218ca190cb5bd
BLAKE2b-256 checksum
How to use checksums
c644ed69bc61866fc9d5586f9421b7da1de14ee5d895a2cb9cee4d8327e14833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2025.

Transparency log

Security for drf-orjson-rp 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for drf_orjson_rp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2025.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page