sqlite-scanner 0.1.0__py3-none-win_amd64.whl → 0.1.1__py3-none-win_amd64.whl
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_scanner/__init__.py +9 -7
- sqlite_scanner/bin/sqlite-scanner.exe +0 -0
- sqlite_scanner-0.1.1.dist-info/METADATA +113 -0
- sqlite_scanner-0.1.1.dist-info/RECORD +7 -0
- sqlite_scanner-0.1.0.dist-info/METADATA +0 -5
- sqlite_scanner-0.1.0.dist-info/RECORD +0 -7
- {sqlite_scanner-0.1.0.dist-info → sqlite_scanner-0.1.1.dist-info}/WHEEL +0 -0
- {sqlite_scanner-0.1.0.dist-info → sqlite_scanner-0.1.1.dist-info}/entry_points.txt +0 -0
sqlite_scanner/__init__.py
CHANGED
|
@@ -5,17 +5,12 @@ import stat
|
|
|
5
5
|
import subprocess
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
|
-
__version__ = "0.1.
|
|
8
|
+
__version__ = "0.1.1"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def get_binary_path():
|
|
12
12
|
"""Return the path to the bundled binary."""
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def main():
|
|
17
|
-
"""Execute the bundled binary."""
|
|
18
|
-
binary = get_binary_path()
|
|
13
|
+
binary = os.path.join(os.path.dirname(__file__), "bin", "sqlite-scanner.exe")
|
|
19
14
|
|
|
20
15
|
# Ensure binary is executable on Unix
|
|
21
16
|
if sys.platform != "win32":
|
|
@@ -23,6 +18,13 @@ def main():
|
|
|
23
18
|
if not (current_mode & stat.S_IXUSR):
|
|
24
19
|
os.chmod(binary, current_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
|
25
20
|
|
|
21
|
+
return binary
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def main():
|
|
25
|
+
"""Execute the bundled binary."""
|
|
26
|
+
binary = get_binary_path()
|
|
27
|
+
|
|
26
28
|
if sys.platform == "win32":
|
|
27
29
|
# On Windows, use subprocess to properly handle signals
|
|
28
30
|
sys.exit(subprocess.call([binary] + sys.argv[1:]))
|
|
Binary file
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: sqlite-scanner
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Scan directories for SQLite databases
|
|
5
|
+
Author: Simon Willison
|
|
6
|
+
Home-page: https://github.com/simonw/sqlite-scanner
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# sqlite-scanner
|
|
11
|
+
|
|
12
|
+
`sqlite-scanner` is a tiny Go CLI that recurses through one or more directories, checks each regular file’s header bytes, and reports the ones whose first 16 bytes match `SQLite format 3\x00`. It never trusts file extensions, and it can run multiple workers in parallel for speed.
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- scans one or more positional paths or falls back to `.` when no paths are specified
|
|
17
|
+
- configurable worker pool via `--workers` (defaults to your CPU count)
|
|
18
|
+
- always prints absolute paths so results are unambiguous
|
|
19
|
+
- optional `--size` flag that appends file sizes to text output and emits JSON objects like `{"path": "...", "size": ...}`
|
|
20
|
+
- newline-delimited JSON via `--jsonl`; use `--size` to include each object's size field
|
|
21
|
+
- JSON output mode (`--json`) that pretty-prints `{"entries": [...]}` objects for downstream processing
|
|
22
|
+
- streams matches immediately as they’re discovered (plain text and pretty JSON)
|
|
23
|
+
- custom `--help` text that describes usage, examples, and notes
|
|
24
|
+
|
|
25
|
+
## Setup
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/simonw/sqlite-scanner
|
|
29
|
+
cd sqlite-scanner
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Build
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
go build -o bin/sqlite-scanner
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
Simple scan (current directory):
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bin/sqlite-scanner
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Scan `/tmp` and `$HOME`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bin/sqlite-scanner /tmp ~
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use JSON mode:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
bin/sqlite-scanner /tmp --json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Example JSON output shape:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"entries": [
|
|
63
|
+
{"path": "/abs/path/to/db1.sqlite"},
|
|
64
|
+
{"path": "/abs/path/to/db2.sqlite"}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Use newline-delimited JSON to stream objects per line (requires `--size` to include size):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bin/sqlite-scanner --jsonl ~/dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Example JSONL output shape (no size):
|
|
76
|
+
|
|
77
|
+
```jsonl
|
|
78
|
+
{"path": "/abs/path/to/db1.sqlite"}
|
|
79
|
+
{"path": "/abs/path/to/db2.sqlite"}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Example JSONL output shape (with `--size`):
|
|
83
|
+
|
|
84
|
+
```jsonl
|
|
85
|
+
{"path": "/abs/path/to/db1.sqlite", "size": 12345}
|
|
86
|
+
{"path": "/abs/path/to/db2.sqlite", "size": 67890}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Include sizes (plain text shows `(size bytes)` and JSON outputs objects) with:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
bin/sqlite-scanner --size /tmp --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Example `--size` output (plain text):
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
/abs/path/to/db1.sqlite (12345 bytes)
|
|
99
|
+
/abs/path/to/db2.sqlite (67890 bytes)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Check available flags (it prints the detailed help text added earlier; all flags use the `--flag` form):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
bin/sqlite-scanner --help
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Testing
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
go test
|
|
112
|
+
```
|
|
113
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
sqlite_scanner/__init__.py,sha256=U05S6g-X2DJjmOI1qzoJAXeEnEPEvY9y2iycuZprUeE,893
|
|
2
|
+
sqlite_scanner/__main__.py,sha256=IvTjTYhvVO6h9Jpa45i-FfzjcKcJy1jwkAZY_CkgibQ,26
|
|
3
|
+
sqlite_scanner/bin/sqlite-scanner.exe,sha256=Tjb3lInVqR4Uhde-a1-Tw5SuwaIv1o_XnQBl2QizxRg,2239488
|
|
4
|
+
sqlite_scanner-0.1.1.dist-info/METADATA,sha256=8hDg434WNg_xApTyG1aQ2QQUa0WqbOMmz16qwyHEmn0,2590
|
|
5
|
+
sqlite_scanner-0.1.1.dist-info/WHEEL,sha256=0sPxpmRKEXT8GcR93ZvdoGx2ZPyFZ51zM-uCrZygDzM,95
|
|
6
|
+
sqlite_scanner-0.1.1.dist-info/entry_points.txt,sha256=VEDuc4SNPyYZ1pNLH21X8VptjOpYan-TJ3_YW_Hyd-8,55
|
|
7
|
+
sqlite_scanner-0.1.1.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
sqlite_scanner/__init__.py,sha256=3cJSm6bNOwECAVUu5s4Do_pEK-KvbdLGwCCE-S9JieE,872
|
|
2
|
-
sqlite_scanner/__main__.py,sha256=IvTjTYhvVO6h9Jpa45i-FfzjcKcJy1jwkAZY_CkgibQ,26
|
|
3
|
-
sqlite_scanner/bin/sqlite-scanner.exe,sha256=mk8LQ7m74K6ZaNcMJbyC4w4fyaxq4bt5aSLWput5qn8,2239488
|
|
4
|
-
sqlite_scanner-0.1.0.dist-info/METADATA,sha256=zTj4aga1ra2Gsw3TAjiJcP4FV6yGz5C8gMh5ut6oUOs,126
|
|
5
|
-
sqlite_scanner-0.1.0.dist-info/WHEEL,sha256=0sPxpmRKEXT8GcR93ZvdoGx2ZPyFZ51zM-uCrZygDzM,95
|
|
6
|
-
sqlite_scanner-0.1.0.dist-info/entry_points.txt,sha256=VEDuc4SNPyYZ1pNLH21X8VptjOpYan-TJ3_YW_Hyd-8,55
|
|
7
|
-
sqlite_scanner-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|