A Python client for the Grist API.
Project description
Grist is a relational spreadsheet with tons of batteries included. The Grist API allows you to programmatically retrieve/update your data stored on Grist, and manipulate most of the basic Grist objects, such as workspaces, documents, user permissions and so on.
Pygrister is a Grist client that covers all the documented APIs. Pygrister keeps track of basic configuration for you, remembering your team site, workspace, working document, so that you don’t have to type in the boring stuff every time. Apart from this and little else, Pygrister is rather low-level: it will call the api and retrieve the response, with only minor changes. If the api call is malformed, you will simply receive a bad HTTP status code.
Basic usage goes as follows:
from pygrister.api import GristApi
grist = GristApi()
# list users/permissions for the current document
status_code, response = grist.list_doc_users()
# fetch all rows in a table
status_code, response = grist.list_records('Table1')
# add a column to a table
cols = [{'id': 'age', 'fields': {'label':'age', 'type': 'Int'}}]
status_code, response = grist.add_cols('Table1', cols)
You should read the docs first, and then take a look at the test suite for more usage examples.
Python version required.
Pygrister will work with any Python>=3.9.
Note that Grist itself may have stricter Python requirements but don’t mix things up: the Grist’s Python lives on the server, supporting a Grist instance. You will likely run Pygrister from a client instead, with your Python of choice.
Install.
Any feedback and contribution is very welcome at this stage!
Right now, Pygrister is in beta stage, meaning that the overall interface should be fairly stable but I make no promises about further changes. The new Scim api support is still very experimental.
You can install Pygrister from PyPI:
python -m pip install pygrister
Note that this repo may have recent features not yet released on PyPI: see NEWS.txt and/or the commit history. To try the “bleeding edge” from GitHub:
python -m pip install git+https://github.com/ricpol/pygrister
License.
Pygrister is released under the MIT license (see LICENSE.rst). Copyright 2024-2025 Riccardo Polignieri
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 pygrister-0.6.0.tar.gz.
File metadata
- Download URL: pygrister-0.6.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76332b58da00cf4da07db1ecae0756c23b7995caf9ca321a548fa2f71600b36d
|
|
| MD5 |
ca5ad3bf9a48a4881528936042632b61
|
|
| BLAKE2b-256 |
7cecc060cfb2440014b811526f7ffabc2d7996e8c7f0548ea1857b58558f4126
|
File details
Details for the file pygrister-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pygrister-0.6.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ad3e464c93084d2e8200d95c18551f2f48e3a7039407a8e77a96f7648cbefed
|
|
| MD5 |
dc6c91bb95d092ce6619d9dbf334839b
|
|
| BLAKE2b-256 |
ffa06dc9574b76b7a77cdbb23b394a8fed19c384f498c6af4d7ce97feaf0b6a0
|