Simple Extractor on Sheets or SEOS wraps extraction on Google Sheets
Project description
Seos
Simple Extractor on Sheets (or SEOS) is an extraction tool focused on Google Sheet data scraping. It uses Google's Python API client to access those data; this allows the library to access on a lower level functions defined by Google without the need of using another Sheets abstraction.
Features
Seos features are put below and their status if they're well-tested using PyTest.
Feature | Status |
---|---|
Connection to a Google Sheet given an OAuth credentials file and Sheet ID | |
Extraction on a sheet with a defined scope | |
Sheet name switching |
Installation
# if using poetry
# highly recommended
poetry add seos
# also works with standard pip
pip install seos
Getting Started
Seos uses APIs defined by Google to access Sheets data; but the idea is that developing with Seos should be understandable when connecting to a data and changing contexts; e.g. change in Sheet Name or change in scope.
The initial step would be to pass a credentials file and the sheet ID as an entrypoint to the data. It assumes that you have a credentials file taken from Google Cloud
in JSON format
.
from seos import Seos
extractor = Seos(
credentials_file="./credentials.json"
spreadsheet_id="<SPREADSHEET-ID>"
)
Once an extractor context is created, we can then define the sheet name
and scope
then executing extract if you're happy with the parameters.
extractor.sheet_name = "Report - June 1, 1752"
extractor.scope = "A1:D1"
extractor.extract()
With this, changing the scope and the sheet name will act as a cursor for your sheet data. We can get anything from the sheet just by changing the scope.
extractor.sheet_name = "Report - June 1, 1752"
extractor.scope = "A1:D" # get all from A1 until end of column D
extractor.extract()
We can even do sheet switching if necessary for data that contains several contexts.
extractor.sheet_name = "Report - June 1, 1752"
extractor.scope = "A1:D"
extractor.extract()
extractor.sheet_name = "Report - June 2, 1752"
extractor.scope = "B5:G5"
extractor.extract()
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
File details
Details for the file seos-0.3.5.tar.gz
.
File metadata
- Download URL: seos-0.3.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.2 CPython/3.6.8 Darwin/19.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff7663b8525a24f6c4824fc906363db728525c8b64e25c0f10afe23c0f0d123 |
|
MD5 | c684d694e85708b7d57aed6f045b8202 |
|
BLAKE2b-256 | a06c4c297b81af71fe7d295dc2f68d1c6eca3ae77c0e80f2e98677aa2d16ca2f |
File details
Details for the file seos-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: seos-0.3.5-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.2 CPython/3.6.8 Darwin/19.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5990110e6ea510bbe81f7568ab7d2f1b8522f127f5841cc230e2852a30c81799 |
|
MD5 | f332bb3bf51a8a0f812bec8d4b62f777 |
|
BLAKE2b-256 | adba004293c1a9876b9b1de066f7ed96f9121d55d9c8fe89b015ad8d84f8d0e6 |