You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose of this project for the time being is to pass json data to a csv
file for end users who use Gdrive across the organization.
This project is currently in beta status. Issues and PRs welcome!
Example usage as pandas client
# Set GDRIVE_TEST_URL and GDRIVE_TEST_KEY in your enviornment vars.frompandas_ext.gdriveimportread_gdrive, to_gdriveresults=read_gdrive('https://drive.google.com/uc?id=ABCDEFG')
wresults=to_gdrive('atest.csv', results.df, results.folder_id)
wresults'https://drive.google.com/uc?id=ABCXYZ&export=download'
Pre-Requisites
pyenv # for saving this project as a 2.7 project for aws lambda
Create a folder somewhere in Gdrive where you would like to save report sub-folders and take note of it's ID.
Set this ID so the GDRIVE_PARENT_FOLDER_ID in your environment variables. This can be overridden in the POST as well.
Run the service at least once. # See testing below
Share the folders with specific people you want to send the report to.
In order to make this more useful, you will have to dynamically generate the json and save it periodically.
For this I will use another set of lambdas so stay tuned!
To test locally
Personally, I use httpie to test but cURL should work just as well.
In the first terminal window, run the following
python app.py
In another terminal window:
http POST https://localhost:5000/gdrive < post_params.json
or:
http POST https://localhost:5000/gdrive file_name=test.csv data:=@post_params2.json
TODO
[ ] Work with file types other than CSV (Ideally using odo)