Skip to content

Instantly share code, notes, and snippets.

@saurabh1969
Last active August 23, 2019 15:40
Show Gist options
  • Save saurabh1969/3e464dd88d4ec845262287c785c04eeb to your computer and use it in GitHub Desktop.
Save saurabh1969/3e464dd88d4ec845262287c785c04eeb to your computer and use it in GitHub Desktop.
Google Summer of Code 2019 report- PEcAn Project

Google Summer of Code 2019 Report

Meta-Data Upload Interface

1.Introduction

The aim of the project is to allow users to upload the data in form of files(csv,data table, google sheets, etc.) to BETYdb Postgres. It is to be done by creating an interface which will provide logical workflow to guide the user through the process of uploading to BETYdb.All related code can be found to below repository.

Link to the repository: https://github.com/PecanProject/BETYdb-YABA

Features implemented:

  • Swagger documentation of YABA api
  • Flask api with endpoints for diffferent tables of bety.
  • Flask application client library to YABA
  • Unit tests of both api and client
  • Docker implementation
  • Travis CI implementation

2.Code Contribution

3.Implementation

The tool is a Flask application that has both api and client:

  • app - is the main folder that contains the YABA api code
  • yaba_test - contains all the test files for api endpoints
  • client - contains code for YABA client.
  • input_files - all sample files are stored
  • .travis - travis CI implementation configuration file.

The app is minimalistic since the main objective is to do bulk upload and will be integrated in bigger environments.

server.py(app/server.py)

Contains the main module of the Server file.

  • adds the swagger documentation of YABA
  • routes to endpoints

yaba.yaml(app/yaba.yaml)

Swagger documentation of YABA api.

Link: https://app.swaggerhub.com/apis-docs/y51/bet-ydb_yaba/1.0.5

meta.py(app/meta.py)

Contains code implementation of the endpoints.

db.py(app/db.py)

Contains the code for database configuration for YABA api.

client.py(client/client.py)

Contains the code for client to YABA api.

4.Things left to tackle

UI Interface for YABA have not yet been completely implemented. Addition of basic pages have been pushed but might need modification in future for proper display.

Final Words

GSoC was a huge learning experience for me. Now I feel more comfortable with the application development process.While developing this application, i got extensive exposure in Docker based application development.I am now lot more comfortable in developing Swagger documentation,travis deployment and Git for version control.PEcAn project is being developed with wonderful vision and i am quite lucky to be part of it.

Acknowledgments

I am thankful to my mentors David LeBauer and Kristina Riemer who provided expertise that greatly assisted in the development of this application.

Author

Kumar Saurabh - (https://github.com/saurabh1969)

License

PecanProject is licensed under the BSD 3-Clause license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment