sqlite-predict 0.0.1a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlite_predict-0.0.1a1/MANIFEST.in +3 -0
- sqlite_predict-0.0.1a1/PKG-INFO +40 -0
- sqlite_predict-0.0.1a1/README.md +23 -0
- sqlite_predict-0.0.1a1/pyproject.toml +30 -0
- sqlite_predict-0.0.1a1/setup.cfg +4 -0
- sqlite_predict-0.0.1a1/setup.py +31 -0
- sqlite_predict-0.0.1a1/sqlite_predict/__init__.py +34 -0
- sqlite_predict-0.0.1a1/sqlite_predict/predict0.dylib +0 -0
- sqlite_predict-0.0.1a1/sqlite_predict.egg-info/PKG-INFO +40 -0
- sqlite_predict-0.0.1a1/sqlite_predict.egg-info/SOURCES.txt +13 -0
- sqlite_predict-0.0.1a1/sqlite_predict.egg-info/dependency_links.txt +1 -0
- sqlite_predict-0.0.1a1/sqlite_predict.egg-info/top_level.txt +1 -0
- sqlite_predict-0.0.1a1/src/sqlite-predict.c +8767 -0
- sqlite_predict-0.0.1a1/src/sqlite3.h +14349 -0
- sqlite_predict-0.0.1a1/src/sqlite3ext.h +739 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqlite-predict
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: Prediction as a SQL primitive for SQLite: forecast, detect_anomalies, predict, with replayable receipts.
|
|
5
|
+
License: MIT OR Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/PureStorage-OpenConnect/sqlite-predict
|
|
7
|
+
Project-URL: Source, https://github.com/PureStorage-OpenConnect/sqlite-predict
|
|
8
|
+
Keywords: sqlite,forecasting,anomaly-detection,machine-learning,time-series
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: C
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Database
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# everpure-sqlite-predict
|
|
19
|
+
|
|
20
|
+
Prediction as a SQL primitive for SQLite: `forecast()`, `detect_anomalies()`,
|
|
21
|
+
`predict()`, with replayable receipts. The wheel bundles the zero-dependency
|
|
22
|
+
loadable extension for your platform.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
import sqlite3
|
|
26
|
+
from everpure import sqlite_predict
|
|
27
|
+
|
|
28
|
+
db = sqlite3.connect(":memory:")
|
|
29
|
+
sqlite_predict.load(db)
|
|
30
|
+
|
|
31
|
+
db.execute("CREATE TABLE readings(ts TEXT, value REAL)")
|
|
32
|
+
# ... insert rows ...
|
|
33
|
+
for row in db.execute(
|
|
34
|
+
"SELECT * FROM forecast('SELECT ts, value FROM readings', 24)"
|
|
35
|
+
):
|
|
36
|
+
print(row)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See the [project README](https://github.com/PureStorage-OpenConnect/sqlite-predict)
|
|
40
|
+
for the full SQL surface, models, and benchmarks.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# everpure-sqlite-predict
|
|
2
|
+
|
|
3
|
+
Prediction as a SQL primitive for SQLite: `forecast()`, `detect_anomalies()`,
|
|
4
|
+
`predict()`, with replayable receipts. The wheel bundles the zero-dependency
|
|
5
|
+
loadable extension for your platform.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
import sqlite3
|
|
9
|
+
from everpure import sqlite_predict
|
|
10
|
+
|
|
11
|
+
db = sqlite3.connect(":memory:")
|
|
12
|
+
sqlite_predict.load(db)
|
|
13
|
+
|
|
14
|
+
db.execute("CREATE TABLE readings(ts TEXT, value REAL)")
|
|
15
|
+
# ... insert rows ...
|
|
16
|
+
for row in db.execute(
|
|
17
|
+
"SELECT * FROM forecast('SELECT ts, value FROM readings', 24)"
|
|
18
|
+
):
|
|
19
|
+
print(row)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
See the [project README](https://github.com/PureStorage-OpenConnect/sqlite-predict)
|
|
23
|
+
for the full SQL surface, models, and benchmarks.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sqlite-predict"
|
|
7
|
+
version = "0.0.1a1"
|
|
8
|
+
description = "Prediction as a SQL primitive for SQLite: forecast, detect_anomalies, predict, with replayable receipts."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "MIT OR Apache-2.0" }
|
|
12
|
+
keywords = ["sqlite", "forecasting", "anomaly-detection", "machine-learning", "time-series"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Programming Language :: C",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Database",
|
|
19
|
+
"Topic :: Scientific/Engineering",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
Homepage = "https://github.com/PureStorage-OpenConnect/sqlite-predict"
|
|
24
|
+
Source = "https://github.com/PureStorage-OpenConnect/sqlite-predict"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools]
|
|
27
|
+
packages = ["sqlite_predict"]
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.package-data]
|
|
30
|
+
sqlite_predict = ["predict0.*"]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Compile the bundled amalgamation into a loadable SQLite extension and ship it
|
|
2
|
+
inside the wheel. `src/` (the amalgamation + SQLite ext headers) is populated by
|
|
3
|
+
`make python-src` from the repo root, and is present in the sdist."""
|
|
4
|
+
import os
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
from setuptools import setup
|
|
9
|
+
from setuptools.command.build_py import build_py
|
|
10
|
+
|
|
11
|
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
12
|
+
EXT = {"darwin": "dylib", "win32": "dll"}.get(sys.platform, "so")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Build(build_py):
|
|
16
|
+
def run(self):
|
|
17
|
+
src = os.path.join(HERE, "src", "sqlite-predict.c")
|
|
18
|
+
if not os.path.exists(src):
|
|
19
|
+
raise SystemExit(
|
|
20
|
+
"src/sqlite-predict.c is missing; run `make python-src` from the"
|
|
21
|
+
" repo root to generate the amalgamation into this package")
|
|
22
|
+
out = os.path.join(HERE, "sqlite_predict", "predict0." + EXT)
|
|
23
|
+
cc = os.environ.get("CC", "cc")
|
|
24
|
+
flags = ["-O2", "-shared"] if sys.platform == "win32" \
|
|
25
|
+
else ["-O3", "-fPIC", "-shared"]
|
|
26
|
+
subprocess.check_call([cc, *flags, "-I", os.path.join(HERE, "src"),
|
|
27
|
+
src, "-o", out])
|
|
28
|
+
super().run()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
setup(cmdclass={"build_py": Build})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""everpure.sqlite_predict: prediction as a SQL primitive.
|
|
2
|
+
|
|
3
|
+
import sqlite3
|
|
4
|
+
import sqlite_predict
|
|
5
|
+
|
|
6
|
+
db = sqlite3.connect(":memory:")
|
|
7
|
+
sqlite_predict.load(db)
|
|
8
|
+
db.execute("SELECT * FROM forecast('SELECT ts, value FROM readings', 24)")
|
|
9
|
+
|
|
10
|
+
The wheel bundles the zero-dependency loadable extension for your platform.
|
|
11
|
+
"""
|
|
12
|
+
import os
|
|
13
|
+
|
|
14
|
+
__version__ = "0.0.1a1"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def loadable_path() -> str:
|
|
18
|
+
"""Absolute path to the bundled loadable extension, without a file suffix
|
|
19
|
+
(the form SQLite's load_extension prefers: it appends the platform suffix
|
|
20
|
+
and derives the entry point)."""
|
|
21
|
+
here = os.path.dirname(os.path.abspath(__file__))
|
|
22
|
+
for ext in ("dylib", "so", "dll"):
|
|
23
|
+
if os.path.exists(os.path.join(here, "predict0." + ext)):
|
|
24
|
+
return os.path.join(here, "predict0")
|
|
25
|
+
raise FileNotFoundError(
|
|
26
|
+
"the sqlite-predict loadable was not bundled in this install")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def load(conn) -> None:
|
|
30
|
+
"""Load sqlite-predict into a connection that exposes SQLite's
|
|
31
|
+
enable_load_extension / load_extension (e.g. a stdlib sqlite3.Connection)."""
|
|
32
|
+
conn.enable_load_extension(True)
|
|
33
|
+
conn.load_extension(loadable_path())
|
|
34
|
+
conn.enable_load_extension(False)
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqlite-predict
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: Prediction as a SQL primitive for SQLite: forecast, detect_anomalies, predict, with replayable receipts.
|
|
5
|
+
License: MIT OR Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/PureStorage-OpenConnect/sqlite-predict
|
|
7
|
+
Project-URL: Source, https://github.com/PureStorage-OpenConnect/sqlite-predict
|
|
8
|
+
Keywords: sqlite,forecasting,anomaly-detection,machine-learning,time-series
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: C
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Database
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# everpure-sqlite-predict
|
|
19
|
+
|
|
20
|
+
Prediction as a SQL primitive for SQLite: `forecast()`, `detect_anomalies()`,
|
|
21
|
+
`predict()`, with replayable receipts. The wheel bundles the zero-dependency
|
|
22
|
+
loadable extension for your platform.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
import sqlite3
|
|
26
|
+
from everpure import sqlite_predict
|
|
27
|
+
|
|
28
|
+
db = sqlite3.connect(":memory:")
|
|
29
|
+
sqlite_predict.load(db)
|
|
30
|
+
|
|
31
|
+
db.execute("CREATE TABLE readings(ts TEXT, value REAL)")
|
|
32
|
+
# ... insert rows ...
|
|
33
|
+
for row in db.execute(
|
|
34
|
+
"SELECT * FROM forecast('SELECT ts, value FROM readings', 24)"
|
|
35
|
+
):
|
|
36
|
+
print(row)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See the [project README](https://github.com/PureStorage-OpenConnect/sqlite-predict)
|
|
40
|
+
for the full SQL surface, models, and benchmarks.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
sqlite_predict/__init__.py
|
|
6
|
+
sqlite_predict/predict0.dylib
|
|
7
|
+
sqlite_predict.egg-info/PKG-INFO
|
|
8
|
+
sqlite_predict.egg-info/SOURCES.txt
|
|
9
|
+
sqlite_predict.egg-info/dependency_links.txt
|
|
10
|
+
sqlite_predict.egg-info/top_level.txt
|
|
11
|
+
src/sqlite-predict.c
|
|
12
|
+
src/sqlite3.h
|
|
13
|
+
src/sqlite3ext.h
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sqlite_predict
|