feat: externalize apps/analysis to Gitea repos, add analysis table
- Migration 007: repo_url on apps table + analysis table with FTS5 - Analysis struct, parser, CRUD, validation, hash computation - Selective purge: remote-only apps/analysis preserved across fn index - CLI: fn app list/clone/pull, fn analysis list/clone/pull - search/show/list now include analysis results - Apps removed from git tracking (content lives in Gitea repos) - .gitkeep for apps/ and analysis/ dirs - Bash functions: jupyter analysis pipeline, shell utilities - Browser domain: CDP functions moved from infra to browser Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: write_jupyter_registry_kernel
|
||||
kind: function
|
||||
lang: bash
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "write_jupyter_registry_kernel([project_dir: string]) -> string"
|
||||
description: "Genera un script de startup de IPython que autoconfigura FN_REGISTRY_ROOT, sys.path a python/functions del registry, y helpers fn_query/fn_search/fn_code para consultar registry.db desde notebooks."
|
||||
tags: [jupyter, ipython, kernel, registry, setup, infra]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "bash/functions/infra/write_jupyter_registry_kernel.sh"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```bash
|
||||
source write_jupyter_registry_kernel.sh
|
||||
path=$(write_jupyter_registry_kernel /home/lucas/analysis/finanzas)
|
||||
echo "Startup creado en: $path"
|
||||
```
|
||||
|
||||
Luego en cualquier notebook del proyecto:
|
||||
|
||||
```python
|
||||
# Ya disponible automaticamente al abrir el notebook:
|
||||
|
||||
# Buscar funciones
|
||||
fn_search("finance")
|
||||
|
||||
# Consultar registry.db directamente
|
||||
fn_query("SELECT id, signature FROM functions WHERE domain = ?", ("core",))
|
||||
|
||||
# Ver codigo de una funcion
|
||||
print(fn_code("filter_list_py_core"))
|
||||
|
||||
# Importar funciones Python del registry directamente
|
||||
from core import filter_list, map_list
|
||||
from finance import sma, ema, rsi
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Genera `.ipython/profile_default/startup/00_fn_registry.py` que se ejecuta automaticamente al iniciar cualquier kernel IPython en el proyecto. No requiere imports manuales — las funciones `fn_query`, `fn_search` y `fn_code` estan disponibles inmediatamente en cada notebook.
|
||||
|
||||
El `sys.path` se configura para que cada dominio de `python/functions/` sea importable directamente (`from core import filter_list`).
|
||||
|
||||
Detecta `FN_REGISTRY_ROOT` buscando la raiz del repo git o subiendo directorios hasta encontrar `registry.db`.
|
||||
Reference in New Issue
Block a user