Skip to main content

Talika

Talika — Hindi for tables.
Declarative schemas for typed, validated Gherkin data tables.

CI PyPI version Supported Python versions License Documentation


Gherkin data tables are wonderfully easy to read. The raw list[list[str]] that arrives in Python is less wonderful to maintain.

As a test suite grows, step definitions accumulate the same invisible work: matching labels, converting strings, applying defaults, rejecting typos, and explaining which cell was wrong. Talika moves that work into a small, reusable table contract.

Define the shape once. Talika parses the table, converts its cells into real Python values, validates the result, and keeps errors connected to the original .feature file.

Quickstart · Why Talika? · API reference

What you get

  • Declarative table contracts — describe labels, required fields, aliases, defaults, and parsing rules in one Python class.
  • Typed records — turn cells into int, bool, Decimal, date, datetime, enums, lists, and your own domain values.
  • Both natural table shapes — use row-oriented tables for lists and column-oriented tables for detailed items.
  • Errors where the data lives — report stable error codes with the field, row, column, item ID, and original value.
  • Your team's vocabulary — build readable cell conventions such as random, today, or 20 words with tokens and full-match patterns.
  • Room for real test suites — model variants, references, table transforms, cross-record validation, and dataclass or Pydantic output.
  • Checks before test execution — validate Gherkin tables in CI with the optional talika check CLI.
  • A zero-dependency core — install integrations only when you need them.

Installation

Talika supports Python 3.10 and newer.

pip install talika

Or with uv:

uv add talika

Optional extras keep the core package small:

pip install "talika[cli]"       # Static checks for .feature files
pip install "talika[pydantic]"  # Pydantic v2 output models

See the installation guide for environment setup and all available extras.

A table contract in a few lines

Start with a table that stays readable for everyone working on the scenario:

Given the users exist
  | name  | age | roles              | active |
  | Akash | 27  | Developer, Manager | true   |
  | Badal | 25  | Tester             | false  |

Describe what those cells mean:

from talika import RowTable, boolean, field, split


class UserTable(RowTable):
    name = field(required=True)
    age: int = field("age", required=True)
    roles = field("roles", parser=split(","))
    active = field("active", parser=boolean(), default=True)

Then parse at the boundary of your step:

from pytest_bdd import given


@given("the users exist", target_fixture="users")
def users(datatable):
    return UserTable.parse(datatable)

Your test now receives useful Python values instead of table-shaped strings:

assert users[0].name == "Akash"
assert users[0].age == 27
assert users[0].roles == ["Developer", "Manager"]
assert users[0].active is True

parse() always returns UserTable records. When a boundary needs a dataclass, Pydantic model, or another callable output type, use UserTable.parse_as(datatable, User) instead. Omitting the target uses a configured output_model or build_output() hook.

Bad input fails at the table boundary with source-aware diagnostics:

Field parser failed: invalid literal for int() with base 10: 'old'
(code=parser_failed, schema=UserTable, field='age', row=2, column=2, value='old').

The quickstart walks through defaults, collected errors, source metadata, and the pytest-bdd fixture.

Tables can have different shapes

RowTable treats the first row as labels and each following row as one record:

| name  | role  |
| Akash | admin |
| Badal | user  |

ColumnTable treats the first column as labels and each following column as one record—useful when each item has many attributes:

| IDs       | 1       | 2       |
| Type      | Article | Poll    |
| Headline  | Hello   | Vote?   |
| Published | true    | false   |

Both shapes use the same field declarations, parsers, validation hooks, parse_as() output conversion, and source-aware errors. Read choosing a table shape for the trade-offs.

Make tables speak your domain

Talika does not impose a universal table DSL. It gives your project safe hooks to own its vocabulary:

from talika import CellDSL


cells = CellDSL()


@cells.token("random", fields=("headline",))
def random_headline(context):
    return context.user_data["faker"].headline()


@cells.pattern(r"(?P<count>\d+) words", fields=("body",))
def generated_words(match, context):
    return context.user_data["faker"].words(int(match["count"]))

Feature authors can write compact intent such as random or 20 words, while the project decides exactly what those phrases mean. Explore tokens, patterns, and composition.

Check feature files without running scenarios

Install the CLI extra and validate tables during local development or CI:

pip install "talika[cli]"
talika check features/users.feature --schema tests.tables:UserTable --step "the users exist"

The checker uses the official Gherkin parser and can emit JSON diagnostics for editor and CI integrations. See the static checking guide for discovery, context factories, and exit codes.

Where Talika fits

Talika is deliberately focused. It is not a test runner, fixture factory, business workflow engine, or general model-validation library.

pytest-bdd still runs scenarios. Pydantic can still validate final models. Factories can still build database objects. Talika owns the boundary between a human-authored data table and the Python objects your test code wants to use.

Learn more

  • Why Talika? — the problem it solves and how it compares with adjacent tools.
  • Quickstart — build and use your first schema.
  • Guides — fields, parsers, validation, variants, references, transforms, and more.
  • API reference — the complete public interface.
  • Changelog — releases and notable changes.

Contributing

Contributions are welcome. See CONTRIBUTING.md for the local development workflow and project checks.

License

Talika is released under the MIT License.

Metadata

Release files for talika 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 talika 0.5.0
File Size Uploaded Provenance Actions
talika-0.5.0.tar.gz 114.1 kB With provenance Details for talika-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for talika 0.5.0
File Interpreter ABI Platform Actions
talika-0.5.0-py3-none-any.whl Python 3 none any Details for talika-0.5.0-py3-none-any.whl

Total release size: 209.2 kB

Release files / talika-0.5.0.tar.gz

Download URL talika-0.5.0.tar.gz
Size 114.1 kB
Tags Source
SHA-256 checksum
How to use checksums
611cbf21a7f96cef0a9d52ae5ca19c193b9463c4d2090d0c9d6b1c2ac723dbeb
BLAKE2b-256 checksum
How to use checksums
9b731f5145acf5cec0a8de2662120181c77fdd56111c2fc8c8a0b949feff9bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 18, 2026.

Transparency log

Release files / talika-0.5.0-py3-none-any.whl

Download URL talika-0.5.0-py3-none-any.whl
Size 95.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7fcae1b8eebc9bc05227dbe2a0f27ff10764807eb08d370cd8d11ebbd11d4e9
BLAKE2b-256 checksum
How to use checksums
ae9e3f3afebc65a59d99aa340e6207c21913ebed2f8010b8921f4843a7c05455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 18, 2026.

Transparency log

Security for talika 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 talika-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 Jul 18, 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