Name | contextmaker JSON |
Version |
1.8.5
JSON |
| download |
home_page | None |
Summary | A simple context builder and converter toolkit |
upload_time | 2025-08-31 15:34:48 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ContextMaker
[](LICENSE)
[](https://python.org)
**ContextMaker** is a powerful Python toolkit that converts library documentation into formats optimized for AI agent ingestion. It automatically detects and processes various documentation formats including Sphinx, Jupyter notebooks, Python docstrings, and raw source code.
**Feature to enrich the CMBAgents:** Multi-Agent System for Science, Made by Cosmologists, Powered by [AG2](https://github.com/ag2ai/ag2).
## Features
- 🔍 **Automatic Format Detection**: Intelligently detects Sphinx, notebooks, docstrings, or source code
- 📚 **Multi-Format Support**: Handles Sphinx documentation, Jupyter notebooks, Python docstrings, and raw source
- 🚀 **Smart Fallbacks**: Multiple conversion methods with automatic fallbacks for maximum compatibility
- 📝 **Flexible Output**: Generate clean text (.txt) or markdown (.md) files
- 🎯 **AI-Optimized**: Output formatted specifically for Large Language Model ingestion
- 🔧 **Robust Processing**: Handles edge cases and provides detailed logging
## Supported Documentation Formats
1. **Sphinx Documentation** (Highest Priority)
- Automatic detection of `conf.py` and `index.rst`
- Support for Makefile-based builds
- Fallback to direct Sphinx building
2. **Jupyter Notebooks**
- Recursive search for `.ipynb` files
- Conversion to markdown using `jupytext`
- Integration with other documentation sources
3. **Python Docstrings**
- AST-based extraction of module, class, and function docstrings
- Structured markdown output with proper headers
4. **Raw Source Code**
- Fallback for projects without structured documentation
- Preserves code formatting and structure
## Installation
Install ContextMaker from PyPI:
```bash
python3 -m venv context_env
source context_env/bin/activate
pip install contextmaker
```
## Usage
### From the Command Line
ContextMaker automatically finds libraries on your system and generates complete documentation with function signatures and docstrings.
```bash
# Convert a library's documentation (automatic search)
contextmaker library_name
# Example: convert pixell documentation
contextmaker pixell
# Example: convert numpy documentation
contextmaker numpy
```
#### Advanced Usage
```bash
# Specify custom output path
contextmaker pixell --output ~/Documents/my_docs
# Specify manual input path (overrides automatic search)
contextmaker pixell --input_path /path/to/library/source
# Choose output format (txt or md)
contextmaker pixell --extension md
# Save directly to specified file without creating folders (rough mode)
contextmaker pixell --output ./pixell_context.txt --rough
```
#### Output
- **Default location:** `~/your_context_library/library_name.txt`
- **Content:** Complete documentation with function signatures, docstrings, examples, and API references
- **Format:** Clean text optimized for AI agent ingestion
---
### From a Python Script
You can also use ContextMaker programmatically in your Python scripts:
```python
import contextmaker
# Minimal usage (automatic search, default output path)
contextmaker.make("pixell")
# With custom output path
contextmaker.make("pixell", output_path="/tmp")
# With manual input path
contextmaker.make("pixell", input_path="/path/to/pixell/source")
# Choose output format (txt or md)
contextmaker.make("pixell", extension="md")
# Save directly to specified file without creating folders (rough mode)
contextmaker.make("pixell", output_path="./pixell_context.txt", rough=True)
```
## Examples
### Processing a Sphinx Project
```bash
contextmaker my_library --input_path /path/to/sphinx/docs
```
### Processing Notebooks Only
```bash
contextmaker tutorial_project --input_path /path/to/notebooks
```
### Custom Output Format
```bash
contextmaker numpy --extension md --output ~/my_docs
```
## Running the Jupyter Notebook
To launch and use the notebooks provided in this project, follow these steps:
1. **Install Jupyter**
If Jupyter is not already installed, you can install it with:
```bash
pip install jupyter
```
2. **Launch Jupyter Notebook**
Navigate to the project directory and run:
```bash
jupyter notebook
```
This will open the Jupyter interface in your web browser.
## Dependencies
- **Core**: Python 3.8+
- **Documentation**: Sphinx, jupytext, sphinx-rtd-theme
- **Processing**: markdownify, beautifulsoup4, html2text
- **Utilities**: rich, numpy, docutils, jinja2
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
This project uses the [CAMB](https://camb.info/) code developed by Antony Lewis and collaborators. Please see the CAMB website and documentation for more information.
Raw data
{
"_id": null,
"home_page": null,
"name": "contextmaker",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Chadi Ait Ekioui <chadiaitek2004@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/3d/c0/c671694006c971b0814ecd635152f82923ba979ad034abe43119f20eee7d/contextmaker-1.8.5.tar.gz",
"platform": null,
"description": "# ContextMaker\n\n[](LICENSE)\n[](https://python.org)\n\n**ContextMaker** is a powerful Python toolkit that converts library documentation into formats optimized for AI agent ingestion. It automatically detects and processes various documentation formats including Sphinx, Jupyter notebooks, Python docstrings, and raw source code.\n\n**Feature to enrich the CMBAgents:** Multi-Agent System for Science, Made by Cosmologists, Powered by [AG2](https://github.com/ag2ai/ag2).\n\n## Features\n\n- \ud83d\udd0d **Automatic Format Detection**: Intelligently detects Sphinx, notebooks, docstrings, or source code\n- \ud83d\udcda **Multi-Format Support**: Handles Sphinx documentation, Jupyter notebooks, Python docstrings, and raw source\n- \ud83d\ude80 **Smart Fallbacks**: Multiple conversion methods with automatic fallbacks for maximum compatibility\n- \ud83d\udcdd **Flexible Output**: Generate clean text (.txt) or markdown (.md) files\n- \ud83c\udfaf **AI-Optimized**: Output formatted specifically for Large Language Model ingestion\n- \ud83d\udd27 **Robust Processing**: Handles edge cases and provides detailed logging\n\n## Supported Documentation Formats\n\n1. **Sphinx Documentation** (Highest Priority)\n - Automatic detection of `conf.py` and `index.rst`\n - Support for Makefile-based builds\n - Fallback to direct Sphinx building\n\n2. **Jupyter Notebooks**\n - Recursive search for `.ipynb` files\n - Conversion to markdown using `jupytext`\n - Integration with other documentation sources\n\n3. **Python Docstrings**\n - AST-based extraction of module, class, and function docstrings\n - Structured markdown output with proper headers\n\n4. **Raw Source Code**\n - Fallback for projects without structured documentation\n - Preserves code formatting and structure\n\n## Installation\n\nInstall ContextMaker from PyPI:\n\n```bash\npython3 -m venv context_env\nsource context_env/bin/activate\npip install contextmaker\n```\n\n## Usage\n\n### From the Command Line\n\nContextMaker automatically finds libraries on your system and generates complete documentation with function signatures and docstrings.\n\n```bash\n# Convert a library's documentation (automatic search)\ncontextmaker library_name\n\n# Example: convert pixell documentation\ncontextmaker pixell\n\n# Example: convert numpy documentation\ncontextmaker numpy\n```\n\n#### Advanced Usage\n\n```bash\n# Specify custom output path\ncontextmaker pixell --output ~/Documents/my_docs\n\n# Specify manual input path (overrides automatic search)\ncontextmaker pixell --input_path /path/to/library/source\n\n# Choose output format (txt or md)\ncontextmaker pixell --extension md\n\n# Save directly to specified file without creating folders (rough mode)\ncontextmaker pixell --output ./pixell_context.txt --rough\n```\n\n#### Output\n\n- **Default location:** `~/your_context_library/library_name.txt`\n- **Content:** Complete documentation with function signatures, docstrings, examples, and API references\n- **Format:** Clean text optimized for AI agent ingestion\n\n---\n\n### From a Python Script\n\nYou can also use ContextMaker programmatically in your Python scripts:\n\n```python\nimport contextmaker\n\n# Minimal usage (automatic search, default output path)\ncontextmaker.make(\"pixell\")\n\n# With custom output path\ncontextmaker.make(\"pixell\", output_path=\"/tmp\")\n\n# With manual input path\ncontextmaker.make(\"pixell\", input_path=\"/path/to/pixell/source\")\n\n# Choose output format (txt or md)\ncontextmaker.make(\"pixell\", extension=\"md\")\n\n# Save directly to specified file without creating folders (rough mode)\ncontextmaker.make(\"pixell\", output_path=\"./pixell_context.txt\", rough=True)\n```\n\n## Examples\n\n### Processing a Sphinx Project\n```bash\ncontextmaker my_library --input_path /path/to/sphinx/docs\n```\n\n### Processing Notebooks Only\n```bash\ncontextmaker tutorial_project --input_path /path/to/notebooks\n```\n\n### Custom Output Format\n```bash\ncontextmaker numpy --extension md --output ~/my_docs\n```\n\n## Running the Jupyter Notebook\n\nTo launch and use the notebooks provided in this project, follow these steps:\n\n1. **Install Jupyter** \nIf Jupyter is not already installed, you can install it with:\n```bash\npip install jupyter\n```\n\n2. **Launch Jupyter Notebook** \nNavigate to the project directory and run:\n```bash\njupyter notebook\n```\nThis will open the Jupyter interface in your web browser.\n\n## Dependencies\n\n- **Core**: Python 3.8+\n- **Documentation**: Sphinx, jupytext, sphinx-rtd-theme\n- **Processing**: markdownify, beautifulsoup4, html2text\n- **Utilities**: rich, numpy, docutils, jinja2\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nThis project uses the [CAMB](https://camb.info/) code developed by Antony Lewis and collaborators. Please see the CAMB website and documentation for more information.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple context builder and converter toolkit",
"version": "1.8.5",
"project_urls": {
"Homepage": "https://github.com/chadiaitekioui/contextmaker",
"Repository": "https://github.com/chadiaitekioui/contextmaker"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "47a0db2a6fddeb9eb4b6a8d08749f8796439ba9570a97df34f5d94ed6df42686",
"md5": "1c94a4c19e3f4715b1c5339c7d23773b",
"sha256": "4a77bf2ba064b2687ec18af7136ca85c329e8a58f57e4a9ddc51384ebbfbf490"
},
"downloads": -1,
"filename": "contextmaker-1.8.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1c94a4c19e3f4715b1c5339c7d23773b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 34883,
"upload_time": "2025-08-31T15:34:47",
"upload_time_iso_8601": "2025-08-31T15:34:47.489096Z",
"url": "https://files.pythonhosted.org/packages/47/a0/db2a6fddeb9eb4b6a8d08749f8796439ba9570a97df34f5d94ed6df42686/contextmaker-1.8.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3dc0c671694006c971b0814ecd635152f82923ba979ad034abe43119f20eee7d",
"md5": "9b2230a60284c4b71ec65a7eb89b9e10",
"sha256": "ae8cad7a12df7444d12a474d229887ab128578ff32580851b2a0ae964fe9cbea"
},
"downloads": -1,
"filename": "contextmaker-1.8.5.tar.gz",
"has_sig": false,
"md5_digest": "9b2230a60284c4b71ec65a7eb89b9e10",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 27948,
"upload_time": "2025-08-31T15:34:48",
"upload_time_iso_8601": "2025-08-31T15:34:48.725798Z",
"url": "https://files.pythonhosted.org/packages/3d/c0/c671694006c971b0814ecd635152f82923ba979ad034abe43119f20eee7d/contextmaker-1.8.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 15:34:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "chadiaitekioui",
"github_project": "contextmaker",
"github_not_found": true,
"lcname": "contextmaker"
}