DeepBase
DeepBase è un tool CLI che analizza una directory di progetto, estrae la struttura delle cartelle e il contenuto dei file di codice significativi, consolidandoli in un unico file di contesto per LLM.
✨ Features
| Feature | Descrizione |
|---|---|
| 📁 Project Structure | Genera una tree view della struttura di cartelle e file |
| 🧠 Smart Filtering | Ignora automaticamente directory comuni (.git, venv, node_modules) |
| ⚡ Token Optimization (TOON) | Genera "Semantic Skeletons" (classi, firme, docstring) per risparmiare fino al 90% dei token |
| 💡 Light Mode | Modalità ultra-leggera con solo firme di metodi e commenti iniziali |
| 🔍 Hybrid Focus Mode | Combina contesto leggero per l'intero progetto con contenuto completo per file/folder specifici |
| 🗄️ Database Support | Estrae schema da database SQLite (tabelle, colonne, relazioni) |
| 🌐 Multi-Language Parsing | Supporto nativo per Python, JavaScript, TypeScript, React (JSX/TSX), Markdown, LaTeX |
| 🔧 Plugin System | Architettura a plugin per parser personalizzati |
| ⚙️ Configurable | Personalizza via file .deepbase.toml |
| 📄 Unified Output | Tutto in un unico file, facile da copiare e incollare per gli LLM |
🚀 Installation
pip install deepbase
Development Mode
git clone https://github.com/follen99/deepbase.git
cd deepbase
pip install -e ".[dev]"
📖 How to Use
1. Basic Project Analysis
Structure Only (Default)
Genera rapidamente una tree view della struttura del progetto:
deepbase .
Include All Content
Per generare il contesto completo con tutto il codice:
deepbase . --all
⚠️ Attenzione: usare solo per progetti piccoli.
2. Smart Token Optimization (TOON)
Per progetti grandi, inviare tutto il codice a un LLM è costoso. TOON estrae solo lo "scheletro" semantico:
deepbase . --toon
# oppure
deepbase . -t
Risultato: Gli LLM capiscono l'architettura usando token minimi.
3. Light Mode (Ultra-Lightweight)
Modalità ancora più leggera di TOON, include solo firme di metodi/funzioni e commenti iniziali:
deepbase . --light
# oppure
deepbase . -l
4. Hybrid Mode (Focus)
Combina TOON per l'intero progetto con contenuto completo per file specifici.
Focus via CLI:
deepbase . --toon --focus "server/controllers/*" --focus "client/src/login.js"
Focus via File:
Crea un file (es. context_task.txt):
server/routes/auth.js
server/models/User.js
client/src/components/LoginForm.jsx
Esegui:
deepbase . --toon --focus-file context_task.txt
5. Database Analysis
DeepBase può analizzare database SQLite estraendo schema e relazioni:
# Schema completo
deepbase database.db --all
# Schema in modalità TOON (solo struttura)
deepbase database.db --toon
# Focus su tabelle specifiche
deepbase database.db --toon --focus "users" --focus "orders"
6. Single File Analysis
Analisi di un singolo file:
# Solo struttura (default)
deepbase README.md
# Struttura + contenuto completo
deepbase README.md --all
# Modalità TOON
deepbase script.py --toon
🌐 Supported Languages
| Linguaggio | Estensioni | Parser |
|---|---|---|
| Python | .py |
✅ Nativo - Classi, funzioni, async, type hints, docstring |
| JavaScript | .js, .jsx |
✅ Nativo - Funzioni, classi, componenti React |
| TypeScript | .ts, .tsx |
✅ Nativo - Tipi, interfacce, generics |
| Markdown | .md |
✅ Nativo - Headers, struttura documento |
| LaTeX | .tex |
✅ Nativo - Sezioni, comandi |
| JSON | .json |
✅ Legacy - Struttura dati |
| SQLite | .db, .sqlite |
✅ Database - Schema, tabelle, colonne |
| Altri | * |
⚠️ Fallback - Prime 10 righe + warning |
⚙️ Configuration (.deepbase.toml)
Crea un file .deepbase.toml nella root del progetto:
# Directory aggiuntive da ignorare
ignore_dirs = ["my_assets", "experimental", "logs"]
# Estensioni/filename aggiuntivi da includere
significant_extensions = [".cfg", "Makefile", ".tsx", ".prisma"]
# Directory sempre incluse (anche se matchano ignore_dirs)
force_include_dirs = ["important_logs"]
📊 Output Example
# Project Context: MyProject
> Total Size (raw): 15.28 KB | Est. Tokens (light): ~3,912
📁 MyProject/
├── 📄 README.md (1.9% | ~73t)
├── 📁 src/ (65.0% | ~2.5k t)
│ ├── 📄 main.py (25.0% | ~980t)
│ └── 📄 utils.py (40.0% | ~1.5k t)
└── 📁 tests/ (33.1% | ~1.3k t)
└── 📄 test_main.py (33.1% | ~1.3k t)
### FILE CONTENTS (LIGHT — signatures only)
> FILE: src/main.py
def main() -> None: ...
class Application:
def __init__(self, config: dict): ...
def run(self) -> int: ...
🛠️ Development Workflow
# Install in editable mode
pip install -e ".[dev]"
# Run tests
pytest
# Run specific test
pytest tests/test_suite_python.py -v
📚 Documentation
La documentazione completa è disponibile su GitHub Pages:
📝 Changelog
[1.8.0] - 2024-02-12
- ✅ Parser JavaScript/TypeScript/React (JSX/TSX)
- ✅ Parser Markdown e LaTeX
- ✅ Supporto database SQLite
- ✅ Sistema plugin per parser
- ✅ Modalità Light avanzata
- ✅ Focus mode per tabelle database
[1.7.0] - 2024-02-10
- ✅ Miglioramenti al parser Python (async, type hints)
- ✅ Supporto file focus da file esterno
- ✅ Stima token più accurata
🤝 Contributing
Contributi sono benvenuti! Per favore:
- Fork il repository
- Crea un branch (
git checkout -b feature/amazing-feature) - Commit le modifiche (
git commit -m 'Add amazing feature') - Push al branch (
git push origin feature/amazing-feature) - Apri una Pull Request
📄 License
Questo progetto è rilasciato sotto licenza GPL 3. Vedi il file LICENSE per i dettagli.
Built with ❤️ by Giuliano Ranauro
Metadata
Release files for deepbase 1.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| deepbase-1.8.1.tar.gz | 65.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepbase-1.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 113.3 kB
Release files / deepbase-1.8.1.tar.gz
| Download URL | deepbase-1.8.1.tar.gz |
|---|---|
| Size | 65.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3944fb5e0bfc39c7b02fff118b9d6eba33e5fdf9c07fff13320cc9d50486427a
|
|
BLAKE2b-256 checksum How to use checksums |
f734c92ae7f9169bf945025f219165adc63aae5beeb9f7e299f48e3be2142032
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / deepbase-1.8.1-py3-none-any.whl
| Download URL | deepbase-1.8.1-py3-none-any.whl |
|---|---|
| Size | 48.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93b912ab4c893372a5bd8390df36a3a1d5170ab89455b027b18ea1c82e92b29d
|
|
BLAKE2b-256 checksum How to use checksums |
def3d79349bbe398833bf62db88427d688f1ce19ce4bb0978d535ccc49ae8f36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for deepbase 1.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.