Released a new package today: django-cache-memoize
It's actually quite simple; a Python memoize function that uses Django's cache plus the added trick that you can invalidate the cache my doing the same function call with the same parameters if you just add .invalidate
to your function.
The history of it is from my recent Mozilla work on Symbols.
I originally copy and pasted the snippet out that in a blog post and today I extracted it out into its own project with tests, docs, CI and a setup.py
.
I'm still amazed how long it takes to make a package with all the "fluff" around it. A lot of the bits in here (like setup.py
and pytest.ini
etc) are copied from other nicely maintained Python packages. For example, I straight up copied the tox.ini
from Jannis Leidel's python-dockerflow
. The ratio of actual code writing (including tests!) is far overpowered by the package sit-ups. But I "complain with a pinch of salt" because a lot of time spent was writing documentation and that's equally as important as the code probably.
Comments
"The fluff around" is precisely why cookiecutter was invented for.
Yes and no. It's not that simple. It's not just a matter of making the files. I can get those by copying from other projects.
Also, best practices evolve and every time you use a template or a boilerplate solution, you either have to review it or maintain it.