pouya-eghbali / lambdaJSON

Serialize python standard types (function, tuple, complex, set, frozenset, range, bytes, dict with number keys, byte keys or tuple keys, and etc) with json.
GNU Lesser General Public License v3.0
9 stars 2 forks source link

Is it possible to register this library as a custom de/serializer with the standard json library ? #2

Open andrewv99 opened 4 years ago

andrewv99 commented 4 years ago

Hi,

I have a number of libraries I am using, which depend on the standard json library, but I want to be able to serialize lambdas, etc - without having to fork, modify, maintain, etc all of those libraries to directly/explicitly use this library. Is there any way I can instead register this library as a custom de/serializer with the standard json library.

Thanks

pouya-eghbali commented 4 years ago

Hi,

Should be easy to do using flatten/restore methods. I'll be able to provide examples tonight. I'll also clean up this library a little as its been years I haven't touched it and people are using it.

andrewv99 commented 4 years ago

Thanks for the response and ideas. I also found this project / approach, which might be an easy way to override the built in json module with a custom one adding support from your library:

https://github.com/rconradharris/jsondate/blob/master/jsondate/__init__.py

Thanks