如何制作从google-app-engine可读的数据 [英] How to make data that download from google-app-engine readable

查看:134
本文介绍了如何制作从google-app-engine可读的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用它来从我的谷歌应用程序下载所有数据:
我按照这篇文章: http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html#Creating_Exporter_Classes



和下载数据使用这个:

  bulkloader.py --dump --url = http://zjm1126.appspot.com/remote_api --filename = b.csv 

但数据是:



alt text http://omploader.org/vNGN6Ng



所以如何使数据可读?



更新



我下载了一个sqlite视图,看到这样:



alt text http://omploader.org/vNGQwcg



这是不可读的,为什么? / p>

这是b.csv http://omploader.org /vNGQwcw/b.csv

解决方案

您似乎使用错误的命令进行下载。您的 - 转储命令会生成一个确实以SQLite 3格式的文件,但由于App Engine的数据存储区不是常规数据库,因此没有太多用处 - 在Datastore中数据不会分散到表的预定义列中。数据以任何数据库的形式保存在行中,但转储文件中的列或多或少地看起来像这样:




  • 列1:唯一行的ID

  • 列2:所有与序列化格式相关的数据(二进制缓冲区格式)



所以你的下载命令应该看起来更像这样:

  appcfg.py download_data --config_file = your_loader.py --filename = b.csv --kind = DbModelName< app-directory> 


I use this to download all data from my google app: I follow this article: http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html#Creating_Exporter_Classes

and download data use this:

bulkloader.py --dump  --url=http://zjm1126.appspot.com/remote_api --filename=b.csv

but the data is :

alt text http://omploader.org/vNGN6Ng

so how to make the data readable ?

updated

I download a sqlite view ,and saw this :

alt text http://omploader.org/vNGQwcg

this is not readable , why ?

this is the b.csv http://omploader.org/vNGQwcw/b.csv

解决方案

You seem to use a wrong command for the download. Your --dump command generates a file whic is indeed in SQLite 3 format but there's not much use of it for you since App Engine's Datastore is not a regular database - in Datastore the data is not spread out into predefined columns of a table. The data is saved in rows like in any database but the columns in the dump file look more or less like this:

  • Column 1: Unique ID of the row
  • Column 2: All the data regarding the row in a serialized form (binary Protocol Buffers format)

So your download command should look more something like this:

appcfg.py download_data --config_file=your_loader.py --filename=b.csv --kind=DbModelName <app-directory>

这篇关于如何制作从google-app-engine可读的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