Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.14']
fail-fast: false
services:
redis:
image: redis
options:
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests with pytest
run: |
pytest --cov=addok_sqlite_store --cov-report=term-missing
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ __pycache__
*.pyc
*.egg-info
.cache
dist
venv
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Yohan Boniface, DINSIC/Etalab
Copyright (c) 2019 République Française

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
develop:
pip install -e ".[dev]"

test:
python -m pytest

testcoverage:
python -m pytest --cov-report lcov --cov=addok_sqlite_store tests/

clean:
rm -rf dist/ build/

dist: clean test
python -m build

upload: dist
@if [ -z "$$(ls dist/*.whl dist/*.tar.gz 2>/dev/null)" ]; then \
echo "Error: No distribution files found. Run 'make dist' first."; \
exit 1; \
fi
twine upload dist/*
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
# Addok SQlite store plugin
# addok-sqlite-store

Store your documents into a SQlite database to save Redis RAM usage.
Addok plugin to store documents in SQLite instead of Redis to reduce memory usage.

## Features

## Install
- **SQLite storage**: Store documents in a SQLite database instead of Redis
- **Memory optimization**: Reduce Redis RAM usage for large datasets
- **Automatic registration**: Plugin registers itself when installed

pip install addok-sqlite-store
## Installation

```bash
pip install addok-sqlite-store
```

## Configuration

The plugin will register itself when installed, by setting the correct
`DOCUMENT_STORE_PYPATH`.

You want to define the path where the SQLite database will be created, by
setting `SQLITE_DB_PATH` into your local
[configuration](http://addok.readthedocs.io/en/latest/config/).
Define the path where the SQLite database will be created:

```python
SQLITE_DB_PATH = "/path/to/your/database.db"
```
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[build-system]
requires = ["setuptools>=65.0"]
build-backend = "setuptools.build_meta"

[project]
name = "addok-sqlite-store"
version = "1.0.1"
description = "Store documents in SQLite for Addok."
readme = "README.md"
authors = [
{name = "Yohan Boniface", email = "yohan.boniface@data.gouv.fr"}
]
license = "MIT"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: GIS",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
keywords = ["addok", "geocoding", "sqlite", "plugin"]
requires-python = ">=3.9"
dependencies = [
"addok",
]

[project.optional-dependencies]
dev = [
"pytest~=8.3",
"pytest-cov~=6.1",
"build~=1.2",
"twine==6.1.0",
]

[project.urls]
Homepage = "https://github.com/addok/addok-sqlite-store"

[project.entry-points."addok.ext"]
sqlite-store = "addok_sqlite_store"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
exclude = ["tests*", "venv*", ".venv*", "build*", "dist*"]

[tool.pytest.ini_options]
addopts = "-x"
40 changes: 0 additions & 40 deletions setup.py

This file was deleted.