patx/micropie
update readme with new optional dependency `orjson`
Commit b0f4845 · patx · 2025-05-22T20:24:24-04:00
Comments
No comments yet.
Diff
diff --git a/README.md b/README.md
index b6d6a1f..785432a 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ Install MicroPie with all optional dependencies via pip:
```bash
pip install micropie[all]
```
-This will install MicroPie along with `jinja2` for template rendering and `multipart`/`aiofiles` for parsing multipart form data.
+This will install MicroPie along with `jinja2` for template rendering, `orjson` for handling JSON requests/responses, and `multipart`/`aiofiles` for parsing multipart form data.
### **Minimal Setup**
You can also install MicroPie without ANY dependencies via pip:
@@ -46,6 +46,11 @@ Place it in your project directory, and you are good to go. Note that `jinja2` m
pip install jinja2 multipart aiofiles
```
+By default MicroPie will use the `json` library from Python's standard library. If you need faster performance you can use `orjson`. MicroPie *will* use `orjson` *if installed* by default. If it is not installed, MicroPie will fallback to `json`. This means with or without `orjson` installed MicroPie will still handle JSON requests/responses the same. To install `orjson` to take advantage of it's performance use:
+```bash
+pip install orjson
+```
+
### **Install an ASGI Web Server**
In order to test and deploy your apps you will need a ASGI web server like Uvicorn, Hypercorn or Daphne. Install `uvicorn` with:
```bash