Skip to main content

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.

Install.

Right now, Pygrister is in beta stage, meaning that the overall interface should be fairly stable but I still make no promises about further changes.

You can install Pygrister from PyPI:

python -m pip install pygrister

What’s next.

  • Add support for some other useful, undocumented Grist Apis;

  • Add at least a basic type system for records;

  • Maybe write a few “macros/recipes” for common Grist tasks…

Any feedback and contribution is very welcome at this stage!

License.

Pygrister is released under the MIT license (see LICENSE.rst). Copyright 2024 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

pygrister-0.4.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

Pygrister-0.4.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pygrister-0.4.0.tar.gz.

File metadata

  • Download URL: pygrister-0.4.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.0

File hashes

Hashes for pygrister-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7bbb04c8974bbb5b300ac9ab7ae6616dc80a49701c09bef811165f55fbc8b6b4
MD5 96c605f1dc9b60815771913382b63ebe
BLAKE2b-256 f63c09ba6366ca076090ef668ae15912e60770ae0d6e3283d2feb1552c9746ba

See more details on using hashes here.

File details

Details for the file Pygrister-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: Pygrister-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.0

File hashes

Hashes for Pygrister-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2496d7df45914735779977fba2991bd89619108bd61ce52135d7f93f91cad9c9
MD5 8ff7142b31e937d80fa17c46440e7c1d
BLAKE2b-256 ee3973e15d8007ead6ee6f9a467bcb4c61b3d9f58a95d22f26fa8ffbb228a913

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page