knowark / facturark

Facturación Electrónica en Python
GNU Lesser General Public License v3.0
3 stars 4 forks source link

[Feature] Unbuild function #12

Closed blaggacao closed 5 years ago

blaggacao commented 5 years ago

To provide true electronic invoicing experience, we need an unbuild function which would reverse the xml into a python dict of the corresponding API version. So that people can provide a XML or ZIP and the invoice will be auto populated with the provided values (as much as possible).

blaggacao commented 5 years ago

Would that mean: accompany every def compose with a something like a def uncompose?

blaggacao commented 5 years ago

Or is this a (hidden) API implemented in the analyzer?

tebanep commented 5 years ago

Or is this a (hidden) API implemented in the analyzer?

The Analyzer in fact reverses an XML into Python data structures but it doesn't actually produces a full Python dict from its input. XML carries with it much more information that a simple naive json/dict could handle, so a baseline of what should be parsed must be established. I agree that facturark should have this functionality. Maybe, the component to be created could use the Analyzer underneath.

blaggacao commented 5 years ago

I don't dare to put it on my todo list, but if everything goes well, and I'm in a flow, who knows...