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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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
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.