Skip to main content

SCIC 0.2.0

SCIC (Sistema de Control de Instrucción por Comandos) registra, organiza, resuelve y ejecuta funciones Python mediante instrucciones textuales.

context1 context2 function parameters...

Una función se implementa una vez y puede consumirse desde CLI, WebGUI, DesktopGUI, API, SDK, scripts o automatizaciones.

Principios

  • El árbol sólo contiene Context y Executable.
  • Los nombres son únicos dentro de su contexto padre.
  • Una función registrada sigue siendo un callable Python ordinario.
  • Executable declara parámetros y resultados mediante DataValue.
  • Los contratos usan validación posicional explícita.
  • El registro compartido no contiene estado de navegación.
  • Cada consumidor utiliza su propia SCICSession.
  • Las interfaces controlan ayuda, presentación, progreso y procesos compuestos.
  • La API primaria de ejecución es asíncrona.

Dependencias

resourcetree >= 0.2.0, < 0.3.0
datavalue   >= 0.2.0, < 0.3.0

Instalación

python3 -m pip install .

Para desarrollo:

python3 -m pip install -e ".[test]"
pytest

Uso

from datavalue import ComplexData, PrimitiveData, ValidationMode
from scic import Executable, SCIC


def primitive(data_type, name, **constraints):
    return PrimitiveData(
        data_type=data_type,
        value=None,
        name=name,
        data_class=True,
        **constraints,
    )


def signature(name, *schemas):
    return ComplexData(
        data_type=list,
        value=None,
        name=name,
        possible_values=schemas,
        data_class=True,
        validation_mode=ValidationMode.POSITIONAL,
    )


def add(number_a: int, number_b: int) -> int:
    return number_a + number_b


scic = SCIC()
math = scic.create_context("math")

adapter = Executable(
    name="add",
    description="Suma dos enteros.",
    parameters=signature(
        "parameters",
        primitive(int, "number_a"),
        primitive(int, "number_b"),
    ),
    results=signature(
        "results",
        primitive(int, "sum"),
    ),
)

scic.register_function(
    adapter=adapter,
    function=add,
    context=math,
)

scic.freeze()
session = scic.create_session()

results = await session.execute(
    "math add 20 22"
)

assert results == [42]

Navegación relativa

await session.execute("math")
assert session.context_path == "scic/math"

results = await session.execute("add 10 5")
assert results == [15]

session.back()
session.reset()

El nombre de la raíz permite resolución absoluta sin modificar el contexto:

results = await session.execute(
    "scic math add 7 8"
)

Sesiones independientes

cli = scic.create_session()
browser_a = scic.create_session()
browser_b = scic.create_session()

cli.enter("math")
browser_a.enter("user")
browser_b.enter("text")

Todos comparten el mismo árbol y las mismas funciones, pero conservan su propio contexto activo.

Autodescripción

session.describe()
session.describe("math add")
session.list_context()
scic.export_tree()

La salida es estructurada. Cada consumidor decide si la transforma en texto, HTML, JSON, widgets o documentación.

Ejemplos

CLI:

python3 examples/cli.py

WebGUI con una sesión independiente por navegador:

python3 examples/webgui.py

Abrir:

http://localhost:8080

Límites intencionales

El núcleo no administra:

  • Presentación.
  • Permisos o roles.
  • Procesos interactivos compuestos.
  • Progreso.
  • HTTP.
  • Qt o HTML.
  • Persistencia.
  • Logging.
  • Ejecución remota.

Estas capacidades pertenecen a la aplicación o a sus consumidores.

Metadata

Release files for scic-framework 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scic-framework 0.2.3
File Size Uploaded Provenance
scic_framework-0.2.3.tar.gz 11.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scic-framework 0.2.3
File Interpreter ABI Platform
scic_framework-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / scic_framework-0.2.3.tar.gz

Download URL scic_framework-0.2.3.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0e73f9cad7431b6b2a3438c9243fdabe456bdd9bb9e592241a9c8ef7d6e12691
BLAKE2b-256 checksum
How to use checksums
a986c2f4b5cd73615a659cb5122218b6304ec48e7a7dc19f78c004947848b7d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / scic_framework-0.2.3-py3-none-any.whl

Download URL scic_framework-0.2.3-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bdc750fe8e6656a13acde6ccba6193bfe5128ebceb82c7dd2cef7e5cdd25f72
BLAKE2b-256 checksum
How to use checksums
f421b4720f7a939f176968158b724fe9053fabff1525908f3f218c2453112db3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for scic-framework 0.2.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page