Submit records to a Data Maker form: read a signed .dmf bundle, validate values, sealed-box encrypt, and post to the public submissions endpoint.
Project description
datamaker (Python)
Submit records to a Data Maker form from
Python. Reads a signed .dmf bundle, validates your values against its field
schema, sealed-box encrypts them client-side against the form owner's public
key, and posts the ciphertext to the public submissions endpoint. Everything
except the final POST runs offline; the server never sees your data in the
clear.
The Node twin is @fobo-tools/datamaker
— same wire contract, same .dmf reader.
Install
pip install datamaker-forms
Depends only on PyNaCl. Python ≥ 3.9.
Library
import datamaker as dm
with open("contact.dmf", "rb") as fh:
form = dm.read_form(fh.read()) # verifies signature + form hash
result = dm.submit(
form=form,
values={"email": "ada@example.com", "full_name": "Ada"},
)
# → {"submission_id": ..., "edit_token": ..., "form_id": "contact_form"}
You can also pass the raw bundle straight to submit:
dm.submit(dmf=open("contact.dmf", "rb").read(), values={"email": "ada@example.com"})
API
-
read_form(dmf_bytes, verify=True) -> FormDescriptor— verifies the publisher's Ed25519 signature over the manifest and thatform.jsonmatches its signed hash; raisesDmfErroron tampering. The descriptor exposesform_id,name,schema_version,submit_policy,recipient_user_id,recipient_public_key,fields, andverified. -
submit(form=… | dmf=…, values=…, **opts) -> dict— validates, seals, and posts. Options:api_base_url,submitter_id(defaultNone= anonymous),validate(defaultTrue),allow_unknown,verify, andposter(inject a custom HTTP poster for testing). -
build_submission(form, values, **opts) -> dict— validate + seal without sending; returnssubmission_id,envelope,payload,values. -
post_submission(envelope, **opts) -> dict— post a pre-built envelope. -
validate_values(fields, input, allow_unknown=False) -> (values, issues)— pure validation/coercion, no crypto.
Validation
submit/build_submission raise ValidationError (with .issues) for missing
required fields, unknown keys (set allow_unknown=True to ignore), and values
for read-only kinds (calc, heading, signature). Values are coerced to the
wire shape per kind: numbers from strings, booleans from "yes"/"true"/1,
multi-choice → list, choice membership checked unless the field allows custom.
File-upload kinds (image, attachment) are passed through as-is.
CLI
datamaker inspect contact.dmf
datamaker inspect contact.dmf --json
datamaker submit contact.dmf --field email=ada@example.com --field full_name=Ada
datamaker submit contact.dmf --data '{"email": "ada@example.com"}'
datamaker submit contact.dmf --data-file answers.json --dry-run
License
BSD-3-Clause © FOBO Tools
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datamaker_forms-0.1.0.tar.gz.
File metadata
- Download URL: datamaker_forms-0.1.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b79344523b991cccefd5512439d78f42a71b491f576911fa45874b1e8d4a6a04
|
|
| MD5 |
5d81984ac3acd89699224b484be6652d
|
|
| BLAKE2b-256 |
220768f4634c0c1563bf3022fbfb3cfcbbfa02e3db0cd4166f851a5b7fe65b4f
|
Provenance
The following attestation bundles were made for datamaker_forms-0.1.0.tar.gz:
Publisher:
publish-sdk-py.yml on FOBO-Tools/fobo-data-maker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datamaker_forms-0.1.0.tar.gz -
Subject digest:
b79344523b991cccefd5512439d78f42a71b491f576911fa45874b1e8d4a6a04 - Sigstore transparency entry: 1749452329
- Sigstore integration time:
-
Permalink:
FOBO-Tools/fobo-data-maker@4751ad05d00b5136413aebb515259f194607b474 -
Branch / Tag:
refs/tags/sdk-py-v0.1.0 - Owner: https://github.com/FOBO-Tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-py.yml@4751ad05d00b5136413aebb515259f194607b474 -
Trigger Event:
push
-
Statement type:
File details
Details for the file datamaker_forms-0.1.0-py3-none-any.whl.
File metadata
- Download URL: datamaker_forms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c5fd20c6d8a222f795885bbbeea9be5e0d317c018694d86b0c92d897f1188f9
|
|
| MD5 |
57e51c200f2e5c27341b403a9ceff8f5
|
|
| BLAKE2b-256 |
dc2b17cd0a0300386ab025829c3be9aeaa2ed8ab045a41115fd38b2b2a160255
|
Provenance
The following attestation bundles were made for datamaker_forms-0.1.0-py3-none-any.whl:
Publisher:
publish-sdk-py.yml on FOBO-Tools/fobo-data-maker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datamaker_forms-0.1.0-py3-none-any.whl -
Subject digest:
3c5fd20c6d8a222f795885bbbeea9be5e0d317c018694d86b0c92d897f1188f9 - Sigstore transparency entry: 1749452486
- Sigstore integration time:
-
Permalink:
FOBO-Tools/fobo-data-maker@4751ad05d00b5136413aebb515259f194607b474 -
Branch / Tag:
refs/tags/sdk-py-v0.1.0 - Owner: https://github.com/FOBO-Tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-py.yml@4751ad05d00b5136413aebb515259f194607b474 -
Trigger Event:
push
-
Statement type: