Hello: In a recent post to the "Scaling Ledger" thread, John Wiegley said:
I've added a "json" report to Ledger. I also have a local branch which > includes an HTTP server based on Boost.Asio. This way we can write an > HTML5 > Ledger UI entirely in Javascript, using REST to query/update the Ledger > data. I think a RESTful web service API would be a great addition to Ledger. I would enjoy contributing to its development. However, I am much happier coding in Python than in C++. I can envision coding up a Python web service wrapper over the existing Ledger Python interface. I get the impression that the Python interface is not quite solid yet, but I would also be willing to help with that however I can. This brings up some questions for the group: 1. If the REST API relied on Python support, would that be a problem? Is Python support expected to be exposed in the released version 3.0 binaries, or is the capability only meant for developers/tinkerers for the time being? 2. Because ledger commands are primarily query-oriented, it is not too hard to imagine a straightforward mapping between the functions provided by the Python API and RESTful queries. However, I know that some people get passionate about REST design principles. Are there enough people who care about such an API that we ought to have an up-front discussion about what it would look like? Is this list the right forum for such a discussion? Or should I just put something together and then publish it on my github fork for discussion after the fact? 3. Would Python library dependencies be problematic? I would probably use a microframework like web.py to implement the REST server. 4. For my own purposes, I definitely want the capability to write back to the ledger journal, i.e. there would be some PUT/POST verbs implemented. I gather that this is contrary to the Ledger philosophy, but I'm not sure about that. In the "Scaling Ledger" thread, John answered "Yep" when asked if we could *add*/remove data through the Python interface, but I'm not sure what the scope of this answer was. I have not found any journal writing code in the ledger source. Did I just miss it? 5. John (if you're here), could you expand a little on "entirely in Javascript"? Thanks for any feedback, Tim Crews
