Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g3n1us/datatidy
Get data from Google Sheets and other sources, and return standardized, structured data
https://github.com/g3n1us/datatidy
Last synced: 24 days ago
JSON representation
Get data from Google Sheets and other sources, and return standardized, structured data
- Host: GitHub
- URL: https://github.com/g3n1us/datatidy
- Owner: g3n1us
- License: gpl-3.0
- Created: 2016-10-25T15:15:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-20T01:25:10.000Z (over 7 years ago)
- Last Synced: 2024-11-16T20:09:22.323Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datatidy
Get data from Google Sheets and other sources, and return standardized, structured, tidy data## Usage
#### Options
```php
$defaultoptions = [
'allow_origin' => null, // If a response is to be generated, this value will be applied to an Access-Control-Allow-Origin header
'resultsas' => 'collection', // or paginate or array
'sort' => false, // key by which to sort
'ascending' => false, // applies to the sort order
'nomd' => false, // my default, content will be converted to HTML with Markdown, this option disables this
'paginate' => false,
'show_pagination' => true,
'results_per_page' => 12,
];
```
### Arguments##### URI or path to retrieve data.
To retrieve a Google Sheets spreadsheet, use the format: `gproxy://`**NOTE: The spreadsheet must be published publicly!**
For other JSON formatted URIs, specify either a relative or absolute endpoint to retrieve
##### OPTIONS: An array of options as shown above
#### Call via static methods
```php
DataTidy::response("gproxy://1R4ZW6fw7EggY6AsmBtVGWdjny-UYDgv3au6_VarHBMk", ['allow_origin' => '*']);
// Returns a full ResponseDataTidy::get("gproxy://1R4ZW6fw7EggY6AsmBtVGWdjny-UYDgv3au6_VarHBMk");
// Returns the data as an instance of Illuminate\Collection
```#### Call via constructor
```php
use G3n1us\DataTidy;$datatidy = new Datatidy("gproxy://1R4ZW6fw7EggY6AsmBtVGWdjny-UYDgv3au6_VarHBMk");
$datatidy->get();
// or
$datatidy->response();
```