hellofresh / ausraster

Taking the (╯°□°)╯︵ ┻━┻ out of working with documents
http://hellofresh.github.io/ausraster/
MIT License
7 stars 2 forks source link

Google Sheets adapter #10

Open kieranajp opened 7 years ago

kieranajp commented 7 years ago

Ausraster comprises a set of interfaces around document libraries. The idea is to have one sane interface to interact with documents of many formats. In its current state it has a set of Spreadsheet interfaces - offering a nice API to manipulate .xlsx files by wrapping PHPExcel - and in future I'd like to have interfaces for rich text documents (.docx, Google Docs, .rtf), slideshows (.pptx, Google Slides) etc.

This issue is to add another adapter to the project so it supports a new file format - for example I've started on a CSV adapter in #9. It would be great to get some help to add an adapter for Google Sheets. That way, someone could use the same API whether they want to create an .xlsx file for download, or create a Google Sheet.

This would entail pulling in a library from Composer (as a Suggested package) to work with the Google Sheets API, creating a namespace at HelloFresh\Ausraster\Spreadsheet\<package name>, and building implementations of Document, Worksheet and Cell in a very similar manner to how the PHPExcel adapter currently works.

Please see contributing.md for contribution guidelines, and happy hacking!

xRahul commented 7 years ago

Hi @kieranajp Can you provide some description as to what the issue is and where?

kieranajp commented 7 years ago

@xRahul Updated, if you're still interested in claiming this one

xRahul commented 7 years ago

@kieranajp sure! I'll check the code out then!

xRahul commented 7 years ago

Hey @kieranajp, The google sheets require a lot more to interface with them like authorization/OAuth etc. It's not a simple Document::open('filename.xlsx') in that case.

Any ideas on how to take care of this?

kieranajp commented 7 years ago

Hi @xRahul,

It's ok to have extra methods for these things, so long as the core API for editing spreadsheets is consistent for excel / google sheets / everything else. So feel free to add extra methods for auth etc, even an extra interface if you think it needs one (see also Interface Segregation Principle if you're not already familiar with it).

I need to have a proper read of the documentation for Google Sheets to work out how I'd do it, but feel free to open a PR even if it's not finished and I can offer feedback on your approach! (That will count towards Hacktoberfest as well)

I'll try and read the documentation soon so I have a clear idea of the issues you're having. I know how painful Google APIs can be sometimes though so I understand if it's a bit tricky.