py-trkpac 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,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Aryan Duntley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: py-trkpac
3
+ Version: 0.1.0
4
+ Summary: Global Python package manager with SQLite tracking
5
+ Author: Aryan Duntley
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/aryanduntley/py-trkpac
8
+ Project-URL: Repository, https://github.com/aryanduntley/py-trkpac
9
+ Project-URL: Issues, https://github.com/aryanduntley/py-trkpac/issues
10
+ Keywords: pip,package-manager,global,sqlite
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Software Development
18
+ Classifier: Topic :: System :: Installation/Setup
19
+ Requires-Python: >=3.13
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Dynamic: license-file
23
+
24
+ # py-trkpac
25
+
26
+ A global Python package manager that wraps pip with SQLite tracking. Install packages into a single shared directory, accessible from any terminal without activating a venv.
27
+
28
+ ## Why
29
+
30
+ Python's default tooling pushes you toward virtual environments for everything. That's fine for project-specific dependencies, but for packages you use everywhere (pytest, requests, httpx, etc.), you end up with dozens of venvs all containing the same libraries.
31
+
32
+ py-trkpac gives you a single managed directory for globally available Python packages. It:
33
+
34
+ - Installs packages via pip into one target directory
35
+ - Tracks every package and its dependencies in SQLite
36
+ - Enforces one version per package (no silent duplicates)
37
+ - Detects dependency conflicts before they happen
38
+ - Manages your shell config (PATH/PYTHONPATH) automatically
39
+ - Works on Ubuntu without fighting PEP 668 (`externally-managed-environment`)
40
+
41
+ You still use venvs for project-specific needs. py-trkpac handles the rest.
42
+
43
+ ## Install
44
+
45
+ ```bash
46
+ # Clone the repo
47
+ git clone https://github.com/yourusername/py-trkpac.git ~/Desktop/Projects/py-trkpac
48
+
49
+ # Create a symlink (no pip install needed)
50
+ ln -s ~/Desktop/Projects/py-trkpac/py-trkpac ~/.local/bin/py-trkpac
51
+
52
+ # Initialize — sets target directory, creates DB, updates .bashrc
53
+ py-trkpac init
54
+ ```
55
+
56
+ No external dependencies. Uses only Python stdlib (sqlite3, subprocess, argparse, pathlib, importlib.metadata).
57
+
58
+ Requires Python 3.13+.
59
+
60
+ ## Usage
61
+
62
+ ### Initialize
63
+
64
+ ```bash
65
+ py-trkpac init
66
+ py-trkpac init --target ~/my-python-libs
67
+ py-trkpac init --shell-config ~/.zshrc
68
+ ```
69
+
70
+ Sets the target directory where packages will be installed. Creates the SQLite database and adds PATH/PYTHONPATH entries to your shell config using managed marker comments.
71
+
72
+ ### Install packages
73
+
74
+ ```bash
75
+ py-trkpac install requests httpx pytest
76
+ ```
77
+
78
+ - Checks the database for existing packages before installing
79
+ - Prompts on version conflicts or when a package is already installed as a dependency
80
+ - Runs pip with `--target` and `--upgrade`
81
+ - Records all installed packages and auto-detected dependencies in the database
82
+ - Only updates the database after pip reports success
83
+
84
+ ### Install local projects
85
+
86
+ ```bash
87
+ py-trkpac install /path/to/downloaded-project
88
+ py-trkpac install ~/Desktop/Projects/my-mcp-server
89
+ ```
90
+
91
+ - Detects local directories with `pyproject.toml` or `setup.py`
92
+ - Installs via pip into the same target directory as PyPI packages
93
+ - Parses `pyproject.toml` to identify the package name and track it in the database
94
+ - Tracks the source path so you know where each local package came from
95
+ - Shows as "local" type in `py-trkpac list`
96
+ - To update after source changes, just re-run the install command
97
+
98
+ ### Remove packages
99
+
100
+ ```bash
101
+ py-trkpac remove selenium
102
+ ```
103
+
104
+ - Warns if other packages depend on the one being removed
105
+ - Cleans up files using pip's RECORD manifest
106
+ - Prompts to remove orphaned dependencies that nothing else needs
107
+
108
+ ### List packages
109
+
110
+ ```bash
111
+ py-trkpac list
112
+ ```
113
+
114
+ ```
115
+ Package Version Type Installed
116
+ --------------- ----------- ---------- ----------
117
+ aifp 0.1.0 local 2026-02-07
118
+ click 8.3.1 explicit 2026-02-07
119
+ cryptography 46.0.4 explicit 2026-02-07
120
+ certifi 2026.1.4 dependency 2026-02-07
121
+ cffi 2.0.0 dependency 2026-02-07
122
+ ...
123
+
124
+ 63 package(s): 17 explicit, 1 local, 45 dependencies
125
+ ```
126
+
127
+ ### List dependencies
128
+
129
+ ```bash
130
+ py-trkpac list-deps pytest
131
+ ```
132
+
133
+ ```
134
+ pytest==9.0.2 depends on:
135
+ packaging==26.0
136
+ iniconfig==2.3.0
137
+ pluggy==1.6.0
138
+
139
+ Required by:
140
+ pytest-cov==7.0.0
141
+ ```
142
+
143
+ ### Update packages
144
+
145
+ ```bash
146
+ py-trkpac update # update all explicit packages
147
+ py-trkpac update requests # update a specific package
148
+ ```
149
+
150
+ ### View/change config
151
+
152
+ ```bash
153
+ py-trkpac config
154
+ py-trkpac config set target_path /new/path
155
+ ```
156
+
157
+ ## How it works
158
+
159
+ ### Architecture
160
+
161
+ py-trkpac is a **policy layer** on top of pip. pip does all the real work (dependency resolution, downloading, building, installing). py-trkpac decides:
162
+
163
+ - Whether to install (conflict detection)
164
+ - Where to install (target directory)
165
+ - What to record (database tracking)
166
+ - When to prompt (user-facing decisions)
167
+
168
+ ### Database
169
+
170
+ SQLite database stored at `<target_path>/.py-trkpac.db` with three tables:
171
+
172
+ - **config** — key/value settings (target path, shell config path)
173
+ - **packages** — every installed package (name, version, explicit vs dependency, dates)
174
+ - **package_dependencies** — many-to-many join table tracking which packages depend on which
175
+
176
+ Dependencies are packages too. numpy as a dependency of torch is a row in `packages` with `is_explicit=0`, linked via `package_dependencies`.
177
+
178
+ ### Shell config management
179
+
180
+ py-trkpac manages a block in your shell config using marker comments:
181
+
182
+ ```bash
183
+ # >>> py-trkpac managed >>>
184
+ export PATH="$HOME/python-libraries/bin:$PATH"
185
+ export PYTHONPATH="$HOME/python-libraries${PYTHONPATH:+:$PYTHONPATH}"
186
+ # <<< py-trkpac managed <<<
187
+ ```
188
+
189
+ This block is added, updated, or removed idempotently. A backup of your shell config is created before the first modification.
190
+
191
+ ### Package removal
192
+
193
+ Since `pip uninstall` doesn't work with `--target` installs, py-trkpac handles removal directly by parsing the RECORD file in each package's `.dist-info` directory and deleting the listed files.
194
+
195
+ ## Project structure
196
+
197
+ ```
198
+ py-trkpac/
199
+ ├── py-trkpac # shell script entry point
200
+ ├── src/
201
+ │ └── py_trkpac/
202
+ │ ├── __init__.py # version
203
+ │ ├── __main__.py # python -m py_trkpac
204
+ │ ├── cli.py # argparse, command dispatch
205
+ │ ├── db.py # SQLite schema and operations
206
+ │ ├── installer.py # pip wrapper, metadata parsing
207
+ │ ├── shell.py # .bashrc management
208
+ │ └── utils.py # name normalization, prompts
209
+ ├── shell_configs/ # future OS support stubs
210
+ │ ├── bashrc.py
211
+ │ ├── zshrc.py
212
+ │ └── fish.py
213
+ ├── pyproject.toml
214
+ └── .gitignore
215
+ ```
216
+
217
+ ## License
218
+
219
+ MIT
@@ -0,0 +1,196 @@
1
+ # py-trkpac
2
+
3
+ A global Python package manager that wraps pip with SQLite tracking. Install packages into a single shared directory, accessible from any terminal without activating a venv.
4
+
5
+ ## Why
6
+
7
+ Python's default tooling pushes you toward virtual environments for everything. That's fine for project-specific dependencies, but for packages you use everywhere (pytest, requests, httpx, etc.), you end up with dozens of venvs all containing the same libraries.
8
+
9
+ py-trkpac gives you a single managed directory for globally available Python packages. It:
10
+
11
+ - Installs packages via pip into one target directory
12
+ - Tracks every package and its dependencies in SQLite
13
+ - Enforces one version per package (no silent duplicates)
14
+ - Detects dependency conflicts before they happen
15
+ - Manages your shell config (PATH/PYTHONPATH) automatically
16
+ - Works on Ubuntu without fighting PEP 668 (`externally-managed-environment`)
17
+
18
+ You still use venvs for project-specific needs. py-trkpac handles the rest.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ # Clone the repo
24
+ git clone https://github.com/yourusername/py-trkpac.git ~/Desktop/Projects/py-trkpac
25
+
26
+ # Create a symlink (no pip install needed)
27
+ ln -s ~/Desktop/Projects/py-trkpac/py-trkpac ~/.local/bin/py-trkpac
28
+
29
+ # Initialize — sets target directory, creates DB, updates .bashrc
30
+ py-trkpac init
31
+ ```
32
+
33
+ No external dependencies. Uses only Python stdlib (sqlite3, subprocess, argparse, pathlib, importlib.metadata).
34
+
35
+ Requires Python 3.13+.
36
+
37
+ ## Usage
38
+
39
+ ### Initialize
40
+
41
+ ```bash
42
+ py-trkpac init
43
+ py-trkpac init --target ~/my-python-libs
44
+ py-trkpac init --shell-config ~/.zshrc
45
+ ```
46
+
47
+ Sets the target directory where packages will be installed. Creates the SQLite database and adds PATH/PYTHONPATH entries to your shell config using managed marker comments.
48
+
49
+ ### Install packages
50
+
51
+ ```bash
52
+ py-trkpac install requests httpx pytest
53
+ ```
54
+
55
+ - Checks the database for existing packages before installing
56
+ - Prompts on version conflicts or when a package is already installed as a dependency
57
+ - Runs pip with `--target` and `--upgrade`
58
+ - Records all installed packages and auto-detected dependencies in the database
59
+ - Only updates the database after pip reports success
60
+
61
+ ### Install local projects
62
+
63
+ ```bash
64
+ py-trkpac install /path/to/downloaded-project
65
+ py-trkpac install ~/Desktop/Projects/my-mcp-server
66
+ ```
67
+
68
+ - Detects local directories with `pyproject.toml` or `setup.py`
69
+ - Installs via pip into the same target directory as PyPI packages
70
+ - Parses `pyproject.toml` to identify the package name and track it in the database
71
+ - Tracks the source path so you know where each local package came from
72
+ - Shows as "local" type in `py-trkpac list`
73
+ - To update after source changes, just re-run the install command
74
+
75
+ ### Remove packages
76
+
77
+ ```bash
78
+ py-trkpac remove selenium
79
+ ```
80
+
81
+ - Warns if other packages depend on the one being removed
82
+ - Cleans up files using pip's RECORD manifest
83
+ - Prompts to remove orphaned dependencies that nothing else needs
84
+
85
+ ### List packages
86
+
87
+ ```bash
88
+ py-trkpac list
89
+ ```
90
+
91
+ ```
92
+ Package Version Type Installed
93
+ --------------- ----------- ---------- ----------
94
+ aifp 0.1.0 local 2026-02-07
95
+ click 8.3.1 explicit 2026-02-07
96
+ cryptography 46.0.4 explicit 2026-02-07
97
+ certifi 2026.1.4 dependency 2026-02-07
98
+ cffi 2.0.0 dependency 2026-02-07
99
+ ...
100
+
101
+ 63 package(s): 17 explicit, 1 local, 45 dependencies
102
+ ```
103
+
104
+ ### List dependencies
105
+
106
+ ```bash
107
+ py-trkpac list-deps pytest
108
+ ```
109
+
110
+ ```
111
+ pytest==9.0.2 depends on:
112
+ packaging==26.0
113
+ iniconfig==2.3.0
114
+ pluggy==1.6.0
115
+
116
+ Required by:
117
+ pytest-cov==7.0.0
118
+ ```
119
+
120
+ ### Update packages
121
+
122
+ ```bash
123
+ py-trkpac update # update all explicit packages
124
+ py-trkpac update requests # update a specific package
125
+ ```
126
+
127
+ ### View/change config
128
+
129
+ ```bash
130
+ py-trkpac config
131
+ py-trkpac config set target_path /new/path
132
+ ```
133
+
134
+ ## How it works
135
+
136
+ ### Architecture
137
+
138
+ py-trkpac is a **policy layer** on top of pip. pip does all the real work (dependency resolution, downloading, building, installing). py-trkpac decides:
139
+
140
+ - Whether to install (conflict detection)
141
+ - Where to install (target directory)
142
+ - What to record (database tracking)
143
+ - When to prompt (user-facing decisions)
144
+
145
+ ### Database
146
+
147
+ SQLite database stored at `<target_path>/.py-trkpac.db` with three tables:
148
+
149
+ - **config** — key/value settings (target path, shell config path)
150
+ - **packages** — every installed package (name, version, explicit vs dependency, dates)
151
+ - **package_dependencies** — many-to-many join table tracking which packages depend on which
152
+
153
+ Dependencies are packages too. numpy as a dependency of torch is a row in `packages` with `is_explicit=0`, linked via `package_dependencies`.
154
+
155
+ ### Shell config management
156
+
157
+ py-trkpac manages a block in your shell config using marker comments:
158
+
159
+ ```bash
160
+ # >>> py-trkpac managed >>>
161
+ export PATH="$HOME/python-libraries/bin:$PATH"
162
+ export PYTHONPATH="$HOME/python-libraries${PYTHONPATH:+:$PYTHONPATH}"
163
+ # <<< py-trkpac managed <<<
164
+ ```
165
+
166
+ This block is added, updated, or removed idempotently. A backup of your shell config is created before the first modification.
167
+
168
+ ### Package removal
169
+
170
+ Since `pip uninstall` doesn't work with `--target` installs, py-trkpac handles removal directly by parsing the RECORD file in each package's `.dist-info` directory and deleting the listed files.
171
+
172
+ ## Project structure
173
+
174
+ ```
175
+ py-trkpac/
176
+ ├── py-trkpac # shell script entry point
177
+ ├── src/
178
+ │ └── py_trkpac/
179
+ │ ├── __init__.py # version
180
+ │ ├── __main__.py # python -m py_trkpac
181
+ │ ├── cli.py # argparse, command dispatch
182
+ │ ├── db.py # SQLite schema and operations
183
+ │ ├── installer.py # pip wrapper, metadata parsing
184
+ │ ├── shell.py # .bashrc management
185
+ │ └── utils.py # name normalization, prompts
186
+ ├── shell_configs/ # future OS support stubs
187
+ │ ├── bashrc.py
188
+ │ ├── zshrc.py
189
+ │ └── fish.py
190
+ ├── pyproject.toml
191
+ └── .gitignore
192
+ ```
193
+
194
+ ## License
195
+
196
+ MIT
@@ -0,0 +1,36 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "py-trkpac"
7
+ version = "0.1.0"
8
+ description = "Global Python package manager with SQLite tracking"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.13"
12
+ authors = [
13
+ { name = "Aryan Duntley" },
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Operating System :: POSIX :: Linux",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Software Development",
23
+ "Topic :: System :: Installation/Setup",
24
+ ]
25
+ keywords = ["pip", "package-manager", "global", "sqlite"]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/aryanduntley/py-trkpac"
29
+ Repository = "https://github.com/aryanduntley/py-trkpac"
30
+ Issues = "https://github.com/aryanduntley/py-trkpac/issues"
31
+
32
+ [project.scripts]
33
+ py-trkpac = "py_trkpac.cli:main"
34
+
35
+ [tool.setuptools.packages.find]
36
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ from py_trkpac.cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()