Skip to main content

Google/Excel Sheets API Python.

Project description

sheet2api-python

Google/Excel Sheets API Python Client. For use with https://sheet2api.com/

Build Status PyPI version

Installation

Install using pip...

pip install sheet2api

Usage Examples

Before starting you should head over to sheet2api.com and link up your Google Sheets or Excel Online account and create your first Spreadsheet API.

Next, create an instance of the client and pass in the API URL to your API.

from sheet2api import Sheet2APIClient

client = Sheet2APIClient(api_url='https://sheet2api.com/v1/FgI6zV8qT222/my-api/')
# If your API has authentication enabled
client = Sheet2APIClient(
    api_url='https://sheet2api.com/v1/FgI6zV8qT222/my-api/',
    username='api_username_here',
    password='api_password_here',
)

Get all rows

Returns all rows within the first Sheet of your Spreadsheet.

client.get_rows()

# Returns a list of dicts
[{
	'name': 'Bob',
	'age': 22
}, {
	'name': 'Richard',
	'age': 19
}, {
	'name': 'Bob Jones',
	'age': 99
}]

To return rows from a specific Sheet.

client.get_rows(sheet='Sheet1')

Get all rows matching a query

Returns all rows matching a query.

client.get_rows(query={'name': 'Bob'})

Create a new row

client.create_row(sheet='Sheet1', row={'name': 'Jane','age': 18})

Update all rows which match a query

This will update the entire row for the matches, if you fail to specificy all column values in the replacement row, those cells will be filled with an empty value.

client.update_rows(
    sheet='Sheet1,
    query={'name': 'Philip'},
    row={
        'name': 'Phil',
        'age': 99999
    },
)

Partially update rows matching a query.

This will only update the columns which you provide replacement values for in the row dict parameter. All other columns will be left unchanged.

client.update_rows(
    sheet='Sheet1,
    query={'name': 'Philip'},
    row={
        'age': 99999
    },
    partial_update=True,
)

Delete all rows matching a query

client.delete_rows(sheet='Sheet1', query={'name': 'Satan'})

Support

Contact support

Release History

0.1.3 (2020-08-01)

  • Docs fixes.

0.1.2 (2020-05-10)

  • Documentation updates.

0.1.1 (2020-05-07)

  • Documentation updates.

0.1.0 (2020-05-06)

  • Initial release.

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

sheet2api-0.1.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

sheet2api-0.1.3-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sheet2api-0.1.3.tar.gz.

File metadata

  • Download URL: sheet2api-0.1.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for sheet2api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b915f76e436378f4786d05228f32a51911224b92facba95b6c6fb26875f95d0f
MD5 e19a9145fca660500b25269ce9b7583f
BLAKE2b-256 0f3f86a9c1c6d1d573d708b7f3687679f3b27a33250860c0ed803e958e540a43

See more details on using hashes here.

File details

Details for the file sheet2api-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: sheet2api-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for sheet2api-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 921eecd77cd7bd76dc9e910f4b0172b81a65039d246d0d06d5dae471e6ca8662
MD5 b883baaf9a8934fb5949c4350a98217a
BLAKE2b-256 c6169a282e5fde025ba86141df74834f4fef92280ab2106efb1bf1af0f2a624b

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