A simple context builder and converter toolkit
Project description
ContextMaker
Feature to enrich the CMBAgents: Multi-Agent System for Science, Made by Cosmologists, Powered by AG2.
Acknowledgments
This project uses the CAMB code developed by Antony Lewis and collaborators. Please see the CAMB website and documentation for more information.
Installation
Install ContextMaker from PyPI:
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.
# Convert a library's documentation (automatic search)
contextmaker library_name
# Example: convert pixell documentation
contextmaker pixell
# Example: convert numpy documentation
contextmaker numpy
Advanced Usage
# 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
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:
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")
# Example: choose output format (txt or md)
contextmaker.make("pixell", extension="md")
# CLI usage with extension
contextmaker pixell --extension md
Running the Jupyter Notebook
To launch and use the notebooks provided in this project, follow these steps:
- Install Jupyter
If Jupyter is not already installed, you can install it with:
pip install jupyter
- Launch Jupyter Notebook
Navigate to the project directory and run:
jupyter notebook
This will open the Jupyter interface in your web browser.
- Add Your Environment as a Jupyter Kernel (Optional but recommended)
If you are using a virtual environment, you can add it as a Jupyter kernel so you can select it in the notebook interface:
python -m ipykernel install --user --name context_env --display-name "Python (context_env)"
Then, in the Jupyter interface, select the "Python (context_env)" kernel for your notebook.
- Open the notebook
In the Jupyter interface, navigate to thenotebook/directory and open the desired.ipynbfile.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contextmaker-1.6.0.tar.gz.
File metadata
- Download URL: contextmaker-1.6.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f052ef9fb0062a07277988bb8d1015d3e01d04eca17ac577d30dbe19eabcaf08
|
|
| MD5 |
8e053cae5aecb66c21e3983b4a25b039
|
|
| BLAKE2b-256 |
a9f90f49360143f0b2c034ed62afcf750d44bd3876cabe5b3f23636eabcc1fd6
|
File details
Details for the file contextmaker-1.6.0-py3-none-any.whl.
File metadata
- Download URL: contextmaker-1.6.0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d65775ebb1fe70123c926516a230e8bcf36f37ebee649805a6b91f6214c21ab3
|
|
| MD5 |
89f4d711ef3cf92d63be3b504548f39a
|
|
| BLAKE2b-256 |
693f267dfc8629fe2bb1276e32b5ab0cc05cc182ce7ebf1f9b4def1da7adc7c1
|