astos 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
astos-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ASTOS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
astos-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: astos
3
+ Version: 0.1.0
4
+ Summary: ASTOS — Abstract Syntax Tree Observer Service. Mapa 3D imersivo e 100% offline do seu repositório.
5
+ Author: ASTOS
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/HonoravelMacho/astos
8
+ Project-URL: Repository, https://github.com/HonoravelMacho/astos
9
+ Keywords: ast,graph,3d,three.js,webgl,cli,visualization
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Environment :: Console
13
+ Classifier: Topic :: Software Development :: Documentation
14
+ Classifier: Topic :: Scientific/Engineering :: Visualization
15
+ Requires-Python: >=3.9
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: click>=8.0
19
+ Dynamic: license-file
20
+
21
+ # ASTOS — Abstract Syntax Tree Observer Service
22
+
23
+ [![PyPI version](https://img.shields.io/pypi/v/astos?style=flat-square&color=22d3ee)](https://pypi.org/project/astos/)
24
+ [![Python](https://img.shields.io/badge/python-%3E%3D3.9-22d3ee?style=flat-square)](https://python.org)
25
+ [![Offline](https://img.shields.io/badge/offline-100%25-f472b6?style=flat-square)]()
26
+ [![License: MIT](https://img.shields.io/badge/license-MIT-fbbf24?style=flat-square)](LICENSE)
27
+
28
+ > **Observe a estrutura viva do seu código em 3D imersivo. Zero CDN. Puro WebGL Sci-Fi.**
29
+
30
+ O **ASTOS** escaneia qualquer repositório Python via AST, mapeia módulos,
31
+ importações e dependências diretas, e gera um mapa **3D orbital** (Three.js
32
+ vendorizado, 100% offline) com física de partículas, teia de aranha luminosa,
33
+ **fita RGB animada** nos links selecionados, card HUD Sci-Fi por nó e botão de
34
+ tela cheia.
35
+
36
+ ## Instalação
37
+
38
+ ```bash
39
+ pip install astos
40
+ ```
41
+
42
+ ## Uso
43
+
44
+ Dentro de qualquer repositório:
45
+
46
+ ```bash
47
+ # primeira vez: cria .astos/, analisa, gera e abre no navegador
48
+ astos
49
+
50
+ # força varredura completa do zero
51
+ astos -a
52
+ astos --all
53
+ ```
54
+
55
+ Isso gera `.astos/index.html` (arquivo único, offline) e abre automaticamente
56
+ no navegador padrão. Pressione `ESC` para sair do fullscreen.
57
+
58
+ ## O que você vê
59
+
60
+ - **Somente 3D imersivo** — esferas de neon, órbita contínua, zoom/pan/orbit.
61
+ - **Teia de aranha visível de longe** — links com feixe luminoso aditivo + opacidade alta.
62
+ - **Fita RGB animada** — fótons coloridos percorrem as arestas do nó selecionado
63
+ (toggle global `FLUXO RGB` disponível no HUD).
64
+ - **Card HUD por clique** — nome do arquivo/módulo, caminho relativo,
65
+ importações/dependências diretas e degree centrality.
66
+ - **Tema Sci-Fi/Chronos** — HUD cyberpunk dark, neon cyan/magenta, painéis foscos,
67
+ fonte monospace, scanlines + vinheta.
68
+
69
+ ## Como funciona
70
+
71
+ 1. `astos/parser.py` — varre `**/*.py`, parseia `ast.Import` / `ast.ImportFrom`,
72
+ resolve dependências locais e calcula o grau de cada módulo.
73
+ 2. `astos/generator.py` — injeta o grafo + `three.min.js` + `OrbitControls.js`
74
+ (vendorizados em `astos/vendor/`) em um HTML único, sem nenhum fetch externo.
75
+ 3. `astos/cli.py` — gerencia `.astos/`, cache incremental em
76
+ `.astos/graph.json` e abertura automática no navegador.
77
+
78
+ ## Estrutura
79
+
80
+ ```
81
+ astos/
82
+ __init__.py
83
+ cli.py # CLI `astos` / `astos -a` (click)
84
+ parser.py # AST scan -> {nodes, links}
85
+ generator.py # HTML 3D Sci-Fi offline (Three.js inline)
86
+ vendor/
87
+ three.min.js # r128 UMD (offline)
88
+ OrbitControls.js # UMD compatível com r128 (offline)
89
+ ```
90
+
91
+ ## Licença
92
+
93
+ MIT — veja [LICENSE](LICENSE).
astos-0.1.0/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # ASTOS — Abstract Syntax Tree Observer Service
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/astos?style=flat-square&color=22d3ee)](https://pypi.org/project/astos/)
4
+ [![Python](https://img.shields.io/badge/python-%3E%3D3.9-22d3ee?style=flat-square)](https://python.org)
5
+ [![Offline](https://img.shields.io/badge/offline-100%25-f472b6?style=flat-square)]()
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-fbbf24?style=flat-square)](LICENSE)
7
+
8
+ > **Observe a estrutura viva do seu código em 3D imersivo. Zero CDN. Puro WebGL Sci-Fi.**
9
+
10
+ O **ASTOS** escaneia qualquer repositório Python via AST, mapeia módulos,
11
+ importações e dependências diretas, e gera um mapa **3D orbital** (Three.js
12
+ vendorizado, 100% offline) com física de partículas, teia de aranha luminosa,
13
+ **fita RGB animada** nos links selecionados, card HUD Sci-Fi por nó e botão de
14
+ tela cheia.
15
+
16
+ ## Instalação
17
+
18
+ ```bash
19
+ pip install astos
20
+ ```
21
+
22
+ ## Uso
23
+
24
+ Dentro de qualquer repositório:
25
+
26
+ ```bash
27
+ # primeira vez: cria .astos/, analisa, gera e abre no navegador
28
+ astos
29
+
30
+ # força varredura completa do zero
31
+ astos -a
32
+ astos --all
33
+ ```
34
+
35
+ Isso gera `.astos/index.html` (arquivo único, offline) e abre automaticamente
36
+ no navegador padrão. Pressione `ESC` para sair do fullscreen.
37
+
38
+ ## O que você vê
39
+
40
+ - **Somente 3D imersivo** — esferas de neon, órbita contínua, zoom/pan/orbit.
41
+ - **Teia de aranha visível de longe** — links com feixe luminoso aditivo + opacidade alta.
42
+ - **Fita RGB animada** — fótons coloridos percorrem as arestas do nó selecionado
43
+ (toggle global `FLUXO RGB` disponível no HUD).
44
+ - **Card HUD por clique** — nome do arquivo/módulo, caminho relativo,
45
+ importações/dependências diretas e degree centrality.
46
+ - **Tema Sci-Fi/Chronos** — HUD cyberpunk dark, neon cyan/magenta, painéis foscos,
47
+ fonte monospace, scanlines + vinheta.
48
+
49
+ ## Como funciona
50
+
51
+ 1. `astos/parser.py` — varre `**/*.py`, parseia `ast.Import` / `ast.ImportFrom`,
52
+ resolve dependências locais e calcula o grau de cada módulo.
53
+ 2. `astos/generator.py` — injeta o grafo + `three.min.js` + `OrbitControls.js`
54
+ (vendorizados em `astos/vendor/`) em um HTML único, sem nenhum fetch externo.
55
+ 3. `astos/cli.py` — gerencia `.astos/`, cache incremental em
56
+ `.astos/graph.json` e abertura automática no navegador.
57
+
58
+ ## Estrutura
59
+
60
+ ```
61
+ astos/
62
+ __init__.py
63
+ cli.py # CLI `astos` / `astos -a` (click)
64
+ parser.py # AST scan -> {nodes, links}
65
+ generator.py # HTML 3D Sci-Fi offline (Three.js inline)
66
+ vendor/
67
+ three.min.js # r128 UMD (offline)
68
+ OrbitControls.js # UMD compatível com r128 (offline)
69
+ ```
70
+
71
+ ## Licença
72
+
73
+ MIT — veja [LICENSE](LICENSE).
@@ -0,0 +1,4 @@
1
+ """ASTOS — Abstract Syntax Tree Observer Service."""
2
+
3
+ __version__ = "0.1.0"
4
+ __all__ = ["__version__"]
@@ -0,0 +1,65 @@
1
+ """CLI do ASTOS: `astos` e `astos -a/--all`."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import time
7
+ import webbrowser
8
+ from pathlib import Path
9
+
10
+ import click
11
+
12
+ from .generator import generate
13
+ from .parser import scan_repository
14
+
15
+
16
+ @click.command(context_settings={"help_option_names": ["-h", "--help"]})
17
+ @click.option("-a", "--all", "full", is_flag=True,
18
+ help="Força varredura completa do zero (ignora cache incremental).")
19
+ @click.option("--no-open", is_flag=True, default=False,
20
+ help="Gera os arquivos sem abrir o navegador.")
21
+ @click.option("--path", "root", default=".", type=click.Path(exists=True, file_okay=False),
22
+ help="Raiz do repositório a analisar (padrão: diretório atual).")
23
+ def main(full: bool, no_open: bool, root: str) -> None:
24
+ """ASTOS — Abstract Syntax Tree Observer Service (3D offline)."""
25
+ repo = Path(root).resolve()
26
+ astos_dir = repo / ".astos"
27
+ index = astos_dir / "index.html"
28
+ cache = astos_dir / "graph.json"
29
+
30
+ existed = astos_dir.exists()
31
+ astos_dir.mkdir(parents=True, exist_ok=True)
32
+
33
+ if full and cache.exists():
34
+ cache.unlink()
35
+ click.echo("ASTOS :: flag -a/--all detectada — cache descartado, varredura completa do zero.")
36
+
37
+ if not existed:
38
+ click.echo(f"ASTOS :: inicializando observer em {repo}")
39
+ else:
40
+ click.echo("ASTOS :: .astos/ encontrada — atualizando dados incrementalmente...")
41
+
42
+ t0 = time.time()
43
+ graph = scan_repository(repo)
44
+ graph["meta"]["generated_in_s"] = round(time.time() - t0, 2)
45
+ graph["meta"]["full_rescan"] = bool(full) or not existed
46
+
47
+ cache.write_text(json.dumps(graph, ensure_ascii=False, indent=1), encoding="utf-8")
48
+ generate(index, graph)
49
+
50
+ click.echo(
51
+ f"ASTOS :: {len(graph['nodes'])} nós · {len(graph['links'])} arestas "
52
+ f"-> {index} (100% offline, 3D imersivo)"
53
+ )
54
+ if not no_open:
55
+ try:
56
+ webbrowser.open(index.as_uri())
57
+ click.echo("ASTOS :: interface aberta no navegador padrão.")
58
+ except Exception as exc: # noqa: BLE001
59
+ click.echo(f"ASTOS :: não foi possível abrir o navegador: {exc}")
60
+ click.echo(f"ASTOS :: abra manualmente: {index}")
61
+ click.echo("ASTOS :: dica: 'astos -a' força rescan completo · [⛶ FULLSCREEN] + ESC no HUD.")
62
+
63
+
64
+ if __name__ == "__main__":
65
+ main()