openpraxis 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.
Files changed (33) hide show
  1. openpraxis-0.1.0/.gitignore +51 -0
  2. openpraxis-0.1.0/LICENSE +21 -0
  3. openpraxis-0.1.0/PKG-INFO +137 -0
  4. openpraxis-0.1.0/README.md +99 -0
  5. openpraxis-0.1.0/config.example.toml +20 -0
  6. openpraxis-0.1.0/pyproject.toml +74 -0
  7. openpraxis-0.1.0/src/openpraxis/__init__.py +3 -0
  8. openpraxis-0.1.0/src/openpraxis/cli.py +550 -0
  9. openpraxis-0.1.0/src/openpraxis/config.py +208 -0
  10. openpraxis-0.1.0/src/openpraxis/db.py +318 -0
  11. openpraxis-0.1.0/src/openpraxis/display.py +123 -0
  12. openpraxis-0.1.0/src/openpraxis/graph.py +102 -0
  13. openpraxis-0.1.0/src/openpraxis/llm.py +270 -0
  14. openpraxis-0.1.0/src/openpraxis/models.py +165 -0
  15. openpraxis-0.1.0/src/openpraxis/nodes/__init__.py +19 -0
  16. openpraxis-0.1.0/src/openpraxis/nodes/insight.py +28 -0
  17. openpraxis-0.1.0/src/openpraxis/nodes/practice.py +150 -0
  18. openpraxis-0.1.0/src/openpraxis/nodes/tagger.py +22 -0
  19. openpraxis-0.1.0/src/openpraxis/prompts.py +144 -0
  20. openpraxis-0.1.0/src/openpraxis/py.typed +0 -0
  21. openpraxis-0.1.0/tests/__init__.py +1 -0
  22. openpraxis-0.1.0/tests/conftest.py +166 -0
  23. openpraxis-0.1.0/tests/fixtures/sample_idea.md +16 -0
  24. openpraxis-0.1.0/tests/fixtures/sample_interview.md +18 -0
  25. openpraxis-0.1.0/tests/fixtures/sample_reflection.md +20 -0
  26. openpraxis-0.1.0/tests/fixtures/sample_report.md +16 -0
  27. openpraxis-0.1.0/tests/test_cli.py +465 -0
  28. openpraxis-0.1.0/tests/test_config.py +107 -0
  29. openpraxis-0.1.0/tests/test_db.py +300 -0
  30. openpraxis-0.1.0/tests/test_graph.py +189 -0
  31. openpraxis-0.1.0/tests/test_llm.py +123 -0
  32. openpraxis-0.1.0/tests/test_models.py +97 -0
  33. openpraxis-0.1.0/tests/test_nodes.py +173 -0
