Coder Social home page Coder Social logo

googleapis / google-cloud-python Goto Github PK

View Code? Open in Web Editor NEW
4.7K 4.7K 1.5K 352.92 MB

Google Cloud Client Library for Python

Home Page: https://googleapis.github.io/google-cloud-python/

License: Apache License 2.0

Python 99.91% Shell 0.09% Dockerfile 0.01% HTML 0.01%
python

google-cloud-python's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-cloud-python's Issues

If you don't have python-dev and are trying to build crypto, throw an error.

Right now we leave people guessing when a gcc command fails.

Let's check for pycrypto and pyopenssl, and if they're not there, make sure that python-dev is installed so that the compilation won't fail. Otherwise, say you need to install the dev Python stuff or the actual packages for openssl and crypto...

(linux specific)

Let's also check into this for Windows and Mac - maybe they have their act together and do this properly...

datetime property

I not sure is it is a bug but when I have tried save() a entity with a datetime property appear this error.

pb_attr, pb_value = helpers.get_protobuf_attribute_and_value(value)
File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/helpers.py", line 39, in get_protobuf_attribute_and_value
name, value = 'timestamp_microseconds', time.mktime(val.timetuple())
NameError: global name 'time' is not defined

Add support for namespaces

These exist to an extent but aren't universal and certainly not well documented.

There are two options:

  1. Create an object to manage namespaces
from gcloud import datastore
dataset = datastore.get_dataset(...)
namespace = dataset.namespace('my-namespace')
person = namespace.entity('Person')
person['name'] = 'JJ'
person.save()

query = namespace.query('Person')
print query.fetch()
  1. Allow users to pass a namespace argument to various constructors (and set namespaces with a method, akin to setting a kind or id on a Key).
from gcloud import datastore
dataset = datastore.get_dataset(...)
person = dataset.entity('Person')
person.namespace('my-namespace')
person['name'] = 'JJ'
person.save()

query = dataset.query('Person').namespace('my-namespace')
print query.fetch()

or

person = namespace.entity('Person')
person['name'] = 'JJ'
person.save(namespace='my-namespace')

I currently prefer option 2, where a namespace isn't a separate level in the hierarchy, but simply a flag passed around on queries or entities.

Make datastore demo interactive

We can use raw_input(), etc to take names and other fields from the user to make the process more interactive while getting started (and show the code we're actually running as we run it).

Should datastore Key's be immutable?

This seems like a pain in the ass to deal with if they are:

entity = dataset.entity('Person')
entity.key(entity.key().name('name'))

versus

entity = dataset.entity('Person')
entity.key().name('name')

What do we really get by making a Key immutable?

A Query being immutable makes great sense - chaining things together is easy and you can "fork" a query into several different ones. But it's unlikely we'll need to fork a key...

Make gcloud.storage use a streaming HTTP library for downloads

Right now we're using httplib2 because of oauth2client working really nicely with that, however httplib2 doesn't support a streaming download.

This means, a .request() will load the entire response content into memory, which won't work at all for a big file.

To get around this, we chunk the file up using the Range HTTP header and request pieces of it until the end, however the better way to handle this is with a streaming HTTP library:

stream = <send http request>
with open('output.txt', 'wb') as output:
  data = stream.read(CHUNK_SIZE)
  while data:
    output.write(data)
    data = stream.read(CHUNK_SIZE)

To make this work we need to:

  • use a library that does support streaming
  • update oauth2client to work with that library

Add async methods

Is there a way to run multiple requests in parallel?
It would be really nice to be able to execute requests asynchronously, e.g.

future = Query('MyKind').fetch_async()
result = future.get_result()

NDB has a great support for async operations using an event loop.

Is it something you guys might consider for future versions of the client?

How can we cover unit testing for datastore?

Right now, the only way to develop this is by hitting the live Cloud Datastore API. Is there a way we can use these API calls in unit tests without mocking?

Can we have a "local datastore" server that understands the API and makes it easy for local development?

libffi-dev a dependency?

I just installed from scratch and it appears that libffi-dev was a dependency package. Not sure where or how... but that fixed the errors I was getting...

Can we add this to the README ?

attribute 'timedelta' Datetime property when performance a Query

File "/home/albertog/Documents/spyder-2.3.0beta1/scripts/semtable/test/test.py", line 43, in main
q.fetch(1)

File "gcloud/datastore/query.py", line 247, in fetch
return [Entity.from_protobuf(entity) for entity in entity_pbs]

File "gcloud/datastore/entity.py", line 148, in from_protobuf
value = helpers.get_value_from_protobuf(property_pb)

File "gcloud/datastore/helpers.py", line 82, in get_value_from_protobuf
datetime.timedelta(microseconds=microseconds))

AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.