Skip to content

Commit 2018fc6

Browse files
committed
Update README.md
1 parent 3d99789 commit 2018fc6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,21 @@ deleted = client.delete_table('dataset', 'my_table')
110110
exists = client.check_table('dataset', 'my_table')
111111
```
112112

113+
There is also functionality for retrieving tables that are associated with a Google App Engine appspot, assuming table names are in the form of appid_YYYY_MM or YYYY_MM_appid. This allows tables between a date range to be selected and queried on.
114+
115+
```python
116+
# Get appspot tables falling within a start and end time.
117+
from datetime import datetime, timedelta
118+
range_end = datetime.utcnow()
119+
range_start = range_end - timedelta(weeks=12)
120+
tables = client.get_tables('dataset', 'appid',
121+
calendar.timegm(range_start.timetuple()),
122+
calendar.timegm(range_end.timetuple()))
123+
```
124+
113125
# Inserting Data
114126

115-
The client also provides an API for inserting data into a BigQuery table.
127+
The client provides an API for inserting data into a BigQuery table.
116128

117129
```python
118130
# Insert data into table.

0 commit comments

Comments
 (0)