Skip to main content

python-relations-unifist

Relations Models for local generation ready for global adressing

Part of Relations. Source agnostic: it builds on the core library's Source, Model and hooks only, so it works over any relations source.

The Unifist source

The tables for ids, slugs and the journal live in a regular source named unifist. To use another name, change it once on the lib, then make a source with that name when your app starts, separate from the source your own models are in:

import relations_pymysql
import relations_unifist

relations_unifist.UnifistBase.SOURCE = "ledger-unifist"   # the default is "unifist"

relations_pymysql.Source(relations_unifist.UnifistBase.SOURCE, schema="ledger_unifist", autocommit=True, host="mysql")

Serving models

relations_restx.attach serves every model at the root, /{singular}. To serve them under /model instead, with /action and /view lists beside them, attach with relations_unifist.attach:

import flask
import relations_restx
import relations_unifist

app = flask.Flask("api")
restx = relations_restx.Api(app)

relations_unifist.attach(restx, resources_module, models)
  • GET /model lists the models, {"models": [...]}, as relations_restx.attach does.
  • Each model is at /model/{singular} and, if it has an id, /model/{singular}/<id>, with the same methods (OPTIONS, GET, POST, PATCH, DELETE) as in relations_restx. The OpenAPI spec lists these paths.
  • GET /action is {"actions": []} and GET /view is {"views": []}, empty until something is registered. Pass lists as actions= and views= to attach to serve them. They are placeholders for now.

To write the resource for a model yourself, subclass relations_unifist.Resource the way you would relations_restx.Resource:

class PersonResource(relations_unifist.Resource):
    MODEL = Person

Status: scaffold. See the first ticket for the design and what done looks like.

Metadata

Release files for relations-unifist 0.4.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 relations-unifist 0.4.0
File Size Uploaded Provenance
relations_unifist-0.4.0.tar.gz 8.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for relations-unifist 0.4.0
File Interpreter ABI Platform
relations_unifist-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / relations_unifist-0.4.0.tar.gz

Download URL relations_unifist-0.4.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8d4d278672f3ca271dfba2e0328806f47c933fea0e801d2369ae6bf91c39e066
BLAKE2b-256 checksum
How to use checksums
fa83aca973816c7159b9678cd7269c953a3e1bc970bc60a978ec4d2cb4af9a16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / relations_unifist-0.4.0-py3-none-any.whl

Download URL relations_unifist-0.4.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
814acbdd8144bd9b9e83173fa3739a2c1a59d0f98684bd7e96aceb168eb3c297
BLAKE2b-256 checksum
How to use checksums
1551b631949576e2ef4cb45954e1b6643de93256a866a03731a02ff855edaba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for relations-unifist 0.4.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.

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