Skip to main content

Una librería Python para crear diagramas de arquitectura y flujo con iconos profesionales

Project description

Flujograma

Una librería Python para generar diagramas automáticamente a partir de texto en lenguaje controlado.

Características

  • 100% Offline: No requiere conexión a internet ni servicios de IA
  • Ligero: Sin dependencias pesadas como GraphViz o herramientas externas
  • Multiidioma: Soporte para español, inglés y fácil extensión a otros idiomas
  • Lenguaje controlado: Basado en gramáticas simples, no IA completa
  • Diagramas de arquitectura: Compatible con diagrams.mingrammer.com para crear diagramas de infraestructura cloud (AWS) con sintaxis sencilla

Instalación

pip install flujograma

Uso básico

Diagramas de flujo tradicionales

from flujograma import generate_diagram

# Generar diagrama en español
generate_diagram(
    text="Si la variable es mayor a 5, entonces imprimir mensaje sino incrementar contador",
    language="es",
    filename="mi_diagrama.png"
)

# Generar diagrama en inglés
generate_diagram(
    text="If variable is greater than 5, then print message else increment counter",
    language="en", 
    filename="my_diagram.png"
)

Diagramas de arquitectura web (Web Services)

from src.flujograma.diagrams_api import Diagram, ELB, EC2, RDS, S3

# Crear arquitectura básica
with Diagram("Mi Arquitectura", filename="arquitectura.png"):
    ELB("load-balancer") >> EC2("web-server") >> RDS("database") >> S3("storage")

# Arquitectura con múltiples filas y flechas direccionales
with Diagram("Sistema Complejo", filename="sistema.png"):
    # Fila 1: Flujo principal
    ELB("lb") >> EC2("frontend") >> RDS("main-db") >> S3("files")
    # Fila 2: Con feedback (flecha izquierda ←)
    ELB("lb") >> EC2("cache") >> RDS("main-db") << EC2("analytics")
    # Fila 3: Servicios auxiliares
    ELB("lb") >> EC2("api") >> RDS("logs-db")

Operadores disponibles:

  • >> : Flecha hacia la derecha →
  • << : Flecha hacia la izquierda ←

Componentes AWS:

  • ELB("nombre") : Load Balancer (púrpura)
  • EC2("nombre") : Servidor/Aplicación (naranja)
  • RDS("nombre") : Base de datos (azul)
  • S3("nombre") : Almacenamiento (verde)

Sintaxis soportada

Español

  • Si [condición], entonces [acción]
  • Si [condición], entonces [acción] sino [acción]
  • Mientras [condición], [acción]
  • Para cada [elemento] en [lista], [acción]
  • Inicio / Fin

Inglés

  • If [condition], then [action]
  • If [condition], then [action] else [action]
  • While [condition], [action]
  • For each [element] in [list], [action]
  • Start / End

Estructura del proyecto

flujograma/
├── src/
│   └── flujograma/
│       ├── core/           # Lógica principal
│       ├── languages/      # Soporte multiidioma
│       └── renderers/      # Generadores de salida
├── tests/                  # Pruebas unitarias
├── examples/              # Ejemplos de uso
└── docs/                  # Documentación

Desarrollo

# Clonar repositorio
git clone https://github.com/CubeFreaKLab/flujograma.git
cd flujograma

# Instalar dependencias de desarrollo
pip install -e ".[dev]"

# Ejecutar pruebas
pytest

## Licencia

MIT License

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

flujograma-1.0.1.tar.gz (346.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flujograma-1.0.1-py3-none-any.whl (344.2 kB view details)

Uploaded Python 3

File details

Details for the file flujograma-1.0.1.tar.gz.

File metadata

  • Download URL: flujograma-1.0.1.tar.gz
  • Upload date:
  • Size: 346.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for flujograma-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c1ae93c3cc73a26f6e189fe333d6c3d339d46d032c360e2f9506334281d3d26d
MD5 81bda4b8870457612839024417e7ef90
BLAKE2b-256 4376939c89fe15aeb9f8045353fffc9d031e3c00b6d151ea43e27743583bdb80

See more details on using hashes here.

File details

Details for the file flujograma-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: flujograma-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 344.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for flujograma-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea7e8702b9019c7bd7043534c063536117b1c0820547782350fc3a8ba3dffb93
MD5 8107d1b086175d6db87e16a120da968e
BLAKE2b-256 a05113184018d4fc62702ad38d5c95f548fab8189e0b4ef7c773e43ede2966bb

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