Metadata-Version: 2.4
Name: crazycontext
Version: 0.1.1
Summary: The ultimate context builder for LLM applications - multi-source gathering (web, papers, GitHub) with optional semantic search
Author: CrazyContext Team
License: Apache-2.0
Project-URL: Homepage, https://github.com/crazycontext/crazycontext
Project-URL: Documentation, https://github.com/crazycontext/crazycontext/blob/main/README.md
Project-URL: Repository, https://github.com/crazycontext/crazycontext
Project-URL: Issues, https://github.com/crazycontext/crazycontext/issues
Keywords: llm,context,rag,semantic-search,web-scraping,papers,github
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: html2text>=2020.1.16
Requires-Dist: colorama>=0.4.6
Provides-Extra: fuzzy
Requires-Dist: rapidfuzz>=3.0.0; extra == "fuzzy"
Provides-Extra: pdf
Requires-Dist: PyMuPDF>=1.23.0; extra == "pdf"
Requires-Dist: pdfplumber>=0.10.0; extra == "pdf"
Provides-Extra: github
Requires-Dist: PyGithub>=2.1.0; extra == "github"
Requires-Dist: gitpython>=3.1.40; extra == "github"
Provides-Extra: deepsearcher
Requires-Dist: deepsearcher>=0.0.2; extra == "deepsearcher"
Provides-Extra: all
Requires-Dist: rapidfuzz>=3.0.0; extra == "all"
Requires-Dist: PyMuPDF>=1.23.0; extra == "all"
Requires-Dist: pdfplumber>=0.10.0; extra == "all"
Requires-Dist: PyGithub>=2.1.0; extra == "all"
Requires-Dist: gitpython>=3.1.40; extra == "all"
Requires-Dist: deepsearcher>=0.0.2; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.1.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Dynamic: license-file

# 🚀 CrazyContext

**The ultimate context builder for LLM applications**

Multi-source context gathering (web, papers, GitHub) with optional semantic search integration.

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)

---

## ✨ Features

- 🌐 **Multi-Source Gathering** - Web, academic papers, GitHub repos, local files
- 🔍 **Flexible Search** - Keyword, fuzzy, or semantic (with Deep-Searcher)
- 📚 **GitHub Integration** - Search repos, download code, extract context
- 📄 **Format Flexibility** - HTML, Markdown, PDF, plain text
- 💾 **Smart Caching** - Download once, query forever
- 🎯 **Profile System** - Pre-optimized for research, coding, legal, etc.
- 🤖 **LLM-Ready** - Direct output for any LLM (no framework lock-in)
- 🔌 **Optional Semantic Search** - Integrate with Deep-Searcher when needed

---

## 🚀 Quick Start

### Installation

```bash
# Core installation
pip install crazycontext

# With optional features
pip install crazycontext[fuzzy]           # Fuzzy search
pip install crazycontext[pdf]             # PDF support
pip install crazycontext[github]          # GitHub integration
pip install crazycontext[deepsearcher]    # Semantic search
pip install crazycontext[all]             # Everything
```

### Basic Usage

```python
from crazycontext import CrazyContext

# Initialize
cc = CrazyContext()

# Gather context from multiple sources
context = cc.from_topic(
    "machine learning",
    sources=["web", "papers", "github"],
    max_results=20
)

# Format for LLM
prompt = context.build(format="llm_prompt")
print(prompt)
```

---

## 📖 Examples

### Download Documentation

```python
# Download and convert to Markdown
cc.from_urls([
    "https://docs.python.org/3/tutorial/",
    "https://pytorch.org/tutorials/"
])

# Search downloaded content
results = cc.search("neural networks", search_type="keyword")
```

### Academic Papers

```python
# Fetch papers from arXiv, Semantic Scholar
context = cc.from_topic(
    "transformer attention mechanisms",
    sources=["papers"],
    max_results=10
)
```

### GitHub Repositories

```python
# Search and download GitHub repos
context = cc.from_topic(
    "pytorch neural networks",
    sources=["github"],
    github_options={
        "language": "python",
        "min_stars": 500
    }
)
```

### Semantic Search (Optional)

```python
from crazycontext.bridges import CrazyContextLoader

# Initialize with Deep-Searcher integration
loader = CrazyContextLoader()

# Gather with CrazyContext, search with Deep-Searcher
loader.load_from_crazycontext(
    topic="AI",
    sources=["web", "papers", "github"]
)

# Semantic query (uses FREE Gemini embeddings!)
answer = loader.query("What is deep learning?")
print(answer['answer'])
```

---

## 🎯 Use Cases

- **Research** - Gather papers, web articles, and code examples
- **Documentation** - Download and search technical docs
- **Coding Assistants** - GitHub code examples + documentation
- **Knowledge Bases** - Multi-source context for RAG systems
- **Content Creation** - Research and fact-checking

---

## 📚 Documentation

### 🎯 Start Here
- **[Getting Started Guide](./docs/GETTING_STARTED.md)** - Installation, quick start, basic concepts
- **[Examples](./docs/EXAMPLES.md)** - Real-world use cases
- **[CLI Guide](./docs/CLI_GUIDE.md)** - Command-line interface

### 📖 Reference
- **[API Reference](./docs/API_REFERENCE.md)** - Complete API documentation
- **[Best Practices](./docs/BEST_PRACTICES.md)** - Guidelines and recommendations
- **[llm.txt](./llm.txt)** - LLM-optimized reference for AI assistants

### 📋 Full Documentation
- **[Documentation Index](./docs/README.md)** - Complete documentation overview

### 🗺️ Architecture & Design
- [Unification Plan](../CRAZYCONTEXT_UNIFICATION_PLAN.md) - Architecture & design
- [Quick Reference](../CRAZYCONTEXT_QUICK_REFERENCE.md) - API cheatsheet
- [GitHub Integration](../CRAZYCONTEXT_GITHUB_SOURCE.md) - GitHub features
- [Deep-Searcher Bridge](../CRAZYCONTEXT_AS_DEEPSEARCHER_LOADER.md) - Semantic search

---

## 🔧 Development

```bash
# Clone repository
git clone https://github.com/crazycontext/crazycontext.git
cd crazycontext

# Install in development mode
pip install -e .[dev]

# Run tests
pytest

# Format code
black crazycontext/
```

---

## 🤝 Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.

---

## 📄 License

Apache 2.0 - see [LICENSE](LICENSE) file for details.

---

## 🌟 Features Comparison

| Feature | CrazyContext Alone | + Deep-Searcher Bridge |
|---------|-------------------|----------------------|
| Multi-source gather | ✅ | ✅ |
| Keyword search | ✅ | ✅ |
| Fuzzy search | ✅ | ✅ |
| Semantic search | ❌ | ✅ |
| GitHub integration | ✅ | ✅ |
| Cost | Free | ~$0.001-0.01/query |
| Setup | Simple | Moderate |

---

## 💡 Why CrazyContext?

- **Simple** - Works out of the box, no complex setup
- **Flexible** - Use standalone or with semantic search
- **Cost-effective** - Free core, optional paid features
- **No lock-in** - Works with any LLM framework
- **Production-ready** - Battle-tested, well-documented

---

**Built with ❤️ for the LLM community**

*Making context building crazy simple!* 🎯
