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.3.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.3.0.tar.gz | 7.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| relations_unifist-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / relations_unifist-0.3.0.tar.gz
| Download URL | relations_unifist-0.3.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d303b792a75d57aac6a74824580ebd273b668cde6beae5b77b82e2632fdeaf5f
|
|
BLAKE2b-256 checksum How to use checksums |
6fb7dd9bb96053ae29499e47d12eb3cca268495dd12307baac3f538780b847b9
|
| 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.3.0-py3-none-any.whl
| Download URL | relations_unifist-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
537d0e0e8d0bd66635d37168ea2451fc53b6a6b3a12bbad5a4f1a70001dc63e6
|
|
BLAKE2b-256 checksum How to use checksums |
64a07216006086e4770f7b8ef5d11998dfc9b7729211590ad68ed4cc16bdc40e
|
| 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.3.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.