Skip to content

Commit 91deea6

Browse files
author
Daniele Briggi
committed
feat: initial commit
1 parent 181bca4 commit 91deea6

18 files changed

Lines changed: 638 additions & 144 deletions

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "Python 3.10",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.10",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"ms-python.black-formatter",
8+
"ms-python.flake8",
9+
"ms-python.isort",
10+
"ms-python.vscode-pylance",
11+
"ms-python.python",
12+
"ms-python.debugpy",
13+
"ms-python.vscode-python-envs",
14+
"hbenl.vscode-test-explorer"
15+
]
16+
}
17+
}
18+
}

.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
# E203: it's a parse limit of flake8
3+
# W503,E501,E701: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#w503
4+
ignore = E203, W503, E501, E701
5+
# align to black choice
6+
max-line-length = 88

.gitignore

Lines changed: 26 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
semsearch/
2+
3+
# LLM models
4+
*.gguf
5+
16
# Byte-compiled / optimized / DLL files
27
__pycache__/
38
*.py[cod]
49
*$py.class
510

6-
# C extensions
7-
*.so
8-
911
# Distribution / packaging
1012
.Python
1113
build/
@@ -20,175 +22,55 @@ parts/
2022
sdist/
2123
var/
2224
wheels/
25+
pip-wheel-metadata/
2326
share/python-wheels/
2427
*.egg-info/
2528
.installed.cfg
2629
*.egg
2730
MANIFEST
2831

2932
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3233
*.manifest
3334
*.spec
3435

3536
# Installer logs
3637
pip-log.txt
3738
pip-delete-this-directory.txt
39+
# pytest
40+
.pytest_cache/
41+
test-results/
3842

39-
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
43+
# pytest-cov
4344
.coverage
4445
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
53-
54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
46+
htmlcov/
7747

7848
# Jupyter Notebook
7949
.ipynb_checkpoints
8050

81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
8551
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# UV
98-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
#uv.lock
102-
103-
# poetry
104-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105-
# This is especially recommended for binary packages to ensure reproducibility, and is more
106-
# commonly ignored for libraries.
107-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108-
#poetry.lock
109-
110-
# pdm
111-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112-
#pdm.lock
113-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114-
# in version control.
115-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116-
.pdm.toml
117-
.pdm-python
118-
.pdm-build/
119-
120-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121-
__pypackages__/
122-
123-
# Celery stuff
124-
celerybeat-schedule
125-
celerybeat.pid
126-
127-
# SageMath parsed files
128-
*.sage.py
129-
130-
# Environments
131-
.env
132-
.venv
133-
env/
134-
venv/
135-
ENV/
136-
env.bak/
137-
venv.bak/
138-
139-
# Spyder project settings
140-
.spyderproject
141-
.spyproject
142-
143-
# Rope project settings
144-
.ropeproject
145-
146-
# mkdocs documentation
147-
/site
52+
.python-version
14853

14954
# mypy
15055
.mypy_cache/
15156
.dmypy.json
15257
dmypy.json
15358

154-
# Pyre type checker
155-
.pyre/
156-
157-
# pytype static type analyzer
158-
.pytype/
159-
160-
# Cython debug symbols
161-
cython_debug/
162-
163-
# PyCharm
164-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166-
# and can be added to the global gitignore or merged into this file. For a more nuclear
167-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168-
#.idea/
59+
# VS Code
60+
.vscode/
16961

170-
# Abstra
171-
# Abstra is an AI-powered process automation framework.
172-
# Ignore directories containing user credentials, local state, and settings.
173-
# Learn more at https://abstra.io/docs
174-
.abstra/
175-
176-
# Visual Studio Code
177-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178-
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
180-
# you could uncomment the following to ignore the enitre vscode folder
181-
# .vscode/
62+
# SQLite database files
63+
*.db
64+
*.sqlite3
65+
*.so
18266

183-
# Ruff stuff:
184-
.ruff_cache/
67+
# Environment variables
68+
.env
69+
.env.*
18570

186-
# PyPI configuration file
187-
.pypirc
71+
# Local dev tools
72+
*.local
73+
*.log
18874

189-
# Cursor
190-
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
191-
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192-
# refer to https://docs.cursor.com/context/ignore-files
193-
.cursorignore
194-
.cursorindexingignore
75+
# MacOS
76+
.DS_Store

pyproject.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sqlite-rag"
7+
version = "0.1.0"
8+
description = "Hybird search with SQLite AI and SQLite Vector"
9+
authors = [{name = "User"}]
10+
requires-python = ">=3.10"
11+
dependencies = [
12+
"typer",
13+
"huggingface_hub",
14+
"markitdown[all]"
15+
]
16+
17+
# .. or [dependency-groups] ?
18+
[project.optional-dependencies]
19+
dev = [
20+
"pytest",
21+
"pytest-cov",
22+
"black",
23+
"flake8",
24+
]
25+
26+
[project.scripts]
27+
sqlite-rag = "src.cli:cli"
28+
29+
[tool.setuptools.packages.find]
30+
where = ["."]
31+
include = ["src*"]
32+
33+
[tool.isort]
34+
# make the tools compatible to each other
35+
profile = "black"
36+
37+
[tool.pytest.ini_options]
38+
log_level = "INFO"
39+
testpaths = [
40+
"tests"
41+
]
42+
pythonpath = [
43+
"src"
44+
]

src/__init__.py

Whitespace-only changes.

src/chunker.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sqlite3
2+
3+
from models.chunk import Chunk
4+
5+
6+
class Chunker:
7+
def __init__(self, conn: sqlite3.Connection, settings):
8+
self._conn = conn
9+
self.settings = settings
10+
11+
def chunk(self, text: str) -> list[Chunk]:
12+
# Implement chunking logic here
13+
return []

0 commit comments

Comments
 (0)