Files
@ 76f2707aacf7
Branch filter:
Location: NPO-Accounting/import2ledger/TODO.rst - annotation
76f2707aacf7
2.0 KiB
text/x-rst
hooks.ledger_entry: New hook to output Ledger entries.
This is roughly the smallest diff necessary to move output to a hook.
There's a lot of code reorganization that should still happen to bring it
better in line with this new structure.
This is roughly the smallest diff necessary to move output to a hook.
There's a lot of code reorganization that should still happen to bring it
better in line with this new structure.
ceba336665eb ceba336665eb ceba336665eb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 8696ca33d636 8696ca33d636 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 8696ca33d636 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 8696ca33d636 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 73b50097a2cb 8696ca33d636 73b50097a2cb 73b50097a2cb | TODO
====
Template multiplexing with action hooks
---------------------------------------
The big idea: make it easier for hooks to customize *what* template(s) are rendered by moving more of the process into hooks—including template rendering itself.
Required:
* Make the main loop seed the entry data with information about the importer used.
* Move template rendering into a hook, where the template to load is determined by a value in the entry data.
Extra customizations after that's done:
* Add a hook that simply reads information from a configuration file section ``[template variables]`` and adds it to the entry data.
* Add a hook that changes what template to use based on other entry data. (This needs more specification.)
New importers
-------------
* Stripe import via API
* YourCause
* Network for Good
Other feature requests
----------------------
* Some way of preventing re-imports
User niceties
-------------
These haven't been requested yet but it's easy to imagine how they make the program more user-friendly.
* ``load_hooks`` and ``skip_hooks`` configuration options to limit what hooks are used.
Setting ``load_hooks`` means "skip everything not in this list."
Not setting ``load_hooks`` means "only skip what's listed in ``skip_hooks``."
If neither setting is set, ``skip_hooks`` should default to a list of hooks that have business-specific logic (currently just ``add_entity``).
If a hook is listed in both, it's either skipped or a configuration error (TBD).
* Try all importers even after one fails
* Clean up error reporting on bad configuration file syntax.
Code infrastructure
-------------------
* Open files for import in binary mode; add a text-wrapping importer base
* Write a utility dict transformer. Given a source dictionary, it returns something like ``{new_key: transform(source[old_key]) for old_key, transform, new_key in configuration}``.
A lot of the CSV importers are doing this ad hoc now, so refactoring out a common way to do it could help speed up development of future importers.
|