Skip to main content

A Google Sheets ORM and Query Builder

Project description

GSheetQuery

GSheetQuery is a python library for using Google Sheets as a document database. It modeled after pymongo's interface.

License: MIT Open Issues Build Status codecov PyPI ReadTheDocs

Overview

For small projects, full Python frameworks can be overkill (Django). Especially if you want code up and running quickly. Google Sheets can be leveraged as a database and made accessible by GSheetQuery.

This library will allow users to interact with google sheets as a document database similar to MongoDB.

Install

Install using pip install gsheetquery in your preferred command line. Import to your python files like any other module.

Quickstart

from gsheetquery import Client, Collection

# Initialize the client object
client = Client()

# Create a new database
database = client.create_database("my_new_database")

# Add a new collection to the database
new_collection = database['new-collection']

# List the collections in the database
collection_names = database.list_collection_names()
print("Collections in the database:", collection_names)

# Add a doc to the collection
new_doc = {"name": "Bob", "age", "30"}
new_collection.insert_one(new_doc)

# Query the collection
new_collection.find_one({"age": "30"})

# Delete the database
client.drop_collection('new-collection')

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

gsheetquery-0.0.3.tar.gz (11.1 kB view hashes)

Uploaded Source

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