$ pip install typed-diskcache
# or
$ pip install "typed-diskcache[asyncio]"
While python-diskcache
is a very nice library,
it has two shortcomings.
- it doesn't support type hints.
- does not support asynchronous syntax.
I know there were some requests for this, but they were rejected.
I created a stub package to solve the type hinting issue. And this time I wanted to create a wrapper that added asynchronous syntax. But I decided that if I'm going to do this, I might as well just create a new one.
The logic used is mostly the same as the original.
However, instead of using queries directly, I used sqlalchemy
.
There are some changes in the way data is stored in the DB and retrieved, so it's not exactly the same as before.
Some features were left out. This is because I don't use them. If I think I'll need them in the future, I'll add them.
This could be a performance issue. That's because my focus was on working first, not performance. I'll fix this later.
I haven't tested it yet, so I can't guarantee it will work. I'll be adding more tests over time.
- docstring
Most of it is a copy of
python-diskcache
, but it's still pretty clean.
- docs
- tests
- performance
Apache-2.0, see LICENSE.