Skip to main content

dryv-author

Describe your software once, in Python: schemas, operations, events, policies. The dryv CLI compiles it and generates code from it with reusable packs. It mirrors the TypeScript author (@dryvcode/author) with Pythonic names, so both produce the same result.

Install

uv add --dev dryv-author dryv-compiler     # or: pip install dryv-author dryv-compiler
npm install -g @dryvcode/cli
dryv init --author python --author-path dryv.py --yes

Requires Python 3.11+. Create dryv.py with the example below (it must expose one module-level dryv.app(...)), then run dryv validate and dryv plan. Run dryv docs authoring for tips. This package only describes meaning; it does not generate code or write files.

Example

from dryv_author import (
    body,
    dryv,
    field,
    http,
    operation,
    path,
    policy,
    prop,
    respond,
    schema,
    scope_binding,
    storage,
)

users = dryv.group("users")
accounts = users.feature("Accounts")  # features are registration scopes

ids = accounts.properties({"Id": prop.string.uuid(), "Name": prop.string()})
models = accounts.schemas(
    {
        "User": schema(
            {
                "id": field(ids.Id).system(),
                "name": field(ids.Name).query(filter="*", sort=True),
            }
        ).facets(storage=storage("users").primary_key("id")),
    }
)

create = operation().role("create").inputs(models.User).outputs(models.User)
create.facets(
    http=http("POST", "/users")
    .input(create.input(0), body())
    .output(create.output(0), respond(201)),
)
accounts.operations({"CreateUser": create})

users.schemas({"AuditEntry": schema({"id": field(ids.Id)})})  # group-owned: no feature

tenant_policy = accounts.policies({"CurrentTenant": policy().provides({"tenantId": ids.Id})})
get_user = (
    operation()
    .role("detail")
    .inputs(id=ids.Id)
    .outputs(models.User)
    .requires(tenant_policy.CurrentTenant)
    .scope(scope_binding(models.User.field("id"), tenant_policy.CurrentTenant, "tenantId"))
)
accounts.operations({"GetUser": get_user})

app = dryv.app("accounts").groups(users)

The entrypoint configured in dryv.yaml must expose exactly one module-level dryv.app(...). It may import ordinary modules; every registration records the caller's file and line.

Ownership

Registering through group.feature("Name") makes the group the declaration's group and the feature its feature. Registering directly on the group leaves it group-owned. A declaration can belong to one group and at most one feature.

API map (TypeScript → Python)

TypeScript Python
property.string.uuid() prop.string.uuid()
property.number.integer({ range: { min: 0 } }) prop.number.integer(range={"min": 0})
field(x).createOnly() field(x).create_only()
.query({ filter: ["notEqual"] }) .query(filter=["not-equal"]) (not_equal also accepted)
expression.and(...), .or(...), .not(...) expression.all_of(...), .any_of(...), .not_(...)
operation().async() operation().async_()
operationStep, waitFor, outputFrom, inputFrom operation_step, wait_for, output_from, input_from
group.policies(ref1, ref2) same: a mapping registers, refs set scope policies
.scope({ target, source: { policy, name } }) .scope(scope_binding(target, policy, name))

An Operation scope binds a persisted Schema field to a named value declared in an attached Policy's provides context. Use one binding helper per field. The compiler lowers these to the same canonical scope contract as TypeScript and omits the scope when undeclared. Runtime validates declarations; the application remains responsible for Policy evaluation and conjunctive query execution.

Next

Docs: https://dryv.alidantech.org/docs · Compiler: dryv-compiler

Metadata

Release files for dryv-author 0.1.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 dryv-author 0.1.0
File Size Uploaded Provenance Actions
dryv_author-0.1.0.tar.gz 63.0 kB Without provenance Details for dryv_author-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dryv-author 0.1.0
File Interpreter ABI Platform Actions
dryv_author-0.1.0-py3-none-any.whl Python 3 none any Details for dryv_author-0.1.0-py3-none-any.whl

Total release size: 104.6 kB

Release files / dryv_author-0.1.0.tar.gz

Download URL dryv_author-0.1.0.tar.gz
Size 63.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e15e3a1885470689557754accdb208450bb2d0e7cfb2f56a09a05b96b15ead03
BLAKE2b-256 checksum
How to use checksums
bbf21993c153e9816c43dbecc32b5a6c5b023b5cf703d4bff3b6dd945e24f683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dryv_author-0.1.0-py3-none-any.whl

Download URL dryv_author-0.1.0-py3-none-any.whl
Size 41.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4396982bb079d59bd10cc4242c8c513e762a31f59ca467b30aa5262769f0cea4
BLAKE2b-256 checksum
How to use checksums
0fe3a198bd93d98e6a970d977e2fd134f605dc4c71008a8b58e4cbeb0a5bc632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for dryv-author 0.1.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.

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

This release

0.1.0 This release

2 release files No provenance

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