Python-native intelligence, modular by design
Project description
CraftX.py
Python-native intelligence, modular by design.
CraftX.py is a modular AI scripting framework designed specifically for Python developers. It provides seamless integration with multiple AI models, secure automation tools, and an extensible plugin architecture.
๐ Features
- ๐ค Multi-Model Support: Integrate WizardCoder, CommandR7B, CodeGeeX4, and Qwen2.5-Coder
- ๐ง Modular Tools: Extensible plugin system with built-in utilities
- ๐ก๏ธ Secure Execution: Safe shell commands with whitelist protection
- ๐พ Memory System: Persistent conversation history and session management
- ๐จ Beautiful UI: Modern Streamlit-based interface
- ๐ Python-Native: Clean APIs with type hints and pythonic design
๐ฆ Installation
Quick Start
git clone https://github.com/davidanderson01/CraftX.py.git
cd CraftX.py
pip install -r requirements.txt
Development Installation
pip install -e .[dev]
๐ฏ Quick Start
1. Basic Usage
from craftxpy.agents.router import AgentRouter
from craftxpy.plugins.wizardcoder import WizardCoder
# Initialize AI model router
router = AgentRouter({"codegen": WizardCoder()})
# Generate code
response = router.route("codegen", "Create a FastAPI endpoint for user auth")
print(response)
2. Web Interface
streamlit run assistant_ui/app.py
3. Run Demo
python examples/demo.py
๐๏ธ Architecture
craftxpy/
โโโ agents/ # AI model routing and management
โโโ plugins/ # Model integrations and tools
โ โโโ wizardcoder.py
โ โโโ commandr7b.py
โ โโโ codegeex4.py
โ โโโ qwen25coder.py
โ โโโ tools/ # Extensible tool plugins
โโโ memory/ # Conversation logging and history
โโโ utils/ # Utilities (shell, page builder)
โโโ assistant_ui/ # Streamlit web interface
๐ง Built-in Tools
- ๐ DNS Validator: Validate domain resolution
- ๐ SSL Checker: Check certificate status and expiration
- ๐ File Monitor: Monitor OneDrive file hydration (Windows)
- ๐ ๏ธ Custom Tools: Easy plugin creation system
๐ก Creating Custom Tools
python scripts/new_tool.py "My Custom Tool"
Or programmatically:
from craftxpy.plugins.tools.base_tool import BaseTool
class MyTool(BaseTool):
def run(self, **kwargs) -> str:
return "โ
Tool executed successfully!"
๐จ Web Interface
The Streamlit-based interface provides:
- Real-time Chat: Interactive AI conversations
- Model Switching: Choose between different AI models
- Tool Integration: Access all tools through the UI
- Session Management: Persistent conversation history
- Developer Mode: Safe shell execution and debugging
๐ก๏ธ Security Features
- Command Whitelisting: Only approved shell commands can execute
- Input Validation: All inputs are validated and sanitized
- Error Handling: Comprehensive error handling and logging
- Session Isolation: Each session is isolated and secure
๐ Documentation
- Website: https://craftx.py
- Documentation: https://docs.craftx.py
๐งช Testing
# Run all tests with beautiful output
python run_tests.py
# Run with pytest
python -m pytest tests/ -v
# Run specific test
python -m pytest tests/test_ui.py::test_logo_files -v
๐ Static Website
CraftX.py includes a complete static website with:
- Landing Page (
index.html) - Professional project showcase - Documentation (
docs.html) - Complete API and usage docs - Examples (
examples.html) - Code samples and tutorials - About Page (
about.html) - Project information and stats
To view locally:
# Simple HTTP server
python -m http.server 8000
# Then visit: http://localhost:8000
The website is also GitHub Pages ready with automatic deployment.
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
git clone https://github.com/davidanderson01/CraftX.py.git
cd CraftX.py
pip install -e .[dev]
pre-commit install
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- AI Models: Thanks to the teams behind WizardCoder, CommandR7B, CodeGeeX4, and Qwen2.5-Coder
- Framework: Built with Streamlit, Python, and modern web technologies
- Community: Special thanks to all contributors and early adopters
๐ Links
- GitHub: github.com/davidanderson01/CraftX.py
- PyPI: pypi.org/project/craftxpy
- Docker: hub.docker.com/r/craftx/craftxpy
CraftX.py - Python-native intelligence, modular by design.
Get Started โข Documentation โข Examples โข Community
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 craftxpy-0.1.0.tar.gz.
File metadata
- Download URL: craftxpy-0.1.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de9eedf28617539434d70eeaed26060b1b7d6e94012ca2e17c173723d17002b2
|
|
| MD5 |
be7a09ec447081197302983548154129
|
|
| BLAKE2b-256 |
7d6423542656b2216f0e19dda04b4b1b4e7dc16850b0314707e0e81bd0c843a4
|
File details
Details for the file craftxpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: craftxpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c26c3314632d71306a913617aa2c0386f181666c52f64e941b369bdc04463e29
|
|
| MD5 |
df37109c512b0fadf33fc9337d7b3433
|
|
| BLAKE2b-256 |
f50ea1f34a5f5d6325e502d9f4ac6c59a37e3d13278fafffe29c0625e54ec54a
|