Skip to main content

Teloce-Py

<p align="center"> <img src="https://raw.githubusercontent.com/Flaxon-labs/teloce-py/main/assets/py-teloce.jpg" alt="Teloce-Py logo" width="160"/> </p>

<p align="center"> Build interactive Python apps with <code>.vel</code> components. No Node.js required. </p>

<p align="center"> <a href="https://pypi.org/project/teloce-py/"><img src="https://img.shields.io/pypi/v/teloce-py" alt="PyPI version"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a> <a href="https://github.com/aldanedev-create/teloce-py/blob/main/docs/README.md"><img src="https://img.shields.io/badge/docs-read-green" alt="Documentation"></a> </p>

Teloce-Py compiles a template, browser behavior, and scoped CSS from a single .vel file into plain browser assets. Your Python framework (Flask, FastAPI, Django, or Flaxon) keeps handling routes, APIs, databases, auth, and security.

Features

  • Single-file components: Template, script, and scoped style in one .vel file.
  • Bring your own backend: Works with Flask, FastAPI, Django, and Flaxon.
  • No Node.js: Production builds use MinifyJS, a native esbuild engine bundled in the wheel.
  • Fast builds: Tree shaking, mangling, code splitting, source maps, and hashed assets.

Teloce Ecosystem

Teloce is designed to support both Python-based application development and JavaScript-based workflows.

Teloce-Py

Teloce-Py is the Python implementation. It lets developers build applications using .vel single-file components without requiring Node.js.

It integrates with Python web frameworks and handles component compilation, scoped styles, browser assets, and production builds.

Teloce-NPM

Teloce-NPM is the companion npm project for the Teloce ecosystem.

It provides npm-based tooling and packages for developers working with Teloce and JavaScript-based projects. It complements Teloce-Py by supporting workflows outside the Python package environment.

Explore Teloce-NPM:

The Three.js example demonstrates using Teloce-NPM in a project with Three.js.

Together, Teloce-Py and Teloce-NPM provide different ways to work with the Teloce ecosystem.

Getting Started

Install:

python -m pip install teloce-py Flask

Create static/js/App.vel:

<script>
export default {
  data() { return { count: 0 }; },
  methods: {
    increment() { this.count += 1; }
  }
};
</script>

<template>
  <button @click="increment">Clicked {{ count }} times</button>
</template>

Create app.py:

from pathlib import Path
from flask import Flask, render_template
from teloce.build import build_project

ROOT = Path(__file__).parent
build_project(ROOT, out_dir=ROOT / "dist", options={"dev": True})

app = Flask(
    __name__,
    static_folder="dist/static",
    static_url_path="/static"
)

@app.get("/")
def home():
    return render_template("app.html")

if __name__ == "__main__":
    app.run(debug=True)

Create templates/app.html:

<!doctype html>
<html>
  <body>
    <div id="app"></div>
    <script type="module">
      import { mount } from "{{ url_for('static', filename='js/App.js') }}";
      mount("#app");
    </script>
  </body>
</html>

Run it and open http://127.0.0.1:5000:

python app.py

Project Structure

my-app/
├── app.py
├── teloce.config.json
├── static/
│   └── js/
│       └── App.vel       # Your source
├── templates/
│   └── app.html          # HTML shell with #app mount
└── dist/                 # Generated, never edit by hand

Production Build

teloce lint --strict
teloce build --source-map --hash-assets --bundle --report

Teloce strips common TypeScript syntax during compilation. The optional teloce typecheck command checks scripts and supported template expressions with PyTSCheck.

Documentation

Status

Teloce-Py is in beta. Pin your version and test generated assets on your target framework and platform.

License

MIT

Runtime Contributor Checks

The JavaScript runtime uses JSDoc types with a development-only checker:

npm ci --ignore-scripts
npm run typecheck

See coverage and workflow.

Runtime files stay .js; Python application users do not need Node or TypeScript.

Optional Component Type Checking

On Python 3.11+, install:

pip install "teloce-py[typecheck]"

Then run:

teloce typecheck ui

Or use JSON output for CI:

teloce typecheck ui --json

This checks TypeScript script blocks, .ts files/declarations, and supported template expressions using the bundled PyTSCheck compiler.

See the type-checking guide for API examples, diagnostic locations, optional dependency handling, and prototype limits.

Plain JavaScript components are skipped. Project tsconfig settings and dependency declarations are inherited automatically; object-style props infer supported constructor types. Props passed to statically imported TypeScript children are validated. Array-style prop values, dynamic children, and some import forms remain limited.

You can also explore this Teloce-NPM Three.js example.

Metadata

Release files for teloce-py 0.3.2

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

Source distribution (sdist)

Source distribution for teloce-py 0.3.2
File Size Uploaded Provenance Actions
teloce_py-0.3.2.tar.gz 334.2 kB Without provenance Details for teloce_py-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for teloce-py 0.3.2
File Interpreter ABI Platform Actions
teloce_py-0.3.2-py3-none-any.whl Python 3 none any Details for teloce_py-0.3.2-py3-none-any.whl

Total release size: 713.0 kB

Release files / teloce_py-0.3.2.tar.gz

Download URL teloce_py-0.3.2.tar.gz
Size 334.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cad97600fbc47ea496fa3b595f031b3cf76e48b04e2518bf7c659ed6dc3428ad
BLAKE2b-256 checksum
How to use checksums
4c8fee449e701d583450df481abd7e333c1ab27e2c2e10cdbadee7ec871cafe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / teloce_py-0.3.2-py3-none-any.whl

Download URL teloce_py-0.3.2-py3-none-any.whl
Size 378.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2489257bc52d1da14c80eab9a109ce3409956579489b468ae465efdc10c5b9c
BLAKE2b-256 checksum
How to use checksums
ae09272dc82c4d27b80d0e73513eb378622bc4cf1d0c822beda10c9dc1d4eff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for teloce-py 0.3.2

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