sqlite-cache-storage
SQLite cache storage backend for botasaurus.
Installation
pip install sqlite-cache-storage
Usage
With decorators like @task, @request, @browser
from sqlite_cache_storage import SqliteCacheStorage
from botasaurus.task import task
from datetime import timedelta
# Create storage instance
sqlite_storage = SqliteCacheStorage(
db_path="cache.db"
)
@task(cache=True, expires_in=timedelta(days=1), cache_storage=sqlite_storage)
def my_scraper(data):
# scraping logic
return result
With @cache decorator
from sqlite_cache_storage import SqliteCacheStorage
from botasaurus.decorator_helpers import cache
from datetime import timedelta
# Create storage instance
sqlite_storage = SqliteCacheStorage(
db_path="cache.db"
)
# Use the decorator
@cache(expires_in=timedelta(days=1), cache_storage=sqlite_storage)
def my_function(data):
# time-consuming operation
return result
API
SqliteCacheStorage
SqliteCacheStorage(
db_path: str = 'cache.db',
table_name: str = 'botasaurus_cache'
)
Methods
get(func_name, key_data, expires_in=None)- Get cached value. Returns{"data": value}orNoneput(func_name, key_data, data)- Store value in cachedelete(func_name, key_data)- Delete cached value
License
MIT
Metadata
Release files for sqlite-cache-storage 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlite_cache_storage-1.0.2.tar.gz | 3.7 kB | Without provenance | Details for sqlite_cache_storage-1.0.2.tar.gz |
Release files / sqlite_cache_storage-1.0.2.tar.gz
| Download URL | sqlite_cache_storage-1.0.2.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d44a059445975c101c99435cc8dfaa1a3e880d90e1cdb04ec43533bbc8ec67a9
|
|
BLAKE2b-256 checksum How to use checksums |
f25db7a81bbc639e491868e88593e3801c2a9761b9b83709d0b8b0de05777d49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for sqlite-cache-storage 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.