Skip to main content

Teloce-Py logo

Teloce-Py

Build interactive Python apps with .vel components. No Node.js required.

PyPI version MIT license Documentation

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.

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 teloce typecheck ui --json for CI). This checks TypeScript script blocks, .ts files/declarations, and supported template expressions using the bundled PyTSCheck compiler.

See 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.

Metadata

Release files for teloce-py 0.3.0

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.0
File Size Uploaded Provenance Actions
teloce_py-0.3.0.tar.gz 293.4 kB Without provenance Details for teloce_py-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 631.6 kB

Release files / teloce_py-0.3.0.tar.gz

Download URL teloce_py-0.3.0.tar.gz
Size 293.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3e4d5153f1ef984998a7afe21f45c6d51ee7044eaecf8c11283ad9f6ea6c4733
BLAKE2b-256 checksum
How to use checksums
79b6dc8442782de7744f3d2b21710a8127df7c7c43e06e1bda06e65a325f8d73
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.0-py3-none-any.whl

Download URL teloce_py-0.3.0-py3-none-any.whl
Size 338.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a14852be03848206cf1c303d1b20b294c660c4b047f0bdeabb7e9c4f448788c7
BLAKE2b-256 checksum
How to use checksums
7a996b504f889d84cef64068786887a0eb463503ebdef8dea817741afa720396
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.0

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