Created
February 16, 2017 04:05
-
-
Save chidakiyo/bcf6115e4d5ba6849693afc0f6c81568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from gcloud import datastore | |
import os | |
project = os.environ.get('GAE_PROJECT') | |
print "target : " + project | |
client = datastore.Client(project) | |
query = client.query(kind='') | |
query.keys_only() | |
task = query.fetch() | |
for entity in task: | |
key = entity.key | |
if key._path[0]['kind'].startswith('__') == False: # meta系のレコードは消さない | |
print "delete at : " + key._path[0]['kind'] + " : " + key._path[0]['name'] | |
client.delete(key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment