Skip to main content

Command-line interface for gformlib – manage Google Forms from the terminal.

Project description

gformlib-cli

PyPI version Python versions CI Documentation Status License: MIT

gformlib-cli is the official command-line interface for gformlib — manage Google Forms directly from your terminal.

Features

  • Create Google Forms from a JSON config file
  • Update form title, description, and add questions
  • Retrieve form metadata and structure
  • List form responses with optional filtering
  • Delete forms (with confirmation)
  • Service account & OAuth 2.0 authentication
  • Beautiful Rich terminal output
  • Full type annotations (PEP 561 compliant)

Installation

pip install gformlib-cli

Quickstart

Authenticate

Pass a service account key file with every command:

gformcli form create form.json --service-account sa.json

Or set the environment variable once:

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json
gformcli form create form.json

Create a form

gformcli form create form.json --service-account sa.json

form.json:

{
  "title": "Customer Survey",
  "description": "Tell us how we're doing.",
  "questions": [
    {"title": "Your name", "type": "short_answer", "required": true},
    {
      "title": "Overall rating",
      "type": "scale",
      "low": 1,
      "high": 5,
      "low_label": "Poor",
      "high_label": "Excellent"
    }
  ]
}

Update a form

gformcli form update <FORM_ID> update.json --service-account sa.json

Get form info

gformcli form get <FORM_ID> --service-account sa.json

List responses

gformcli form responses <FORM_ID> --service-account sa.json

Delete a form

gformcli form delete <FORM_ID> --yes --service-account sa.json

Authentication

Method Flag Notes
Service Account --service-account / -s Recommended for server/CI
OAuth 2.0 --credentials / -c Browser consent on first run
Env var GOOGLE_APPLICATION_CREDENTIALS Fallback, service account

Command reference

gformcli form create   CONFIG_FILE  [AUTH OPTIONS]
gformcli form update   FORM_ID  CONFIG_FILE  [AUTH OPTIONS]
gformcli form get      FORM_ID  [AUTH OPTIONS]
gformcli form responses FORM_ID  [--filter STR]  [--page-size N]  [AUTH OPTIONS]
gformcli form delete   FORM_ID  [--yes]  [AUTH OPTIONS]

Run gformcli --help or gformcli form <command> --help for full option details.

Development

git clone https://github.com/andhit-r/gformlib-cli
cd gformlib-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.

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

gformlib_cli-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gformlib_cli-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file gformlib_cli-0.1.0.tar.gz.

File metadata

  • Download URL: gformlib_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gformlib_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2753dd41b27404a6cf992abfa28fbee73af1bec18119312c412ec13f3ecb75e
MD5 dc209d58f9f00a4ab3aa2ae32f674e11
BLAKE2b-256 bbfe17fda27ddb699e7de293948590496b9e328476c33b571f3f1cfa3ed36a87

See more details on using hashes here.

Provenance

The following attestation bundles were made for gformlib_cli-0.1.0.tar.gz:

Publisher: publish.yml on andhit-r/gformlib-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gformlib_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gformlib_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gformlib_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6aac3caa02f7cf69e81de79c3352a95919af384286af12b95178781a2cf5267
MD5 51e5b2203cca9f454cc9052c900435b6
BLAKE2b-256 b8263c5977bdb31f9110171291bfe2da38a4d449edef064afe3f8786ef22366f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gformlib_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on andhit-r/gformlib-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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