betodealmeida opened a new pull request #16416:
URL: https://github.com/apache/superset/pull/16416


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   [Shillelagh](https://github.com/betodealmeida/shillelagh/) is a library for 
querying APIs via SQL. It's currently used by Superset in order to connect to 
Google Sheets, but it offers more APIs:
   
   #### Datasette
   
   [Datasette](https://datasette.io/) is an open-source tool for exploring and 
publishing data, developed by one of the creators of Django. "Datasettes" are 
self-hosted micro web apps that serve a few tables, with a friendly UI. For 
example, [this list of trees in 
SF](https://san-francisco.datasettes.com/sf-trees/Street_Tree_List).
   
   Shillelagh can query any Datasette table directly:
   
   ```sql
   % shillelagh
   sql> SELECT * FROM 
"https://san-francisco.datasettes.com/sf-trees/Street_Tree_List"; LIMIT 5;
     TreeID    qLegalStatus    qSpecies  qAddress             SiteOrder    
qSiteInfo    PlantType    qCaretaker  qCareAssistant    PlantDate               
  DBH  PlotSize    PermitNotes                XCoord       YCoord    Latitude   
 Longitude  Location
   --------  --------------  ----------  -----------------  -----------  
-----------  -----------  ------------  ----------------  
----------------------  -----  ----------  --------------------  -----------  
-----------  ----------  -----------  -------------------------------------
     141565               1           1  501X Baker St                1         
   1            1             1                    07/21/1988 12:00:00 AM     
21  Width 0ft   Permit Number 25401   6.00061e+06  2.11083e+06     37.776      
-122.441  (37.7759676911831, -122.441396661871)
     232565               2           2  940 Elizabeth St             1         
   2            1             1                    03/20/2017 12:00:00 AM      
3  Width 4ft   Permit Number 779625  6.0004e+06   2.102e+06       37.7517     
-122.441  (37.7517102172731, -122.441498017841)
     119263               3           3  495X Lakeshore Dr            1         
   3            1             2                                                 
  10x30
     207368               2           4  920 Kirkham St               1         
   1            1             1                                                
6  Width 1ft                         5.99201e+06  2.10527e+06     37.7602     
-122.471  (37.760210314285, -122.47073935813)
     188702               3           5  1501 Evans Ave               2         
   4            1             2                                               
17  Width 4ft                         6.01599e+06  2.09822e+06     37.7422     
-122.387  (37.7422086702947, -122.387293152263)
   sql>
   ```
   
   We can create a dataset in Superset and make a map of red maple trees in SF:
   
   ![Screenshot 2021-08-23 at 21-12-41  DEV  Red maple trees in 
SF](https://user-images.githubusercontent.com/1534870/130554644-8e1549b3-5660-4664-a228-c3999ece7d78.png)
   
   #### Socrata
   
   The [Socrata Open Data API](https://dev.socrata.com/) is a simple API used 
by many governments, non-profits, and NGOs around the world, including the CDC. 
Shillelagh can connect directly to any Socrata dataset by appending `.json` to 
the URL. Here's an example showing the percentage of adults partially 
vaccinated for COVID-19 in the US:
   
   ```sql
   % shillelagh
   sql> SELECT date, administered_dose1_recip_4 FROM 
"https://data.cdc.gov/resource/unsk-b7fc.json"; WHERE location='US' LIMIT 5;
   date          administered_dose1_recip_4
   ----------  ----------------------------
   2021-08-23                          73.1
   2021-08-22                          73
   2021-08-21                          72.9
   2021-08-20                          72.7
   2021-08-19                          72.5
   sql>
   ```
   
   We can also create a dataset in Superset and make a time series:
   
   ![Screenshot 2021-08-23 at 21-21-45  DEV  % adults partially vaccinated 
US](https://user-images.githubusercontent.com/1534870/130555300-d7a5e0ff-d029-47a7-b0a1-cac75acf4573.png)
   
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to