Over the past few years, various day to day functions of governments in India are being rapidly digitized. Information generated from these functions is stored online and made available through dashboards to enable data backed decision making within the government. However, traditionally, reviews within the government heavily relied on printed sheets of data rigorously arranged and distributed to every participant.
It is against this backdrop of an evolving ecosystem of data representation for governance decision making that there was a need to bridge the traditional practice of decision making through paper based reviews to a completely online, dashboard driven reviews.
TLDR - Key Features
- Convert ODK Form Responses to PDF
- Convert Google Forms to PDF
- Make a base project to convert other forms of templated media to PDF, example Markdown, Images, email etc. This can be done through extending the base converter to suit your needs.
2. Getting started
Note that this project in alpha and the APIs can change without notice. Please use it at your discretion. Though we use it in production, but the we are yet to close the API specification
This doc assumes you have already done the ODK setup for the the setup
2.1 Setting up the docs and data
The first steps are to create the template and mapping data. The detailed docs to which will be added in following week.
2.2 Setting up the google services.
- Setup the Google Credentials for service account credentials on google developer console .
- Copy Service account json credential in GoogleDocPlugin folder and name it as gcs-creds.json.
- Enable the following API => Google Docs, Google Sheets, Google Cloud Storage.
- Creating a Oauth2 access token json from Google developer console.
- Copy Oauth2 Credential json file (client_secret.json) and paste it in GoogleDocPlugin and name it as credentials.json.
- Create a Google App Script and delete all code and copy code from google_app_script_code.js file in GoogleDocPlugin and paste it on script editor and then publish it as a deploy as web app.Deploy as web app pop up opens and select "Anyone,Even Anoynmous" in Who has access to the app . (See network tab on Google Chrome dev console if you have issues with it)
- Update the url in googledoc-config.json.
- Create Google Cloud Storage Bucket and update the bucket name and GOOGLECLOUDBASEURL in googledoc-config.json.
2.3 Fixing the config file
The config file containes all the credentails and configurations that are required for the plugin to work. A sample config file is show below. Please duplicate this and fill the entried based on whatever you have and remove the documentation (json doesn't allow docstrings)
2.4 Running the system.
From the root folder run the following command to start converting data to PDF.
You should start seeing the PDFs in the
- The template document should be available on the authenticated account’s drive. It won’t work if the doc is shared as read/write with the authenticated account.
- If the options are using apostrophe then python and app script aren't parsing it. Eg. Teacher’s were good, is working great. But Teacher's are good, is not working well.
- The image dimensions in app script are fixed 1:1.
- The intermediate google docs are created in the same location as that of template doc.
- If app script failed due to any runtime error then a junk google doc is still created.
- Google App script usage limitations (url fetching) (https://developers.google.com/apps-script/guides/services/quotas#current_limitations)
Feel free to write into firstname.lastname@example.org in case you have questions, feedback or want to know more!
5. Coming Soon
- Monitoring setup
- Single click setup except for the base project
- FusionAuth integration