In the answer to this question it was suggested that advanced users might like to develop packages directly, rather than developing in the playground and then creating separate packages -- specifically, the idea was to create cross-package helper functions without having to package / repackage, etc.
A few questions here. Some of this is pretty "out of the box," so I'm happy to do my own experimentation / research, but just wanted to ask in case there are any known issues / thoughts / best practices that come to mind.
- Is this the correct directory to be looking at for that suggestion:
/usr/share/docassemble/local3.8/lib/python3.8/site-packages/docassemble/[[package-name]]/data
? - Is there any magic to that directory, or can I use
.../site-packages/docassemble/helpers
for development of helper functions / cross-use interview stuff, and then import into.../data
as needed? - Is there a listing of the docassemble file structure somewhere in the docs (i.e. when you run the container)? There are various references to (eg.)
/usr/share/docassemble/config/
,.../docassemble/backup
, etc., in the docs, but I haven't found anything for the whole filesystem, or the docassemble layer's filesystem (obviously not necessary to lay outalpine
, for example). - Looking at the "Anatomy of a docassemble package" page of the docs, along with the "Modules folder" page, I think the CWD for the purposes of imports to the
.yml
files is.../data
? - If that's right, then if I were to create a
/usr/share/docassemble/local3.8/lib/python3.8/site-packages/docassemble/helpers/helper.py
directory and file, I could then use something like the following to importhelper.py
in a fictionalinterview.yml
file? Not saying that would be the best idea, but just asking if it might work to try to understand a bit more about docassemble... haven't fully thought through the workflow for something like this (i.e. if it might be better to just use the playground to package things up, or if there's another easier option).
---
modules:
- .....helpers.helper
---
- Presumably then I could also take the suggestion elsewhere in the docs and abstract away the code within the package by placing it in the
docassemble/packagename/data/
folder and import like this:
---
modules:
- .module
---
I suppose I could even even structure my files like this .../data/modules/module.py
, and then import with something like the following?
---
modules:
- .modules.module
---
Happy to do my own experimentation / research, but just wanted to ask in case there are any known issues / thoughts that come to mind.