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.0.tar.gz (12.0 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.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

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

Hashes for craftxpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de9eedf28617539434d70eeaed26060b1b7d6e94012ca2e17c173723d17002b2
MD5 be7a09ec447081197302983548154129
BLAKE2b-256 7d6423542656b2216f0e19dda04b4b1b4e7dc16850b0314707e0e81bd0c843a4

See more details on using hashes here.

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

Hashes for craftxpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c26c3314632d71306a913617aa2c0386f181666c52f64e941b369bdc04463e29
MD5 df37109c512b0fadf33fc9337d7b3433
BLAKE2b-256 f50ea1f34a5f5d6325e502d9f4ac6c59a37e3d13278fafffe29c0625e54ec54a

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