Repository: frictionlessdata/tabulator-py (python)

Issue:
Format not recognised - Google spreadsheet exported as csv 
Tabulator is not able to work out the format for this url:
https://docs.google.com/spreadsheets/d/1shdLtpTEDuYFQHidGSQjSBw2sM0EQ34xD1lm7zyBUi4/export?format=csv&gid=0&single=true

However, it does recognise:
https://docs.google.com/spreadsheets/d/1kPO1CmPvc42j9TouovP5tyiSdegRk1wISLpxMWDlfaQ/pub?gid=0&single=true&output=csv

It seems it can parse pub?... but not export?... form of Google spreadsheet url.


Pull request description:
Fixed gsheet export format detecting
- fixes #189 

Patch:
diff --git a/tabulator/helpers.py b/tabulator/helpers.py
index c17a025..5f1d2c2 100644
--- a/tabulator/helpers.py
+++ b/tabulator/helpers.py
@@ -35,8 +35,10 @@ def detect_scheme_and_format(source):
 
     # Format: gsheet
     if 'docs.google.com/spreadsheets' in source:
-        if 'export' not in source:
+        if 'export' not in source and 'pub' not in source:
             return (None, 'gsheet')
+        elif 'csv' in source:
+            return ('https', 'csv')
 
     # Format: sql
     for sql_scheme in config.SQL_SCHEMES:


Test patch:
diff --git a/tests/test_helpers.py b/tests/test_helpers.py
index ad18ec7..1c32175 100644
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -30,6 +30,9 @@ from tabulator import helpers, config
     ('path', 'file', None),
     ('path.CsV', 'file', 'csv'),
     ('http://someplace.com/foo/path.csv?foo=bar#baz', 'http', 'csv'),
+    ('https://docs.google.com/spreadsheets/d/X/edit?usp=sharing', None, 'gsheet'),
+    ('https://docs.google.com/spreadsheets/d/X/export?format=csv&gid=0&single=true', 'https', 'csv'),
+    ('https://docs.google.com/spreadsheets/d/X/pub?gid=0&single=true&output=csv', 'https', 'csv'),
 ])
 def test_detect_scheme_and_format(source, scheme, format):
     assert helpers.detect_scheme_and_format(source) == (scheme, format)