chronicle-dev 0.1.0__py3-none-any.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.
chronicle/__init__.py ADDED
@@ -0,0 +1,12 @@
1
+ """
2
+ Chronicle — AI-native development memory.
3
+
4
+ This package is a thin wrapper around the Node.js chronicle-dev CLI.
5
+ For the full API, use the CLI directly or via subprocess.
6
+
7
+ Example:
8
+ import subprocess
9
+ result = subprocess.run(["chronicle", "inject"], capture_output=True, text=True)
10
+ context = result.stdout
11
+ """
12
+ __version__ = "0.1.0"
chronicle/_cli.py ADDED
@@ -0,0 +1,64 @@
1
+ """
2
+ Subprocess wrapper — delegates all work to the Node binary (chronicle-dev).
3
+ Requires Node ≥ 20 on PATH. The Node package is the source of truth.
4
+ """
5
+ import shutil
6
+ import subprocess
7
+ import sys
8
+
9
+
10
+ def _node_available() -> bool:
11
+ node = shutil.which("node")
12
+ if not node:
13
+ return False
14
+ try:
15
+ out = subprocess.check_output(["node", "--version"], text=True).strip()
16
+ major = int(out.lstrip("v").split(".")[0])
17
+ return major >= 20
18
+ except Exception:
19
+ return False
20
+
21
+
22
+ def _chronicle_binary() -> list[str]:
23
+ """Return the command list that invokes the Node chronicle CLI.
24
+
25
+ Never calls 'chronicle' directly — that would call this Python wrapper
26
+ recursively. Always delegates to the Node package via npm/npx.
27
+ """
28
+ # If the user has `npm install -g chronicle-dev`, the Node binary lands
29
+ # at a path like /usr/local/bin/chronicle — but so does this Python script.
30
+ # We disambiguate by checking for the npm global bin explicitly.
31
+ npm = shutil.which("npm")
32
+ if npm:
33
+ try:
34
+ prefix = subprocess.check_output(
35
+ [npm, "root", "-g"], text=True, stderr=subprocess.DEVNULL
36
+ ).strip()
37
+ # npm global bin is one level up from global node_modules
38
+ import os
39
+ global_bin = os.path.join(os.path.dirname(prefix), "bin", "chronicle")
40
+ # Only use it if it's a Node script (not this Python script)
41
+ if os.path.exists(global_bin):
42
+ with open(global_bin) as f:
43
+ first_line = f.readline()
44
+ if "node" in first_line and "python" not in first_line:
45
+ return [global_bin]
46
+ except Exception:
47
+ pass
48
+
49
+ # Fallback: npx installs on-demand from npm registry
50
+ return ["npx", "--yes", "chronicle-dev"]
51
+
52
+
53
+ def main() -> None:
54
+ if not _node_available():
55
+ print(
56
+ "Chronicle requires Node.js ≥ 20.\n"
57
+ "Install it from https://nodejs.org or via `brew install node`.",
58
+ file=sys.stderr,
59
+ )
60
+ sys.exit(1)
61
+
62
+ cmd = _chronicle_binary() + sys.argv[1:]
63
+ result = subprocess.run(cmd)
64
+ sys.exit(result.returncode)
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: chronicle-dev
3
+ Version: 0.1.0
4
+ Summary: AI-native development memory — markdown RAG for every AI coding tool
5
+ Project-URL: Homepage, https://github.com/ypollak2/chronicle
6
+ Project-URL: Repository, https://github.com/ypollak2/chronicle
7
+ Project-URL: Issues, https://github.com/ypollak2/chronicle/issues
8
+ License: MIT
9
+ Keywords: ai,claude,codex,cursor,developer-tools,llm,rag
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.9
17
+ Provides-Extra: dev
18
+ Requires-Dist: pytest>=7.0; extra == 'dev'
19
+ Description-Content-Type: text/markdown
20
+
21
+ # chronicle-dev (Python)
22
+
23
+ > AI-native development memory — markdown RAG for every AI coding tool
24
+
25
+ This is the Python wrapper for [Chronicle](https://github.com/ypollak2/chronicle).
26
+ It delegates all work to the Node.js CLI (`chronicle-dev` on npm).
27
+
28
+ ## Requirements
29
+
30
+ - Python ≥ 3.9
31
+ - Node.js ≥ 20 ([install](https://nodejs.org))
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install chronicle-dev
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ Identical to the npm version:
42
+
43
+ ```bash
44
+ chronicle init # scan last 6 months of git history
45
+ chronicle inject | claude # pipe context into Claude
46
+ chronicle inject | codex # or Codex, Gemini CLI, Aider...
47
+ chronicle hooks install # passive capture on every commit
48
+ chronicle deepen --depth=1year # scan further back
49
+ ```
50
+
51
+ ## How it works
52
+
53
+ `pip install chronicle-dev` installs a `chronicle` entry point that:
54
+ 1. Checks Node ≥ 20 is available
55
+ 2. Delegates to `chronicle` (if globally installed) or `npx chronicle-dev`
56
+
57
+ The Node package is the source of truth. This wrapper exists so Python developers
58
+ can install Chronicle without switching to npm.
59
+
60
+ ## Full docs
61
+
62
+ See [github.com/ypollak2/chronicle](https://github.com/ypollak2/chronicle)
@@ -0,0 +1,6 @@
1
+ chronicle/__init__.py,sha256=jGN-JDr7EyQHNjL1TEKNrpCEjXr9L8rrhKxO9JGhmi4,347
2
+ chronicle/_cli.py,sha256=WY4r_MTqseMwdc34ubAxe8VXXZ3wxq-pjI9f3hUANYk,2203
3
+ chronicle_dev-0.1.0.dist-info/METADATA,sha256=gTB1iigbHJpAKxYR6Z6AQvorq1-Ek9qASpAn9u-Y1qs,1996
4
+ chronicle_dev-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
5
+ chronicle_dev-0.1.0.dist-info/entry_points.txt,sha256=BFypbnmnCFRbNtaFgiOxbNHjh38krA3-ySk_boiByfI,50
6
+ chronicle_dev-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ chronicle = chronicle._cli:main