Comments (4)
orjson supports CPython 3.7, 3.8, 3.9, 3.10, and 3.11. It distributes x86_64/amd64, aarch64/armv8, and arm7 wheels for Linux, amd64 and aarch64 wheels for macOS, and amd64 wheels for Windows. orjson does not support PyPy. Releases follow semantic versioning and serializing a new object type without an opt-in flag is considered a breaking change.
Per https://pypi.org/project/orjson/
I personally agree that a more generic setter pattern (though I'd probably use a @property
rather than a set_....
method which is more common in languages like Java) would probably be better. If this is of interest, I may be able to look at adding this if we can agree to functionally how this should be added.
Thanks 🙂
from oso.
Well, if there's always "The One True" oso at any given time, it could just be in the constructor:
oso = Oso(
json_loads: Callable[[Any], str] = json.loads,
json_dumps: Callable[[str], Any] = json.dumps
)
And it's up to the implementer to overload the default by subclass or instantiation
from oso.
Hey @bollwyvl!
Thanks for the suggestion. That sounds like a huge win. If it can be accomplished by monkeypatching, is it just a drop in replacement we could use? Do you know if it supports the same platforms/versions that we support?
Either way, sounds like having a feature like oso[orjson]
as an opt-in feature could be helpful. We definitely rely pretty heavily right now on JSON encoding/decoding.
from oso.
Welp, as oso
is already rust
-dependent, so I don't see how it could be much of a limitation. orjson
use is already fairly widespread, with some plugin support in e.g. FastAPI, django. As to what specific wheels are available? No idea, as I primarily work with (and re-package oso
for) conda-forge, where we have aarch64
and ppcle
as the most "exotic" things. Could probably support Apple Silicon, but nobody has asked (and still building under rosetta).
But again, "picking a horse" might not be as effective as "leaving an open stable," and letting downstreams do their own shim around it, with proper docs and types of what it might ask for in e.g. polar.set_json_encoder
or something.
This would leave the way for exploring options, dependent on the workload, e.g. pysimdjson
, or whatever comes out next month. To my knowledge, there isn't a performant, async-compatible JSON encoder/decoder... but then oso
doesn't do that much either.
from oso.
Related Issues (20)
- count on union crashes HOT 2
- Upgrade `sqlalchemy-oso`'s `packaging` version to support newer / more modern versions of Black HOT 1
- Drop support for Python 3.6 which is end-of-life
- Invalid state: Type `User` occurs more than once as the target of a relation HOT 2
- [Feature] Support ASP.NET Blazor Web Apps
- vscode extension not working
- Amazon Linux 2 support dropped due to glibc >= 2.28 requirement HOT 1
- Vulnerable dependency found - remove_dir_all HOT 1
- Syntax highlighting bug in Polar language server HOT 2
- Planning the next major version HOT 14
- How can I define Enum fields for register_class() HOT 3
- Constantly running into "unhandled partial" error HOT 2
- Getting all users who have a specific permission / list of permissions on a specified resource HOT 1
- ci failing on trunk
- [ask] rule match issue HOT 1
- Provide a VS Code web extension entrypoint HOT 4
- Using __dirname to locate polar_wasm_api_bg.wasm causes problems in AWS nodejs lambda
- Not installable on Python 3.12 HOT 4
- global roles
- Add support for `fmt.Stringer` implementations in Go SDK Oso methods, or propagate a warning message in instances where a type defined string is passed as the `action` argument
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oso.