Coder Social home page Coder Social logo

gsheets-assistant's Introduction

Setup

Enable GSheets API

Create client secret

  • Go to: https://console.developers.google.com/apis/credentials
  • Create credentials ➤ OAuth client ID
  • Create an “Google Sheets API Quickstart” ID (the name itself might matter here), Type "Other UI" accessing "User data"
  • Save the “client_secret_etcblahblah.apps.googleusercontent.com.json” file

References:

Usage

Demo

Build image

docker build . --file Dockerfile --tag gsheets-assistant

Run tests

docker build . --file Dockerfile --tag gsheets-assistant --target gsheets-assistant-tests

Build wheel

docker build . --file Dockerfile --tag gsheets-assistant --target gsheets-assistant-package
docker run --rm --entrypoint=/bin/tar gsheets-assistant -c -C /gsheets-assistant/dist . | tar x

Installing the tool

pip install gsheets_assistant-$(cat VERSION)-py3-none-any.whl --upgrade

Running the tool

Note that if you run this from the top level of the repo, you'll be running the raw code directly, rather than the installed wheel. The first time you run one of these, it will prompt you to load a URL in your browser and approve, and then it'll save creds to ~/.credentials Subsequent runs will use the saved credentials.

Demo: Read sample file
python3 -m gsheets_assistant.__demo_read__ --secret-file PATH_TO_YOUR_SECRET_FILE
Demo: Create sample sheet

Create your empty spreadsheet first, and provide the ID here.

python3 -m gsheets_assistant.__demo_write__ --secret-file PATH_TO_YOUR_SECRET_FILE --spreadsheet SPREADSHEET_ID

Things you can do

TODO: Cheat sheet for various convenience options

Using a virtual env

Using a virtualenv to run the tool is recommended, but of course you do you. If you're unfamiliar, here's how to use a virtualenv in Python 3.3+. The ... below is where you'll type all the install and runtime things that you want to keep isolated from your larger system, at the (venv) prompt.

1. Create a venv folder in the project
python -m venv venv
2. Enter the venv
source venv/bin/activate
(venv) $ ...
3. Exit the venv
(venv) $ deactivate

gsheets-assistant's People

Contributors

dreadpirateshawn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.