|
From: Michael K. <mk...@ya...> - 2024-01-29 03:22:52
|
Hi Ben, I utilize the following approach to serialize JSON to and from QuantLib calls; however, this process relies on the QuantLibAddinCpp-Old interface. By using the GenSrc package, I create serializable Python classes and C++ classes to make QuantLibAddin interface calls. This approach enables me to serialize JSON to C++/QuantLibAddin and build REST services that invoke QuantLib. Project - ql_rest: https://github.com/mkipnis/ql_rest QuantLibAddin - OLD https://github.com/eehlers/QuantLibAddin-Old GenSrc - https://github.com/eehlers/QuantLibAddin-Old/tree/master/gensrc Example of the generated serializable Python file: https://github.com/mkipnis/ql_rest/blob/master/qlrest/python_package/src/ql_rest/vanillaswap.py Example of the generated C++ file that de-serializes JSON to QuantLibAddin calls: https://github.com/mkipnis/ql_rest/blob/master/qlrest/vanillaswap_reader.cpp Use cases: Pricing of US Government bonds over the REST-API : https://github.com/mkipnis/ql_rest/tree/master/Examples/bond_pricer https://ustreasuries.online <https://ustreasuries.online/> Pricing options from the React front-end through the Django proxy: https://github.com/mkipnis/ql_rest/tree/master/Examples/options_monitor https://www.greeksandvols.com Hope this helps, Mike > On Jan 26, 2024, at 7:21 AM, qua...@li... wrote: > > Send QuantLib-users mailing list submissions to > qua...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/quantlib-users > or, via email, send a message with subject or body 'help' to > qua...@li... > > You can reach the person managing the list at > qua...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of QuantLib-users digest..." > Today's Topics: > > 1. Re: [Quantlib-dev] Serialization of Quantlib in Python > (Luigi Ballabio) > > From: Luigi Ballabio <lui...@gm...> > Subject: Re: [Quantlib-users] [Quantlib-dev] Serialization of Quantlib in Python > Date: January 25, 2024 at 10:27:59 AM EST > To: Ben Watson <ben...@ma...> > Cc: QuantLib users <qua...@li...>, QuantLib developers <qua...@li...>, QuantLib announce <qua...@li...> > > > Hello Ben, > no, as you guessed there's no serializer in C++. > > Best, > Luigi > > > On Tue, Jan 23, 2024 at 8:21 AM Ben Watson <ben...@ma... <mailto:ben...@ma...>> wrote: >> I probably know the answer to this already, but I have a number of use cases to serialise Quantlib objects. I do know that it is possible with QuantlibXL. But I have not see anything viable for python. Is there a C++ serialiser? If so is there any possibility to port it to Python? >> >> I am working on an interface to Quantlib will have all of the parameters in JSON and can easily reconstruct the objects, but this is just parameter serialization. Ideally having full object serialization would be the go. >> >> Regards >> >> Ben >> >> >> >> >> >> _______________________________________________ >> QuantLib-dev mailing list >> Qua...@li... <mailto:Qua...@li...> >> https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |