Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Guará

PyPI Downloads

Guará is a Python framework for business logic expression. It allows you to write production code and tests as executable domain language, combining:

  • Business Logic Language → expresses domain behavior using Ubiquitous Language
  • Test Framework → orchestrates scenarios using Given / When / Then

Instead of focusing only on technical assertions, Guará enables you to describe business scenarios as code, making production code and tests readable by developers and domain experts.

Core Idea

Guará turns code into business narratives:

  • Transactions → represent actions (use cases)
  • Assertions (it) → represent business expectations
  • Application DSL → orchestrates flows in domain language

Syntax

Application.when(DoSomething [,with_parameter=value, ...]).expects(it.Matches, a_condition)

Example in Action

Modeling

from guara.application import Application
from guara import it
from transactions import HasBalance, BuyAsset, UpdatePortfolio


def main():
    finance_app = Application()
    (
        finance_app.given(HasBalance)
        .when(BuyAsset, symbol="AAPL", amount=2000)
        .and_(UpdatePortfolio)
        .expects(it.IsEqualTo, 20)
    )

UI Testing

from guara.application import Application
from guara import it
from selenium import webdriver
from transactions import OpenApp, ChangeToPortuguese, NavigateToInfoPage, CloseApp


def test_sample_web_page():
    app = Application(webdriver.Chrome())
    app.given(OpenApp, url="https://anyhost.com/")
    app.when(ChangeToPortuguese).expects(it.IsEqualTo, CONTENT_IN_PORTUGUESE)
    app.when(NavigateToInfoPage).then(it.Contains, "This project was born")
    app.execute(CloseApp)

Documentation

For more information, check: https://guara.readthedocs.io/en/latest/

Metadata

Release files for guara 0.0.26rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for guara 0.0.26rc4
File Size Uploaded Provenance Actions
guara-0.0.26rc4.tar.gz 997.4 kB Without provenance Details for guara-0.0.26rc4.tar.gz

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / guara-0.0.26rc4.tar.gz

Download URL guara-0.0.26rc4.tar.gz
Size 997.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d7cb39e9ea3186c19afe8444c4c46f400ea04515a47a35d69f84baebdf0492f6
BLAKE2b-256 checksum
How to use checksums
7a98488358c14b45bf37cc9d49b5e9c056ab474f2dc0f55e626aeffc87c7201c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / guara-0.0.26rc4-py3-none-any.whl

Download URL guara-0.0.26rc4-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7312d3fdaa8d861a1b9a008191c4d78dfdb9c19daea5e0540d548e4442ce33d
BLAKE2b-256 checksum
How to use checksums
8d97553a560e1a338a86a7e5efd468962bc3675a76249dee5af84e20e7d116f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for guara 0.0.26rc4

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.

Release history Release notifications | RSS feed

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