@@ -0,0 +1,51 @@
1
+ # Doc (design docs, not shipped)
2
+ doc/
3
+
4
+ # Python
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+ *.so
9
+ .Python
10
+ build/
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+
26
+ # Virtual env
27
+ .venv/
28
+ venv/
29
+ ENV/
30
+
31
+ # IDE
32
+ .idea/
33
+ .vscode/
34
+ *.swp
35
+ *.swo
36
+
37
+ # Testing / coverage
38
+ .pytest_cache/
39
+ .coverage
40
+ htmlcov/
41
+ .tox/
42
+
43
+ # Local config (contains secrets)
44
+ config.toml
45
+ *.db
46
+ *.db-journal
47
+ *.checkpoints
48
+
49
+ # OS
50
+ .DS_Store
51
+ Thumbs.db
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 OpenPraxis Contributors
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.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: openpraxis
3
+ Version: 0.1.0
4
+ Summary: AI Bandwidth Amplifier - turn notes into structured practice and actionable learning insights
5
+ Project-URL: Homepage, https://github.com/Sibo-Zhao/OpenPraxis
6
+ Project-URL: Repository, https://github.com/Sibo-Zhao/OpenPraxis
7
+ Project-URL: Issues, https://github.com/Sibo-Zhao/OpenPraxis/issues
8
+ Author: OpenPraxis Contributors
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,knowledge-management,learning,llm,practice,spaced-repetition
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Education
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Education
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: langgraph-checkpoint-sqlite>=3.0
26
+ Requires-Dist: langgraph>=0.2
27
+ Requires-Dist: openai>=1.30
28
+ Requires-Dist: pydantic>=2.6
29
+ Requires-Dist: rich>=13.0
30
+ Requires-Dist: tomli-w>=1.0
31
+ Requires-Dist: typer>=0.9.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
34
+ Requires-Dist: pytest>=8.0; extra == 'dev'
35
+ Requires-Dist: respx>=0.21; extra == 'dev'
36
+ Requires-Dist: ruff>=0.3; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # OpenPraxis
40
+
41
+ Built for applied mastery of your local knowledge bases, notes, and other multi-source materials: turn raw inputs into structured practice so you can use what you know, not just store it.
42
+
43
+ Now supports an OpenClaw-oriented knowledge assistant workflow via skills: ingest personal local knowledge into a local KB and generate retrieval practice during import, so users can actively master stored knowledge instead of only archiving it.
44
+
45
+ ## Requirements
46
+
47
+ - Python 3.11+
48
+ - LLM API Key (OpenAI / Doubao / Kimi / DeepSeek)
49
+
50
+ ## Installation
51
+
52
+ Install from PyPI:
53
+
54
+ ```bash
55
+ pip install openpraxis
56
+ ```
57
+
58
+ Or install from source (for development):
59
+
60
+ ```bash
61
+ git clone https://github.com/Sibo-Zhao/OpenPraxis.git
62
+ cd OpenPraxis
63
+ pip install -e ".[dev]"
64
+ ```
65
+
66
+ ## Configuration
67
+
68
+ Recommended first-time setup:
69
+
70
+ ```bash
71
+ praxis llm setup
72
+ praxis llm show
73
+ ```
74
+
75
+ This saves your default provider/model/api_key into `~/.openpraxis/config.toml`.
76
+ You can also edit `config.example.toml` manually and copy it to `~/.openpraxis/config.toml`.
77
+
78
+ - `openai` (default): native structured output parse
79
+ - `doubao`: native structured output parse
80
+ - `kimi` / `deepseek`: JSON mode + JSON string -> Pydantic validation
81
+
82
+ API key env vars (higher priority than `llm.api_key`):
83
+
84
+ - `OPENAI_API_KEY` for `openai`
85
+ - `ARK_API_KEY` for `doubao`
86
+ - `MOONSHOT_API_KEY` for `kimi`
87
+ - `DEEPSEEK_API_KEY` for `deepseek`
88
+
89
+ ## Usage
90
+
91
+ ```bash
92
+ praxis add <file> [--type report|interview|reflection|idea]
93
+ praxis practice <input_id>
94
+ praxis answer <scene_id> [--editor] [--file <path>]
95
+ praxis insight [<input_id>] [--type <insight_type>] [--min-intensity <n>]
96
+ praxis show <id>
97
+ praxis export [--format md|json] [--output <path>]
98
+ praxis list [--type report|interview|reflection|idea] [--limit N]
99
+ ```
100
+
101
+ ## OpenClaw + Skills
102
+
103
+ Use the bundled skill at `openclaw-knowledge-coach/` to run a CLI-first workflow for local-knowledge mastery:
104
+
105
+ - Clone and install OpenPraxis
106
+ - Configure provider/model/API key
107
+ - Import local files with `praxis add`
108
+ - Generate/re-run practice with `praxis practice`
109
+ - Submit answers with `praxis answer`
110
+ - Review/export insights with `praxis insight`, `praxis show`, and `praxis export`
111
+
112
+ The skill documents command chaining, output contracts, and exercise-generation patterns for retrieval practice on personal local knowledge bases.
113
+
114
+ `praxis add` accepts both text/markdown files and common image formats (`.png`, `.jpg`, `.webp`, ...). For images, OpenPraxis uses a vision-capable model to extract readable text first (providers: `openai` or `doubao`).
115
+
116
+ Global runtime LLM overrides (for a single command):
117
+
118
+ ```bash
119
+ praxis --provider doubao --model doubao-seed-1-6-251015 add note.md
120
+ praxis --provider kimi --model kimi-k2-turbo-preview practice <input_id>
121
+ praxis --provider deepseek --model deepseek-chat answer <scene_id> --file answer.md
122
+ ```
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ pytest
128
+ ruff check src tests
129
+ ```
130
+
131
+ ## Vision
132
+
133
+ Increase your "AI bandwidth" by converting fragmented inputs into reusable practice loops that build real transfer: faster recall, clearer decisions, better on-the-job application.
134
+
135
+ ## License
136
+
137
+ See the project repository.
@@ -0,0 +1,99 @@
1
+ # OpenPraxis
2
+
3
+ Built for applied mastery of your local knowledge bases, notes, and other multi-source materials: turn raw inputs into structured practice so you can use what you know, not just store it.
4
+
5
+ Now supports an OpenClaw-oriented knowledge assistant workflow via skills: ingest personal local knowledge into a local KB and generate retrieval practice during import, so users can actively master stored knowledge instead of only archiving it.
6
+
7
+ ## Requirements
8
+
9
+ - Python 3.11+
10
+ - LLM API Key (OpenAI / Doubao / Kimi / DeepSeek)
11
+
12
+ ## Installation
13
+
14
+ Install from PyPI:
15
+
16
+ ```bash
17
+ pip install openpraxis
18
+ ```
19
+
20
+ Or install from source (for development):
21
+
22
+ ```bash
23
+ git clone https://github.com/Sibo-Zhao/OpenPraxis.git
24
+ cd OpenPraxis
25
+ pip install -e ".[dev]"
26
+ ```
27
+
28
+ ## Configuration
29
+
30
+ Recommended first-time setup:
31
+
32
+ ```bash
33
+ praxis llm setup
34
+ praxis llm show
35
+ ```
36
+
37
+ This saves your default provider/model/api_key into `~/.openpraxis/config.toml`.
38
+ You can also edit `config.example.toml` manually and copy it to `~/.openpraxis/config.toml`.
39
+
40
+ - `openai` (default): native structured output parse
41
+ - `doubao`: native structured output parse
42
+ - `kimi` / `deepseek`: JSON mode + JSON string -> Pydantic validation
43
+
44
+ API key env vars (higher priority than `llm.api_key`):
45
+
46
+ - `OPENAI_API_KEY` for `openai`
47
+ - `ARK_API_KEY` for `doubao`
48
+ - `MOONSHOT_API_KEY` for `kimi`
49
+ - `DEEPSEEK_API_KEY` for `deepseek`
50
+
51
+ ## Usage
52
+
53
+ ```bash
54
+ praxis add <file> [--type report|interview|reflection|idea]
55
+ praxis practice <input_id>
56
+ praxis answer <scene_id> [--editor] [--file <path>]
57
+ praxis insight [<input_id>] [--type <insight_type>] [--min-intensity <n>]
58
+ praxis show <id>
59
+ praxis export [--format md|json] [--output <path>]
60
+ praxis list [--type report|interview|reflection|idea] [--limit N]
61
+ ```
62
+
63
+ ## OpenClaw + Skills
64
+
65
+ Use the bundled skill at `openclaw-knowledge-coach/` to run a CLI-first workflow for local-knowledge mastery:
66
+
67
+ - Clone and install OpenPraxis
68
+ - Configure provider/model/API key
69
+ - Import local files with `praxis add`
70
+ - Generate/re-run practice with `praxis practice`
71
+ - Submit answers with `praxis answer`
72
+ - Review/export insights with `praxis insight`, `praxis show`, and `praxis export`
73
+
74
+ The skill documents command chaining, output contracts, and exercise-generation patterns for retrieval practice on personal local knowledge bases.
75
+
76
+ `praxis add` accepts both text/markdown files and common image formats (`.png`, `.jpg`, `.webp`, ...). For images, OpenPraxis uses a vision-capable model to extract readable text first (providers: `openai` or `doubao`).
77
+
78
+ Global runtime LLM overrides (for a single command):
79
+
80
+ ```bash
81
+ praxis --provider doubao --model doubao-seed-1-6-251015 add note.md
82
+ praxis --provider kimi --model kimi-k2-turbo-preview practice <input_id>
83
+ praxis --provider deepseek --model deepseek-chat answer <scene_id> --file answer.md
84
+ ```
85
+
86
+ ## Development
87
+
88
+ ```bash
89
+ pytest
90
+ ruff check src tests
91
+ ```
92
+
93
+ ## Vision
94
+
95
+ Increase your "AI bandwidth" by converting fragmented inputs into reusable practice loops that build real transfer: faster recall, clearer decisions, better on-the-job application.
96
+
97
+ ## License
98
+
99
+ See the project repository.
@@ -0,0 +1,20 @@
1
+ # Copy to ~/.openpraxis/config.toml and fill in your values.
2
+ # You can also run: praxis llm setup
3
+ # Provider API key env vars take precedence over llm.api_key:
4
+ # - openai: OPENAI_API_KEY
5
+ # - doubao: ARK_API_KEY
6
+ # - kimi: MOONSHOT_API_KEY
7
+ # - deepseek: DEEPSEEK_API_KEY
8
+
9
+ [llm]
10
+ provider = "openai" # openai | doubao | kimi | deepseek
11
+ api_key = "sk-..."
12
+ base_url = "" # leave empty to use provider default
13
+ model = "gpt-4o"
14
+ temperature = 0.7
15
+
16
+ [storage]
17
+ data_dir = "~/.openpraxis/data"
18
+
19
+ [display]
20
+ color = true
@@ -0,0 +1,74 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "openpraxis"
7
+ version = "0.1.0"
8
+ description = "AI Bandwidth Amplifier - turn notes into structured practice and actionable learning insights"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.11"
12
+ authors = [
13
+ {name = "OpenPraxis Contributors"},
14
+ ]
15
+ keywords = ["ai", "learning", "practice", "llm", "knowledge-management", "spaced-repetition"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "Intended Audience :: Education",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: OS Independent",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Education",
27
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
+ "Typing :: Typed",
29
+ ]
30
+ dependencies = [
31
+ "typer>=0.9.0",
32
+ "rich>=13.0",
33
+ "pydantic>=2.6",
34
+ "tomli-w>=1.0",
35
+ "openai>=1.30",
36
+ "langgraph>=0.2",
37
+ "langgraph-checkpoint-sqlite>=3.0",
38
+ ]
39
+
40
+ [project.optional-dependencies]
41
+ dev = [
42
+ "pytest>=8.0",
43
+ "pytest-asyncio>=0.23",
44
+ "respx>=0.21",
45
+ "ruff>=0.3",
46
+ ]
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/Sibo-Zhao/OpenPraxis"
50
+ Repository = "https://github.com/Sibo-Zhao/OpenPraxis"
51
+ Issues = "https://github.com/Sibo-Zhao/OpenPraxis/issues"
52
+
53
+ [project.scripts]
54
+ praxis = "openpraxis.cli:app"
55
+
56
+ [tool.hatch.build.targets.wheel]
57
+ packages = ["src/openpraxis"]
58
+
59
+ [tool.hatch.build.targets.sdist]
60
+ include = [
61
+ "src/openpraxis/",
62
+ "tests/",
63
+ "README.md",
64
+ "LICENSE",
65
+ "pyproject.toml",
66
+ "config.example.toml",
67
+ ]
68
+
69
+ [tool.ruff]
70
+ target-version = "py311"
71
+ line-length = 100
72
+
73
+ [tool.pytest.ini_options]
74
+ testpaths = ["tests"]
@@ -0,0 +1,3 @@
1
+ """OpenPraxis - Turn notes into structured practice and cognitive insights."""
2
+
3
+ __version__ = "0.1.0"