URL: https://pypi.python.org/pypi/django-cache-memoize

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

Michał Pasternak

"The fluff around" is precisely why cookiecutter was invented for.

Peter Bengtsson

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.

Peter Bengtsson

Also, best practices evolve and every time you use a template or a boilerplate solution, you either have to review it or maintain it.

Your email will never ever be published.

Previous:
Concurrent Gzip in Python October 13, 2017 Python, Linux, Docker
Next:
To enable Tracking Protection for performance November 1, 2017 Web development, Mozilla
Related by category:
How I run standalone Python in 2025 January 14, 2025 Python
get in JavaScript is the same as property in Python February 13, 2025 Python
How to resolve a git conflict in poetry.lock February 7, 2020 Python
Best practice with retries with requests April 19, 2017 Python
Related by keyword:
How to use django-cache-memoize November 3, 2017 Python, Django
Fastest Redis configuration for Django May 11, 2017 Python, Linux, Web development, Django
cache_memoize - a pretty decent cache decorator for Django September 11, 2017 Python, Web development, Django
Welcome to the world django-fancy-cache! March 1, 2013 Python, Django