sqlite-scanner 0.1.0__py3-none-win_arm64.whl → 0.1.1__py3-none-win_arm64.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.
@@ -5,17 +5,12 @@ import stat
5
5
  import subprocess
6
6
  import sys
7
7
 
8
- __version__ = "0.1.0"
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
- return os.path.join(os.path.dirname(__file__), "bin", "sqlite-scanner.exe")
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=l-CgrSHm7Ao7nqtdjGTMhnyb10ZYo8iWe67Zlg54rgY,2158592
4
+ sqlite_scanner-0.1.1.dist-info/METADATA,sha256=8hDg434WNg_xApTyG1aQ2QQUa0WqbOMmz16qwyHEmn0,2590
5
+ sqlite_scanner-0.1.1.dist-info/WHEEL,sha256=RM2yzFWRquAEAXaVsUwfb9bWleCWQAapuqMXyIhwCUI,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,5 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: sqlite-scanner
3
- Version: 0.1.0
4
- Summary: Go binary packaged as Python wheel
5
- Requires-Python: >=3.10
@@ -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=Kyuu45D6U5dNehId0yIdEbGb3qc1tSdYKM-2_9sAzSk,2158592
4
- sqlite_scanner-0.1.0.dist-info/METADATA,sha256=zTj4aga1ra2Gsw3TAjiJcP4FV6yGz5C8gMh5ut6oUOs,126
5
- sqlite_scanner-0.1.0.dist-info/WHEEL,sha256=RM2yzFWRquAEAXaVsUwfb9bWleCWQAapuqMXyIhwCUI,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,,