from sqlitedict import SqliteDict
import sqlite3
def pdict(db_path:str|Path):
if not isinstance(db_path, Path):
db_path = Path(db_path)
if not db_path.exists():
db_path.parent.mkdir(exist_ok=True, parents=True)
conn = sqlite3.connect(db_path)
conn.execute('PRAGMA journal_mode=WAL;')
conn.commit()
conn.close()
return SqliteDict(db_path, autocommit=True)
Friday, 16 February 2024
pdict: Persistent dict (python)
Subscribe to:
Post Comments (Atom)
Languages
C, Rust, Typescript, Python aux: sql tools and libs are more important than aux
-
""" This module processes Wikipedia dump files by extracting individual articles and parsing them into a structured format, ...
-
from pathlib import Path import os def get_cache_path(app_name: str) -> Path: """Return the path for the app's c...
-
docker pull quay.io/unstructured-io/unstructured-api 20gb image. After docker-pull: docker image inspect --format '{{json .}}' ...
No comments:
Post a Comment