Skip to main content

bethany-lcl

Python bindings for the Lazarus LCL (Lazarus Component Library), with an API similar to C++Builder. Part of Bethany, which also provides the same API for C++ and a visual form designer for VS Code.

pip install bethany-lcl

The distribution name is bethany-lcl, and the module name is beth.

Preview. Bethany is at version 0.x. The API may change between minor versions. Only Windows x64 is supported for now: the Python from python.org, and the Python of MSYS2 (MINGW64, UCRT64, ...). In MSYS2, install it in a virtual environment (python -m venv .venv). pip builds it from the source distribution, which contains the prebuilt beth.dll.

Example

from beth import *


class TForm1(TForm):
    def __init__(self, AOwner):
        super().__init__(AOwner)
        self.Caption = "Hello"
        self.Button1 = TButton(self)
        self.Button1.Parent = self
        self.Button1.Caption = "OK"
        self.Button1.OnClick = self.Button1Click

    def Button1Click(self, Sender):
        self.Caption = "Clicked"


Application.Initialize()
Form1 = Application.CreateForm(TForm1)
Application.Run()

Classes, properties and events have the same names as in C++Builder and the LCL (TForm, TButton, Caption, OnClick and so on). The differences from C++ are:

  • Arguments passed by reference in C++ (int& Key, bool& CanClose, TCloseAction& Action, ...) are Ref objects. Read and write them with .value.
  • Application->CreateForm(&Form1) is Form1 = Application.CreateForm(TForm1).
  • Objects you create yourself (TStringList, TBitmap, TPicture, ...) are destroyed with Free(), or when no reference to them remains.
  • Using a wrapper after its LCL object has been destroyed raises ReferenceError.
  • Exceptions raised in the LCL are BethError (E.Message, E.ClassName()).

Designing forms

Bethany Designer is a VS Code extension to design forms on a canvas and generate the Python (or C++) code for them.

License

Bethany is distributed under the MIT License. The package contains beth.dll, which is built with Free Pascal and statically contains the Free Pascal run-time library and the LCL. They are distributed under the LGPL with a static linking exception. See THIRD-PARTY-NOTICES.md and the licenses folder in the package metadata, or the repository.

日本語

Lazarus の LCL を、C++Builder に似た API で Python から使うためのパッケージです。pip install bethany-lcl で入れ、from beth import * で使います。 今のところ Windows x64 だけに対応しています(python.org の Python と、MSYS2 の Python。MSYS2 では venv に入れてください)。C++ 版と、フォームを画面で設計する VS Code 拡張は Bethany のリポジトリを参照してください。

Metadata

Release files for bethany-lcl 0.5.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 bethany-lcl 0.5.0
File Size Uploaded Provenance Actions
bethany_lcl-0.5.0.tar.gz 1.4 MB With provenance Details for bethany_lcl-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bethany-lcl 0.5.0
File Interpreter ABI Platform Actions
bethany_lcl-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for bethany_lcl-0.5.0-py3-none-win_amd64.whl

Total release size: 2.9 MB

Release files / bethany_lcl-0.5.0.tar.gz

Download URL bethany_lcl-0.5.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
3c2fed497d093817d93174a8d7f54a806172144e2ff1dfbc105c75bdbee5487f
BLAKE2b-256 checksum
How to use checksums
ed1c1329dbac00a044799590596e3b24b1ff54d1486fa9cd4863408851565586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / bethany_lcl-0.5.0-py3-none-win_amd64.whl

Download URL bethany_lcl-0.5.0-py3-none-win_amd64.whl
Size 1.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8c4f32fd26b042610077e5c049484bdf4dd3b18242e933c6b19daf7eb00869c2
BLAKE2b-256 checksum
How to use checksums
61bba8838af7b7d8708499ff7b58a61927bdb72f583f43319d7cc4f09ec2bba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for bethany-lcl 0.5.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bethany_lcl-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

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