Skip to main content
Lombik icon

Lombik

Lombik is a practical scaffold engine for Flask that saves you from hours on hours of configurations, integrations and a messy project structure.

It leans heavily into a hypermedia-first approach, using Jinja2, template filters, HTMX, and Tailwind to keep logic close to the UI and reduce frontend complexity.

To get started run these 4 commands:

pip install lombik
lombik createapp my-new-app
cd my-new-app
flask run --debug

And start developing.

Structure

Lombik is organized around feature modules. Each module is a self-contained domain containing its own routes, APIs, templates, and logic. By default, you'll get 3 modules:

  • Auth
  • Admin
  • Core

Each of these modules follow the same file structure:

__init__.py

Defines the Flask blueprint used across the module.


routes.py

Defines page routes.

Routes represent full page loads and UI entry points.


queries.py

Handles data retrieval.

Typically used for database reads and returning data or partial HTML (often via HTMX).


actions.py

Handles state changes.

Used for operations that modify data such as POST, PUT, PATCH, and DELETE.


The toolkit

Inside the lombik directory you'll find the engine of the application. There is a very light test coverage by default. Custom commands to run tests:

  • lombik test Run test in the current folder, by default it shall be ran from root
  • lombik test-report Generates a coverage report in the terminal
  • lombik test-report-html Generates an HTML report about the test coverage Here some of the default behaviors are defined and yo ucan change them to your liking.

I leave it up to you to read through it and get familiar with the engine. With that said, I'd like to show some examples to display waht it's like to build with lombik.

Dates & time handling

Instead of formatting timestamps in the backend, you do it directly in the template:

{{ created_at | localtime }} → 2026-05-19 05:15
{{ created_at | onlydate }} → 2026-05-19
{{ created_at | onlytime }} → 05:15
{{ created_at | shortdatetime }} → May 19 05:15
{{ created_at | timesince }} → Just now // 2 minutes ago // 21 hours ago etc.

Everything defaults to localtime, meaning UTC from the backend is automatically shown in the user’s timezone.

Lombik expects the user’s timezone to be available via g. To change: lombik/filters/_localize.

String helpers

Make frontend less painful

{{ g.user.full_name | proper }}

john_doe → John Doe

{{ g.user.first_name | possessive }}

john → john's
lucas → lucas'

You can chain them:

{{ g.user.full_name | proper | possessive }}

john_doe → John Doe's

You can also normalize user input:

{{ user_input | normalize }}

Hello, world → hello_world email@example.com → email_example_com

In lombik, Jinja is heavily used to display UI elements and these built in template filters make it very easy and re-usable.

As an example, let's assume you have two objects:

user.name = john_doe
created_at = 2026-06-01 13:00:00

In a single line like this you can format it:

{{ user.name | proper | possessive }} response • {{ created_at | timesince }} --> John Doe's response • 21 minutes ago


Models

Create models

You can create a model for example Client by using lombik model client This creates a file called clients.py with a class CLient. The table name and filename is always plural. It also automatically injects it into the main model imports.

Create relationships

The relate command automatically generates SQLAlchemy relationships between two existing models in your Flask project.

It handles:

  • Foreign key creation
  • Relationship creation
  • Back-populates linking
  • Naming conventions
  • Duplicate prevention

lombik relate user.id to client.user_id

Creates:

  • Client.user_id → ForeignKey to User.id
  • Client.user relationship
  • User.clients reverse relationship

If fields are omitted, Lombik assumes:

user → user.id
client → client.user_id


user_id = db.Column( db.String(36), db.ForeignKey("users.id"), index=True )

user = db.relationship( "User", back_populates="clients" )


clients = db.relationship( "Client", back_populates="user", cascade="all, delete-orphan" )


  • Table names are pluralized automatically
  • Relationship names follow:
    • parent → plural(child)
    • child → singular(parent)
  • Back-populates is always synchronized between both sides

  • Existing columns are never overwritten
  • Existing relationships are never duplicated
  • Lombik only edits managed sections when available
  • Otherwise it appends safely to the class

Recommended project structure

Use these markers in your models for best results:

LOMBIK:COLUMNS

</LOMBIK:COLUMNS>

LOMBIK:RELATIONSHIPS

</LOMBIK:RELATIONSHIPS>

This ensures clean and predictable insertions.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lombik-3.1.3.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lombik-3.1.3-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file lombik-3.1.3.tar.gz.

File metadata

  • Download URL: lombik-3.1.3.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for lombik-3.1.3.tar.gz
Algorithm Hash digest
SHA256 808179b242ce07786fee92ed3c53f2fc829750336df5b3f92e178b00411b6a43
MD5 3ede0f48590c653a109b6d6f75cab8ad
BLAKE2b-256 4c2ab9f01c0e7b72a6353822c4ad20d7166a6e4732e4e4c403f49743dd4f2f41

See more details on using hashes here.

File details

Details for the file lombik-3.1.3-py3-none-any.whl.

File metadata

  • Download URL: lombik-3.1.3-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for lombik-3.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 03d08ef4e22d5c36e011bb3e8c3fe0fe58ed36f20e821919f5e6d32c8bba1d87
MD5 9b60e9e23ec8eaf2a1c6128f2ccd236f
BLAKE2b-256 94be024784cfc12091b8959dcae0006bcb0faf0281a903a01d8168af1562205b

See more details on using hashes here.

Release history Release notifications | RSS feed

3.2.5

2 files

3.2.4

2 files

3.2.3

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.6

2 files

3.1.5

2 files

3.1.4

2 files

This release

3.1.3 This release

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.2

2 files

3.0.0

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

0.2.0

2 files

0.1.7

2 files

0.1.5

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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