A reusable Django app to load data from Grist to Django models
Project description
django-grist-loader
Django reusable app to load data from Grist into read-only Django models.
Installation
The usual way:
-
Install
uv add django-grist-loader
-
Configure
Django's settings:
INSTALLED_APPS = ( ..., "grist_loader", ..., ) GRIST_PYGRISTER_CONFIG = { "GRIST_API_KEY": os.environ.get("GRIST_API_KEY", ""), "GRIST_SELF_MANAGED": "Y", "GRIST_SELF_MANAGED_HOME": f"{os.environ.get('GRIST_PROTOCOL', 'https://')}{os.environ.get('GRIST_HOST', '')}", "GRIST_SELF_MANAGED_SINGLE_ORG": "N", "GRIST_SERVER_PROTOCOL": os.environ.get("GRIST_PROTOCOL", "https://"), "GRIST_API_SERVER": os.environ.get("GRIST_HOST", ""), "GRIST_API_ROOT": os.environ.get("GRIST_API_ROOT", "api"), "GRIST_TEAM_SITE": os.environ.get("GRIST_API_DOCS", "docs"), "GRIST_WORKSPACE_ID": os.environ.get("GRIST_WORKSPACE_ID", ""), "GRIST_DOC_ID": os.environ.get("GRIST_DOC_ID", ""), "GRIST_RAISE_ERROR": "Y", "GRIST_SAFEMODE": "N", }
-
Define the required envvars that make sense to your project
Usage
-
Define a Django model that subclasses
GristModel:from django.db import models from grist_loader.models import GristModel class MyModel(GristModel): my_char_field = models.CharField(max_length=100) my_int_field = models.IntegerField() my_date_field = models.DateField()
-
Within a
grist.pymodule, define a loader class that subclassesGristLoader:from grist_loader.loader import GristLoader, register_grist_loader from .models import MyModel @register_grist_loader class MyLoader(GristLoader): model = MyModel table = "MyGristTableName" required_cols = ("MyChar",) fields = { "MyChar": MyModel.my_char_field, "MyInt": MyModel.my_int_field, "MyDate": MyModel.my_date_field, }
-
Load your data
python manage.py grist_load_all
-
Profit!
Project details
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 django_grist_loader-0.1.0.tar.gz.
File metadata
- Download URL: django_grist_loader-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f2ba916a44399c16a88ce03a57a9affc06a8bb9a92a113d056096011309c4f6
|
|
| MD5 |
2e1d82f049636cade6fa2574b4bdafeb
|
|
| BLAKE2b-256 |
763d7154ba873dd0a1dc84a5db53f760c17c3a9b83cc98d6bd77f61a9b472302
|
Provenance
The following attestation bundles were made for django_grist_loader-0.1.0.tar.gz:
Publisher:
main.yml on David-Guillot/django-grist-loader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_grist_loader-0.1.0.tar.gz -
Subject digest:
7f2ba916a44399c16a88ce03a57a9affc06a8bb9a92a113d056096011309c4f6 - Sigstore transparency entry: 190135654
- Sigstore integration time:
-
Permalink:
David-Guillot/django-grist-loader@f263e9f3d81c441d03b0e1d6bf5aace7546d45a3 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/David-Guillot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@f263e9f3d81c441d03b0e1d6bf5aace7546d45a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_grist_loader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_grist_loader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
976b98041bb525452d7c44f1f207f342ac97224d07d4c2a3b450f4ef4e76b735
|
|
| MD5 |
0ba1b1f5c0aab0b7f8adc3fabd51e0f1
|
|
| BLAKE2b-256 |
432543bb92813567b5acbcdb96ecf622516eac02564004b6318c3f3fad805565
|
Provenance
The following attestation bundles were made for django_grist_loader-0.1.0-py3-none-any.whl:
Publisher:
main.yml on David-Guillot/django-grist-loader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_grist_loader-0.1.0-py3-none-any.whl -
Subject digest:
976b98041bb525452d7c44f1f207f342ac97224d07d4c2a3b450f4ef4e76b735 - Sigstore transparency entry: 190135655
- Sigstore integration time:
-
Permalink:
David-Guillot/django-grist-loader@f263e9f3d81c441d03b0e1d6bf5aace7546d45a3 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/David-Guillot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@f263e9f3d81c441d03b0e1d6bf5aace7546d45a3 -
Trigger Event:
push
-
Statement type: