CLI program to process a local or remote XML file and push the data of that XML file to a Google Spreadsheet via the Google Sheets API (https://developers.google.com/sheets/).
This CLI program is built on the LARAVEL FRAMEWORK. The program process a local or remote XML file and push the data of the XML file to a Google Spreadsheet via the Google Sheets API Google Spreadsheet API.
The Google Sheets API use the REST APIs like Sheets API and Charts API to interact programmatically with Google Sheets.
Repo Overview 🥳🥳
The repository contains source code on how to read XML data, format it and send to Googlesheet using the Googlesheet API.
Specifications in the clone include
The program reads in a local or remote xml file (configurable as a parameter)
Configurable Authentication against Google API with Service Account and Google cloud credentials
Writing of errors to logfile
Single CLI command to automate the read and write process in less than 5secs
Requirements 🔧🔧
Register and create a google console developer account set up a project retrieve your client credentials and then create a service account (download details in JSON).
Add the API key of your Google developer console and download the service account JSON to the storage directory.
Open the CLI in preferred editor and run the command:
php artisan xml-to-google-spreadsheet
The command also accepts an optional parameter with the file path either local or remotely. The clone already ships with a default file coffee_feed.xml in the public directory.
Once the command is done you'll get a success message in the CLI 😜
Coding Style 🚀🚀
Which patterns have been used: The coding pattern adopted is the creation pattern type where the business logic is hidden into services and traits.
How is your code structured: The code is well structure to use a creational design pattern, inheritance, DRY Principle, typehint of parameter and return type to functional declarations and lot more.
Have you applied SOLID and/or CLEAN CODE principles: Yes
Are tests available and how have they been set up : Yes, the project has a total of 5 test cases (4 Unit and 1 Feature).