repodb 0.1.0__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.
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0]
10
+
11
+ ### Added
12
+
13
+ - Moved from `misc-utils/src/py/repodb.py` and packaged, with `repodb` and `listrepos` console scripts. Rewritten on SQLite, with `gitprojects.py` folded in. Subcommands: `scan DIR` and `github USER` (via `gh repo list`) add projects; `export`/`import` move `{name: url}` JSON; `clone DEST` clones each into `DEST/<name>`, skipping names that exist; `remove OWNER/NAME|NAME ...` deletes rows, all or none, refusing a bare name two owners share, and `remove --owner USER --all` deletes all of one owner's rows, `--all` being required so one flag cannot delete many; cloned directories are kept. `info` reports format, counts, hosts, top owners and names shared across owners, opening the file read-only. `list` replaces the old flags. Rows are keyed by `(owner, name)`, owner being the first path component after the host in the URL, for any host. `--owner` filters `export`, `list` and `clone`, and `-g` groups them: `{owner: {name: url}}` JSON, an indented listing, or `DEST/<owner>/<name>`. `import` and `clone --json` read either JSON form, taking owner from the URL rather than the group key.
14
+
15
+ Owner is required (`NOT NULL`, non-empty), so local-path and `file://` remotes are skipped by `scan` and rejected by `import`. Keying on name alone let `bob/r` silently replace `alice/r`; the flat forms now reject a name held by two owners, compared case-insensitively since `Foo` and `foo` are one directory on macOS, and point to `-g`. The old `dbm` store held URLs as `Path`, which collapses `https://` to `https:/`. A table with any other primary key is refused rather than migrated. Names and owners that are not a single path component are rejected, since they would clone outside `DEST`. The default database is `~/.local/share/repodb/repos.sqlite`.
repodb-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shakeeb Alireza
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
repodb-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,61 @@
1
+ Metadata-Version: 2.3
2
+ Name: repodb
3
+ Version: 0.1.0
4
+ Summary: Keep a SQLite database of git project clone URLs, and clone from it
5
+ Keywords: git,github,sqlite,clone,cli
6
+ Author: Shakeeb Alireza
7
+ Author-email: Shakeeb Alireza <shakfu@users.noreply.github.com>
8
+ License: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: Implementation :: CPython
17
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+
22
+ # repodb
23
+
24
+ Keep a SQLite database of git project clone URLs, and clone from it.
25
+
26
+ Each project is stored as `(owner, name, url)`, keyed by `(owner, name)`. The owner is the first path component after the host (`alice` in `github.com/alice/r` or `git@gitlab.com:alice/r`), for any host.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ uv tool install git+https://github.com/shakfu/repodb
32
+ ```
33
+
34
+ This installs `repodb`, and `listrepos` as an alias for `repodb list`.
35
+
36
+ ## Usage
37
+
38
+ ```bash
39
+ repodb scan ~/src # add origin URLs of local projects
40
+ repodb github USER [--source] [--ssh] # add USER's GitHub repos (needs gh)
41
+ repodb list [-g] [-u] [--owner USER] # names, grouped by owner, or URLs
42
+ repodb export [-g] [--owner USER] -o projects.json
43
+ repodb import projects.json
44
+ repodb clone DEST [-g] [--owner USER | --json projects.json]
45
+ repodb remove OWNER/NAME [NAME ...] | --owner USER --all
46
+ repodb info # format, counts, hosts; read-only
47
+ ```
48
+
49
+ - The JSON form is `{name: url}`, or with `-g` `{owner: {name: url}}`. Both round-trip byte for byte.
50
+
51
+ - `clone` writes `DEST/<name>`, or with `-g` `DEST/<owner>/<name>`, and skips targets that exist.
52
+
53
+ - The flat forms refuse a name held by two owners, ignoring case; use `-g`.
54
+
55
+ - The database defaults to `~/.local/share/repodb/repos.sqlite`; override with `--db`.
56
+
57
+ ## Development
58
+
59
+ ```bash
60
+ make qa # ruff lint and format check, mypy, pytest
61
+ ```
repodb-0.1.0/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # repodb
2
+
3
+ Keep a SQLite database of git project clone URLs, and clone from it.
4
+
5
+ Each project is stored as `(owner, name, url)`, keyed by `(owner, name)`. The owner is the first path component after the host (`alice` in `github.com/alice/r` or `git@gitlab.com:alice/r`), for any host.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ uv tool install git+https://github.com/shakfu/repodb
11
+ ```
12
+
13
+ This installs `repodb`, and `listrepos` as an alias for `repodb list`.
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ repodb scan ~/src # add origin URLs of local projects
19
+ repodb github USER [--source] [--ssh] # add USER's GitHub repos (needs gh)
20
+ repodb list [-g] [-u] [--owner USER] # names, grouped by owner, or URLs
21
+ repodb export [-g] [--owner USER] -o projects.json
22
+ repodb import projects.json
23
+ repodb clone DEST [-g] [--owner USER | --json projects.json]
24
+ repodb remove OWNER/NAME [NAME ...] | --owner USER --all
25
+ repodb info # format, counts, hosts; read-only
26
+ ```
27
+
28
+ - The JSON form is `{name: url}`, or with `-g` `{owner: {name: url}}`. Both round-trip byte for byte.
29
+
30
+ - `clone` writes `DEST/<name>`, or with `-g` `DEST/<owner>/<name>`, and skips targets that exist.
31
+
32
+ - The flat forms refuse a name held by two owners, ignoring case; use `-g`.
33
+
34
+ - The database defaults to `~/.local/share/repodb/repos.sqlite`; override with `--db`.
35
+
36
+ ## Development
37
+
38
+ ```bash
39
+ make qa # ruff lint and format check, mypy, pytest
40
+ ```
@@ -0,0 +1,77 @@
1
+ [project]
2
+ name = "repodb"
3
+ version = "0.1.0"
4
+ description = "Keep a SQLite database of git project clone URLs, and clone from it"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ keywords = [
8
+ "git",
9
+ "github",
10
+ "sqlite",
11
+ "clone",
12
+ "cli",
13
+ ]
14
+ dependencies = []
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Programming Language :: Python :: Implementation :: CPython",
24
+ "Programming Language :: Python :: Implementation :: PyPy",
25
+ "Typing :: Typed",
26
+ ]
27
+
28
+ [project.license]
29
+ text = "MIT"
30
+
31
+ [[project.authors]]
32
+ name = "Shakeeb Alireza"
33
+ email = "shakfu@users.noreply.github.com"
34
+
35
+ [project.scripts]
36
+ repodb = "repodb.core:main"
37
+ listrepos = "repodb.core:main"
38
+
39
+ [dependency-groups]
40
+ dev = [
41
+ "mypy>=2.3.1",
42
+ "pytest>=9.1.1",
43
+ "pytest-cov>=7.1.0",
44
+ "ruff>=0.16.9",
45
+ "twine>=7.0.0",
46
+ ]
47
+
48
+ [build-system]
49
+ requires = ["uv_build>=0.12.19,<0.13"]
50
+ build-backend = "uv_build"
51
+
52
+ [tool.uv.build-backend]
53
+ module-name = "repodb"
54
+ module-root = "src"
55
+ source-include = [
56
+ "tests/**",
57
+ "CHANGELOG.md",
58
+ "LICENSE",
59
+ ]
60
+
61
+ [tool.pytest.ini_options]
62
+ testpaths = ["tests"]
63
+ filterwarnings = ["error"]
64
+
65
+ [tool.ruff]
66
+ src = [
67
+ "src",
68
+ "tests",
69
+ ]
70
+
71
+ [tool.mypy]
72
+ strict = true
73
+
74
+ [[tool.mypy.overrides]]
75
+ module = ["test_repodb"]
76
+ disallow_untyped_defs = false
77
+ disallow_untyped_calls = false
@@ -0,0 +1,69 @@
1
+
2
+
3
+
4
+ [project]
5
+ name = "repodb"
6
+ version = "0.1.0"
7
+ description = "Keep a SQLite database of git project clone URLs, and clone from it"
8
+ readme = "README.md"
9
+ license = { text = "MIT" }
10
+ authors = [
11
+ { name = "Shakeeb Alireza", email = "shakfu@users.noreply.github.com" }
12
+ ]
13
+ requires-python = ">=3.10"
14
+ keywords = ["git", "github", "sqlite", "clone", "cli"]
15
+ # This project intentionally has no runtime dependencies.
16
+ dependencies = []
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ "Programming Language :: Python :: Implementation :: CPython",
26
+ "Programming Language :: Python :: Implementation :: PyPy",
27
+ "Typing :: Typed",
28
+ ]
29
+
30
+ [project.scripts]
31
+ repodb = "repodb.core:main"
32
+ listrepos = "repodb.core:main"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "mypy>=2.3.1",
37
+ "pytest>=9.1.1",
38
+ "pytest-cov>=7.1.0",
39
+ "ruff>=0.16.9",
40
+ "twine>=7.0.0",
41
+ ]
42
+
43
+ [build-system]
44
+ requires = ["uv_build>=0.12.19,<0.13"]
45
+ build-backend = "uv_build"
46
+
47
+ [tool.uv.build-backend]
48
+ module-name = "repodb"
49
+ module-root = "src"
50
+ source-include = ["tests/**", "CHANGELOG.md", "LICENSE"]
51
+
52
+
53
+ [tool.pytest.ini_options]
54
+ testpaths = ["tests"]
55
+ # Fail on any warning, so a leaked sqlite connection (ResourceWarning) fails CI.
56
+ filterwarnings = ["error"]
57
+
58
+ [tool.ruff]
59
+ src = ["src", "tests"]
60
+
61
+ [tool.mypy]
62
+ strict = true
63
+
64
+ # Tests may omit annotations; their bodies are still type-checked. mypy
65
+ # names tests/*.py by file stem (tests/ is not a package), so list each module.
66
+ [[tool.mypy.overrides]]
67
+ module = ["test_repodb"]
68
+ disallow_untyped_defs = false
69
+ disallow_untyped_calls = false
@@ -0,0 +1,9 @@
1
+ """repodb - keep a SQLite database of git project clone URLs, and clone from it.
2
+
3
+ See `repodb.core` for the data model and command-line interface.
4
+ """
5
+
6
+ from repodb.core import GitRepoDB, main, owner_of
7
+
8
+ __all__ = ["GitRepoDB", "main", "owner_of"]
9
+ __version__ = "0.1.0"