Skip to main content

Python-native intelligence, modular by design

Project description

CraftX.py

Python-native intelligence, modular by design.

Python Version License Version

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

๐Ÿงช 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


CraftX.py Logo

CraftX.py - Python-native intelligence, modular by design.

Get Started โ€ข Documentation โ€ข Examples โ€ข Community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

craftxpy-0.1.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

craftxpy-0.1.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file craftxpy-0.1.1.tar.gz.

File metadata

  • Download URL: craftxpy-0.1.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for craftxpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1994034d9bfdbd6ff2e996eb58d1e13a071f526723ed8a59b3deb45e721e9d6a
MD5 4722f470bfb6496b65e35751aa4ba1b7
BLAKE2b-256 3bae11d202445ade6ccdacc160fc38fd305002293d080115e2ce90c6eec1e772

See more details on using hashes here.

File details

Details for the file craftxpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: craftxpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for craftxpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af957c4657535b1f6caf41d1fbe6d1fe2e9e3f804e107a63238e7904031aedc2
MD5 4cb582614b72060a94e118405fdc2f7a
BLAKE2b-256 ab36c6f9fa5a067239de86904f1501e4e50f7d2fb95dbac5cb6a22ae4877f45f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page