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

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.1
File Size Uploaded Provenance Actions
teloce_py-0.3.1.tar.gz 300.0 kB Without provenance Details for teloce_py-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 641.9 kB

Release files / teloce_py-0.3.1.tar.gz

Download URL teloce_py-0.3.1.tar.gz
Size 300.0 kB
Tags Source
SHA-256 checksum
How to use checksums
72f16a5c7e0470e52cf54e9f8cefe88fd6c07ad191cf266588fbca4f16d9d501
BLAKE2b-256 checksum
How to use checksums
342c32bed191d54acbf5c8eef80a90ca9024239531daf771f8dceff91d4a1a42
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.1-py3-none-any.whl

Download URL teloce_py-0.3.1-py3-none-any.whl
Size 341.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8636e30ad99a762f0e248e7d2cb8e0b4ef6966c19b31ec9814d030c3f6eb2def
BLAKE2b-256 checksum
How to use checksums
3a2d7e40fe4ddfd9e485d1aaa09b66750fb1e42469c26f801196bd5f6b38f131
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.1

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