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 /modellists the models,{"models": [...]}, asrelations_restx.attachdoes.- 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 /actionis{"actions": []}andGET /viewis{"views": []}, empty until something is registered. Pass lists asactions=andviews=toattachto 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.2.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 | |
|---|---|---|---|---|
| relations_unifist-0.2.0.tar.gz | 7.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| relations_unifist-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 kB
Release files / relations_unifist-0.2.0.tar.gz
| Download URL | relations_unifist-0.2.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d122345bb929831c19fd5dd24cc53d1bcc1c04f0855a28911d83033920a9b8ab
|
|
BLAKE2b-256 checksum How to use checksums |
403f3c1a3f4552862225fc6147ee4adbf141f3bf90931b21b9665efae8078595
|
| 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.2.0-py3-none-any.whl
| Download URL | relations_unifist-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
658566f47489a2e49749ff542132831822791af2968d508620f33185057bcc2e
|
|
BLAKE2b-256 checksum How to use checksums |
d345ac1192318fc3c1e72293d3544046d74c495548c6133fca0da4cad8f4f250
|
| 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.2.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.