diff --git a/README.rst b/README.rst index 39568ec8a5a8..94017bea6257 100644 --- a/README.rst +++ b/README.rst @@ -20,16 +20,28 @@ This client supports the following Google Cloud Platform services: - `Google Cloud Pub/Sub`_ - `Google BigQuery`_ - `Google Cloud Resource Manager`_ -- `Google Stackdriver Logging`_ -- `Google Stackdriver Monitoring`_ - -.. _Google Cloud Datastore: https://github.com/GoogleCloudPlatform/google-cloud-python#google-cloud-datastore -.. _Google Cloud Storage: https://github.com/GoogleCloudPlatform/google-cloud-python#google-cloud-storage -.. _Google Cloud Pub/Sub: https://github.com/GoogleCloudPlatform/google-cloud-python#google-cloud-pubsub -.. _Google BigQuery: https://github.com/GoogleCloudPlatform/google-cloud-python#google-bigquery -.. _Google Cloud Resource Manager: https://github.com/GoogleCloudPlatform/google-cloud-python#google-cloud-resource-manager -.. _Google Stackdriver Logging: https://github.com/GoogleCloudPlatform/google-cloud-python#google-stackdriver-logging -.. _Google Stackdriver Monitoring: https://github.com/GoogleCloudPlatform/google-cloud-python#google-stackdriver-monitoring +- `Stackdriver Logging`_ +- `Stackdriver Monitoring`_ +- `Google Cloud Bigtable`_ +- `Google Cloud DNS`_ +- `Stackdriver Error Reporting`_ +- `Google Cloud Natural Language`_ +- `Google Translate`_ +- `Google Cloud Vision`_ + +.. _Google Cloud Datastore: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/datastore +.. _Google Cloud Storage: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/storage +.. _Google Cloud Pub/Sub: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/pubsub +.. _Google BigQuery: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/bigquery +.. _Google Cloud Resource Manager: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/resource_manager +.. _Stackdriver Logging: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/logging +.. _Stackdriver Monitoring: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/monitoring +.. _Google Cloud Bigtable: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/bigtable +.. _Google Cloud DNS: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/dns +.. _Stackdriver Error Reporting: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/error_reporting +.. _Google Cloud Natural Language: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/language +.. _Google Translate: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/translate +.. _Google Cloud Vision: https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/vision If you need support for other Google APIs, check out the `Google APIs Python Client library`_. @@ -64,250 +76,6 @@ You may also find the `authentication document`_ shared by all the .. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html .. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication -Google Cloud Datastore ----------------------- - -Google `Cloud Datastore`_ (`Datastore API docs`_) is a fully managed, schemaless -database for storing non-relational data. Cloud Datastore automatically scales -with your users and supports ACID transactions, high availability of reads and -writes, strong consistency for reads and ancestor queries, and eventual -consistency for all other queries. - -.. _Cloud Datastore: https://cloud.google.com/datastore/docs -.. _Datastore API docs: https://cloud.google.com/datastore/docs/ - -See the ``google-cloud-python`` API `datastore documentation`_ to learn how to -interact with the Cloud Datastore using this Client Library. - -.. _datastore documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/datastore-client.html - -See the `official Google Cloud Datastore documentation`_ for more details on how -to activate Cloud Datastore for your project. - -.. _official Google Cloud Datastore documentation: https://cloud.google.com/datastore/docs/activate - -.. code:: python - - from google.cloud import datastore - # Create, populate and persist an entity - entity = datastore.Entity(key=datastore.Key('EntityKind')) - entity.update({ - 'foo': u'bar', - 'baz': 1337, - 'qux': False, - }) - # Then query for entities - query = datastore.Query(kind='EntityKind') - for result in query.fetch(): - print result - -Google Cloud Storage --------------------- - -Google `Cloud Storage`_ (`Storage API docs`_) allows you to store data on Google -infrastructure with very high reliability, performance and availability, and can -be used to distribute large data objects to users via direct download. - -.. _Cloud Storage: https://cloud.google.com/storage/docs -.. _Storage API docs: https://cloud.google.com/storage/docs/json_api/v1 - -See the ``google-cloud-python`` API `storage documentation`_ to learn how to connect -to Cloud Storage using this Client Library. - -.. _storage documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/storage-client.html - -You need to create a Google Cloud Storage bucket to use this client library. -Follow along with the `official Google Cloud Storage documentation`_ to learn -how to create a bucket. - -.. _official Google Cloud Storage documentation: https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets - -.. code:: python - - from google.cloud import storage - client = storage.Client() - bucket = client.get_bucket('bucket-id-here') - # Then do other things... - blob = bucket.get_blob('remote/path/to/file.txt') - print blob.download_as_string() - blob.upload_from_string('New contents!') - blob2 = bucket.blob('remote/path/storage.txt') - blob2.upload_from_filename(filename='/local/path.txt') - -Google Cloud Pub/Sub --------------------- - -Google `Cloud Pub/Sub`_ (`Pub/Sub API docs`_) is designed to provide reliable, -many-to-many, asynchronous messaging between applications. Publisher -applications can send messages to a ``topic`` and other applications can -subscribe to that topic to receive the messages. By decoupling senders and -receivers, Google Cloud Pub/Sub allows developers to communicate between -independently written applications. - -.. _Cloud Pub/Sub: https://cloud.google.com/pubsub/docs -.. _Pub/Sub API docs: https://cloud.google.com/pubsub/reference/rest/ - -See the ``google-cloud-python`` API `Pub/Sub documentation`_ to learn how to connect -to Cloud Pub/Sub using this Client Library. - -.. _Pub/Sub documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/pubsub-usage.html - -To get started with this API, you'll need to create - -.. code:: python - - from google.cloud import pubsub - - client = pubsub.Client() - topic = client.topic('topic_name') - topic.create() - - topic.publish('this is the message_payload', - attr1='value1', attr2='value2') - -Google BigQuery ---------------- - -Querying massive datasets can be time consuming and expensive without the -right hardware and infrastructure. Google `BigQuery`_ (`BigQuery API docs`_) -solves this problem by enabling super-fast, SQL-like queries against -append-only tables, using the processing power of Google's infrastructure. - -.. _BigQuery: https://cloud.google.com/bigquery/what-is-bigquery -.. _BigQuery API docs: https://cloud.google.com/bigquery/docs/reference/v2/ - -This package is still being implemented, but it is almost complete! - -Load data from CSV -~~~~~~~~~~~~~~~~~~ - -.. code:: python - - import csv - - from google.cloud import bigquery - from google.cloud.bigquery import SchemaField - - client = bigquery.Client() - - dataset = client.dataset('dataset_name') - dataset.create() # API request - - SCHEMA = [ - SchemaField('full_name', 'STRING', mode='required'), - SchemaField('age', 'INTEGER', mode='required'), - ] - table = dataset.table('table_name', SCHEMA) - table.create() - - with open('csv_file', 'rb') as readable: - table.upload_from_file( - readable, source_format='CSV', skip_leading_rows=1) - -Perform a synchronous query -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code:: python - - # Perform a synchronous query. - QUERY = ( - 'SELECT name FROM [bigquery-public-data:usa_names.usa_1910_2013] ' - 'WHERE state = "TX"') - query = client.run_sync_query('%s LIMIT 100' % QUERY) - query.timeout_ms = TIMEOUT_MS - query.run() - - for row in query.rows: - print row - - -See the ``google-cloud-python`` API `BigQuery documentation`_ to learn how to connect -to BigQuery using this Client Library. - -.. _BigQuery documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html - -Google Cloud Resource Manager ------------------------------ - -The Cloud `Resource Manager`_ API (`Resource Manager API docs`_) provides -methods that you can use to programmatically manage your projects in the -Google Cloud Platform. - -.. _Resource Manager: https://cloud.google.com/resource-manager/ -.. _Resource Manager API docs: https://cloud.google.com/resource-manager/reference/rest/ - -See the ``google-cloud-python`` API `Resource Manager documentation`_ to learn how to -manage projects using this Client Library. - -.. _Resource Manager documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/resource-manager-api.html - -Google Stackdriver Logging --------------------------- - -`Stackdriver Logging`_ API (`Logging API docs`_) allows you to store, search, -analyze, monitor, and alert on log data and events from Google Cloud Platform. - -.. _Stackdriver Logging: https://cloud.google.com/logging/ -.. _Logging API docs: https://cloud.google.com/logging/docs/ - -.. code:: python - - from google.cloud import logging - client = logging.Client() - logger = client.logger('log_name') - logger.log_text("A simple entry") # API call - -Example of fetching entries: - -.. code:: python - - entries, token = logger.list_entries() - for entry in entries: - print entry.payload - -See the ``google-cloud-python`` API `logging documentation`_ to learn how to connect -to Stackdriver Logging using this Client Library. - -.. _logging documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/logging-usage.html - -Google Stackdriver Monitoring ------------------------------ - -`Stackdriver Monitoring`_ (`Monitoring API docs`_) collects metrics, -events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), -hosted uptime probes, application instrumentation, and a variety of common -application components including Cassandra, Nginx, Apache Web Server, -Elasticsearch and many others. Stackdriver ingests that data and generates -insights via dashboards, charts, and alerts. - -This package currently supports all Monitoring API operations other than -writing custom metrics. - -.. _Stackdriver Monitoring: https://cloud.google.com/monitoring/ -.. _Monitoring API docs: https://cloud.google.com/monitoring/api/ref_v3/rest/ - -List available metric types: - -.. code:: python - - from google.cloud import monitoring - client = monitoring.Client() - for descriptor in client.list_metric_descriptors(): - print(descriptor.type) - -Display CPU utilization across your GCE instances during the last five minutes: - -.. code:: python - - metric = 'compute.googleapis.com/instance/cpu/utilization' - query = client.query(metric, minutes=5) - print(query.as_dataframe()) - -See the ``google-cloud-python`` API `monitoring documentation`_ to learn how to connect -to Stackdriver Monitoring using this Client Library. - -.. _monitoring documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/monitoring-usage.html - Contributing ------------ diff --git a/MANIFEST.in b/bigquery/MANIFEST.in similarity index 100% rename from MANIFEST.in rename to bigquery/MANIFEST.in diff --git a/bigquery/README.rst b/bigquery/README.rst new file mode 100644 index 000000000000..f7cc9b7809ca --- /dev/null +++ b/bigquery/README.rst @@ -0,0 +1,89 @@ +Python Client for Google Cloud BigQuery +======================================= + + Python idiomatic client for `Google Cloud BigQuery`_ + +.. _Google Cloud BigQuery: https://cloud.google.com/bigquery/what-is-bigquery + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-bigquery + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +Querying massive datasets can be time consuming and expensive without the +right hardware and infrastructure. Google `BigQuery`_ (`BigQuery API docs`_) +solves this problem by enabling super-fast, SQL-like queries against +append-only tables, using the processing power of Google's infrastructure. + +.. _BigQuery: https://cloud.google.com/bigquery/what-is-bigquery +.. _BigQuery API docs: https://cloud.google.com/bigquery/docs/reference/v2/ + +Load data from CSV +~~~~~~~~~~~~~~~~~~ + +.. code:: python + + import csv + + from google.cloud import bigquery + from google.cloud.bigquery import SchemaField + + client = bigquery.Client() + + dataset = client.dataset('dataset_name') + dataset.create() # API request + + SCHEMA = [ + SchemaField('full_name', 'STRING', mode='required'), + SchemaField('age', 'INTEGER', mode='required'), + ] + table = dataset.table('table_name', SCHEMA) + table.create() + + with open('csv_file', 'rb') as readable: + table.upload_from_file( + readable, source_format='CSV', skip_leading_rows=1) + +Perform a synchronous query +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code:: python + + # Perform a synchronous query. + QUERY = ( + 'SELECT name FROM [bigquery-public-data:usa_names.usa_1910_2013] ' + 'WHERE state = "TX"') + query = client.run_sync_query('%s LIMIT 100' % QUERY) + query.timeout_ms = TIMEOUT_MS + query.run() + + for row in query.rows: + print row + + +See the ``google-cloud-python`` API `BigQuery documentation`_ to learn how +to connect to BigQuery using this Client Library. + +.. _BigQuery documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html diff --git a/google/__init__.py b/bigquery/google/__init__.py similarity index 94% rename from google/__init__.py rename to bigquery/google/__init__.py index 14aa202c24c1..23249e594bab 100644 --- a/google/__init__.py +++ b/bigquery/google/__init__.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Base ``google`` namespace package.""" - try: import pkg_resources pkg_resources.declare_namespace(__name__) diff --git a/google/cloud/__init__.py b/bigquery/google/cloud/__init__.py similarity index 93% rename from google/cloud/__init__.py rename to bigquery/google/cloud/__init__.py index 1768fdd079a2..ba4ea9e9702a 100644 --- a/google/cloud/__init__.py +++ b/bigquery/google/cloud/__init__.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Google Cloud API access in idiomatic Python.""" - try: import pkg_resources pkg_resources.declare_namespace(__name__) diff --git a/google/cloud/bigquery/__init__.py b/bigquery/google/cloud/bigquery/__init__.py similarity index 100% rename from google/cloud/bigquery/__init__.py rename to bigquery/google/cloud/bigquery/__init__.py diff --git a/google/cloud/bigquery/_helpers.py b/bigquery/google/cloud/bigquery/_helpers.py similarity index 100% rename from google/cloud/bigquery/_helpers.py rename to bigquery/google/cloud/bigquery/_helpers.py diff --git a/google/cloud/bigquery/client.py b/bigquery/google/cloud/bigquery/client.py similarity index 100% rename from google/cloud/bigquery/client.py rename to bigquery/google/cloud/bigquery/client.py diff --git a/google/cloud/bigquery/connection.py b/bigquery/google/cloud/bigquery/connection.py similarity index 100% rename from google/cloud/bigquery/connection.py rename to bigquery/google/cloud/bigquery/connection.py diff --git a/google/cloud/bigquery/dataset.py b/bigquery/google/cloud/bigquery/dataset.py similarity index 100% rename from google/cloud/bigquery/dataset.py rename to bigquery/google/cloud/bigquery/dataset.py diff --git a/google/cloud/bigquery/job.py b/bigquery/google/cloud/bigquery/job.py similarity index 100% rename from google/cloud/bigquery/job.py rename to bigquery/google/cloud/bigquery/job.py diff --git a/google/cloud/bigquery/query.py b/bigquery/google/cloud/bigquery/query.py similarity index 100% rename from google/cloud/bigquery/query.py rename to bigquery/google/cloud/bigquery/query.py diff --git a/google/cloud/bigquery/schema.py b/bigquery/google/cloud/bigquery/schema.py similarity index 100% rename from google/cloud/bigquery/schema.py rename to bigquery/google/cloud/bigquery/schema.py diff --git a/google/cloud/bigquery/table.py b/bigquery/google/cloud/bigquery/table.py similarity index 100% rename from google/cloud/bigquery/table.py rename to bigquery/google/cloud/bigquery/table.py diff --git a/bigquery/setup.py b/bigquery/setup.py new file mode 100644 index 000000000000..0820242f1f72 --- /dev/null +++ b/bigquery/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-bigquery', + version='0.19.0', + description='Python Client for Google BigQuery', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/bigtable/MANIFEST.in b/bigtable/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/bigtable/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/bigtable/README.rst b/bigtable/README.rst new file mode 100644 index 000000000000..619a0e15663d --- /dev/null +++ b/bigtable/README.rst @@ -0,0 +1,44 @@ +Python Client for Google Cloud Bigtable +======================================= + + Python idiomatic client for `Google Cloud Bigtable`_ + +.. _Google Cloud Bigtable: https://cloud.google.com/bigtable/docs/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-bigtable + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +Cloud `Bigtable`_ is Google's NoSQL Big Data database service. It's the same +database that powers many core Google services, including Search, +Analytics, Maps, and Gmail. + +.. _Bigtable: https://cloud.google.com/bigtable/docs/ + +See the ``google-cloud-python`` API `Bigtable documentation`_ to learn +how to manage your data in Bigtable tables. + +.. _Bigtable documentation: https://google-cloud-python.readthedocs.io/en/stable/bigtable-usage.html diff --git a/bigtable/google/__init__.py b/bigtable/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/bigtable/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/bigtable/google/cloud/__init__.py b/bigtable/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/bigtable/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/bigtable/__init__.py b/bigtable/google/cloud/bigtable/__init__.py similarity index 100% rename from google/cloud/bigtable/__init__.py rename to bigtable/google/cloud/bigtable/__init__.py diff --git a/google/cloud/bigtable/_generated/__init__.py b/bigtable/google/cloud/bigtable/_generated/__init__.py similarity index 100% rename from google/cloud/bigtable/_generated/__init__.py rename to bigtable/google/cloud/bigtable/_generated/__init__.py diff --git a/google/cloud/bigtable/_generated/_bigtable.proto b/bigtable/google/cloud/bigtable/_generated/_bigtable.proto similarity index 100% rename from google/cloud/bigtable/_generated/_bigtable.proto rename to bigtable/google/cloud/bigtable/_generated/_bigtable.proto diff --git a/google/cloud/bigtable/_generated/_bigtable_instance_admin.proto b/bigtable/google/cloud/bigtable/_generated/_bigtable_instance_admin.proto similarity index 100% rename from google/cloud/bigtable/_generated/_bigtable_instance_admin.proto rename to bigtable/google/cloud/bigtable/_generated/_bigtable_instance_admin.proto diff --git a/google/cloud/bigtable/_generated/_bigtable_table_admin.proto b/bigtable/google/cloud/bigtable/_generated/_bigtable_table_admin.proto similarity index 100% rename from google/cloud/bigtable/_generated/_bigtable_table_admin.proto rename to bigtable/google/cloud/bigtable/_generated/_bigtable_table_admin.proto diff --git a/google/cloud/bigtable/_generated/_common.proto b/bigtable/google/cloud/bigtable/_generated/_common.proto similarity index 100% rename from google/cloud/bigtable/_generated/_common.proto rename to bigtable/google/cloud/bigtable/_generated/_common.proto diff --git a/google/cloud/bigtable/_generated/_data.proto b/bigtable/google/cloud/bigtable/_generated/_data.proto similarity index 100% rename from google/cloud/bigtable/_generated/_data.proto rename to bigtable/google/cloud/bigtable/_generated/_data.proto diff --git a/google/cloud/bigtable/_generated/_instance.proto b/bigtable/google/cloud/bigtable/_generated/_instance.proto similarity index 100% rename from google/cloud/bigtable/_generated/_instance.proto rename to bigtable/google/cloud/bigtable/_generated/_instance.proto diff --git a/google/cloud/bigtable/_generated/_operations.proto b/bigtable/google/cloud/bigtable/_generated/_operations.proto similarity index 100% rename from google/cloud/bigtable/_generated/_operations.proto rename to bigtable/google/cloud/bigtable/_generated/_operations.proto diff --git a/google/cloud/bigtable/_generated/_table.proto b/bigtable/google/cloud/bigtable/_generated/_table.proto similarity index 100% rename from google/cloud/bigtable/_generated/_table.proto rename to bigtable/google/cloud/bigtable/_generated/_table.proto diff --git a/google/cloud/bigtable/_generated/bigtable_instance_admin_pb2.py b/bigtable/google/cloud/bigtable/_generated/bigtable_instance_admin_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/bigtable_instance_admin_pb2.py rename to bigtable/google/cloud/bigtable/_generated/bigtable_instance_admin_pb2.py diff --git a/google/cloud/bigtable/_generated/bigtable_pb2.py b/bigtable/google/cloud/bigtable/_generated/bigtable_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/bigtable_pb2.py rename to bigtable/google/cloud/bigtable/_generated/bigtable_pb2.py diff --git a/google/cloud/bigtable/_generated/bigtable_table_admin_pb2.py b/bigtable/google/cloud/bigtable/_generated/bigtable_table_admin_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/bigtable_table_admin_pb2.py rename to bigtable/google/cloud/bigtable/_generated/bigtable_table_admin_pb2.py diff --git a/google/cloud/bigtable/_generated/common_pb2.py b/bigtable/google/cloud/bigtable/_generated/common_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/common_pb2.py rename to bigtable/google/cloud/bigtable/_generated/common_pb2.py diff --git a/google/cloud/bigtable/_generated/data_pb2.py b/bigtable/google/cloud/bigtable/_generated/data_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/data_pb2.py rename to bigtable/google/cloud/bigtable/_generated/data_pb2.py diff --git a/google/cloud/bigtable/_generated/instance_pb2.py b/bigtable/google/cloud/bigtable/_generated/instance_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/instance_pb2.py rename to bigtable/google/cloud/bigtable/_generated/instance_pb2.py diff --git a/google/cloud/bigtable/_generated/operations_grpc_pb2.py b/bigtable/google/cloud/bigtable/_generated/operations_grpc_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/operations_grpc_pb2.py rename to bigtable/google/cloud/bigtable/_generated/operations_grpc_pb2.py diff --git a/google/cloud/bigtable/_generated/table_pb2.py b/bigtable/google/cloud/bigtable/_generated/table_pb2.py similarity index 100% rename from google/cloud/bigtable/_generated/table_pb2.py rename to bigtable/google/cloud/bigtable/_generated/table_pb2.py diff --git a/google/cloud/bigtable/client.py b/bigtable/google/cloud/bigtable/client.py similarity index 100% rename from google/cloud/bigtable/client.py rename to bigtable/google/cloud/bigtable/client.py diff --git a/google/cloud/bigtable/cluster.py b/bigtable/google/cloud/bigtable/cluster.py similarity index 100% rename from google/cloud/bigtable/cluster.py rename to bigtable/google/cloud/bigtable/cluster.py diff --git a/google/cloud/bigtable/column_family.py b/bigtable/google/cloud/bigtable/column_family.py similarity index 100% rename from google/cloud/bigtable/column_family.py rename to bigtable/google/cloud/bigtable/column_family.py diff --git a/google/cloud/bigtable/instance.py b/bigtable/google/cloud/bigtable/instance.py similarity index 100% rename from google/cloud/bigtable/instance.py rename to bigtable/google/cloud/bigtable/instance.py diff --git a/google/cloud/bigtable/row.py b/bigtable/google/cloud/bigtable/row.py similarity index 100% rename from google/cloud/bigtable/row.py rename to bigtable/google/cloud/bigtable/row.py diff --git a/google/cloud/bigtable/row_data.py b/bigtable/google/cloud/bigtable/row_data.py similarity index 100% rename from google/cloud/bigtable/row_data.py rename to bigtable/google/cloud/bigtable/row_data.py diff --git a/google/cloud/bigtable/row_filters.py b/bigtable/google/cloud/bigtable/row_filters.py similarity index 100% rename from google/cloud/bigtable/row_filters.py rename to bigtable/google/cloud/bigtable/row_filters.py diff --git a/google/cloud/bigtable/table.py b/bigtable/google/cloud/bigtable/table.py similarity index 100% rename from google/cloud/bigtable/table.py rename to bigtable/google/cloud/bigtable/table.py diff --git a/bigtable/setup.py b/bigtable/setup.py new file mode 100644 index 000000000000..01c0fb28994b --- /dev/null +++ b/bigtable/setup.py @@ -0,0 +1,55 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', + 'grpcio >= 1.0.0', +] + +setup( + name='google-cloud-bigtable', + version='0.19.0', + description='Python Client for Google Cloud Bigtable', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/core/MANIFEST.in b/core/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/core/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/core/README.rst b/core/README.rst new file mode 100644 index 000000000000..d8ec01b781be --- /dev/null +++ b/core/README.rst @@ -0,0 +1,20 @@ +Core Helpers for Google Cloud Python Client Library +=================================================== + +This library is not meant to stand-alone. Instead it defines +common helpers (e.g. base ``Client`` and ``Connection`` classes) +used by all of the ``google-cloud-*``. + + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-core diff --git a/core/google/__init__.py b/core/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/core/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/core/google/cloud/__init__.py b/core/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/core/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/_helpers.py b/core/google/cloud/_helpers.py similarity index 100% rename from google/cloud/_helpers.py rename to core/google/cloud/_helpers.py diff --git a/google/cloud/client.py b/core/google/cloud/client.py similarity index 100% rename from google/cloud/client.py rename to core/google/cloud/client.py diff --git a/google/cloud/connection.py b/core/google/cloud/connection.py similarity index 100% rename from google/cloud/connection.py rename to core/google/cloud/connection.py diff --git a/google/cloud/credentials.py b/core/google/cloud/credentials.py similarity index 100% rename from google/cloud/credentials.py rename to core/google/cloud/credentials.py diff --git a/google/cloud/environment_vars.py b/core/google/cloud/environment_vars.py similarity index 100% rename from google/cloud/environment_vars.py rename to core/google/cloud/environment_vars.py diff --git a/google/cloud/exceptions.py b/core/google/cloud/exceptions.py similarity index 100% rename from google/cloud/exceptions.py rename to core/google/cloud/exceptions.py diff --git a/google/cloud/iterator.py b/core/google/cloud/iterator.py similarity index 100% rename from google/cloud/iterator.py rename to core/google/cloud/iterator.py diff --git a/google/cloud/operation.py b/core/google/cloud/operation.py similarity index 100% rename from google/cloud/operation.py rename to core/google/cloud/operation.py diff --git a/google/cloud/streaming/__init__.py b/core/google/cloud/streaming/__init__.py similarity index 100% rename from google/cloud/streaming/__init__.py rename to core/google/cloud/streaming/__init__.py diff --git a/google/cloud/streaming/buffered_stream.py b/core/google/cloud/streaming/buffered_stream.py similarity index 100% rename from google/cloud/streaming/buffered_stream.py rename to core/google/cloud/streaming/buffered_stream.py diff --git a/google/cloud/streaming/exceptions.py b/core/google/cloud/streaming/exceptions.py similarity index 100% rename from google/cloud/streaming/exceptions.py rename to core/google/cloud/streaming/exceptions.py diff --git a/google/cloud/streaming/http_wrapper.py b/core/google/cloud/streaming/http_wrapper.py similarity index 100% rename from google/cloud/streaming/http_wrapper.py rename to core/google/cloud/streaming/http_wrapper.py diff --git a/google/cloud/streaming/stream_slice.py b/core/google/cloud/streaming/stream_slice.py similarity index 100% rename from google/cloud/streaming/stream_slice.py rename to core/google/cloud/streaming/stream_slice.py diff --git a/google/cloud/streaming/transfer.py b/core/google/cloud/streaming/transfer.py similarity index 100% rename from google/cloud/streaming/transfer.py rename to core/google/cloud/streaming/transfer.py diff --git a/google/cloud/streaming/util.py b/core/google/cloud/streaming/util.py similarity index 100% rename from google/cloud/streaming/util.py rename to core/google/cloud/streaming/util.py diff --git a/core/setup.py b/core/setup.py new file mode 100644 index 000000000000..d27f31b06cad --- /dev/null +++ b/core/setup.py @@ -0,0 +1,58 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'httplib2 >= 0.9.1', + 'googleapis-common-protos', + 'oauth2client >= 2.0.1', + 'protobuf >= 3.0.0', + 'six', +] + +setup( + name='google-cloud-core', + version='0.19.0', + description='API Client library for Google Cloud: Core Helpers', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/datastore/MANIFEST.in b/datastore/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/datastore/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/datastore/README.rst b/datastore/README.rst new file mode 100644 index 000000000000..b3145186ef59 --- /dev/null +++ b/datastore/README.rst @@ -0,0 +1,67 @@ +Python Client for Google Cloud Datastore +======================================== + + Python idiomatic client for `Google Cloud Datastore`_ + +.. _Google Cloud Datastore: https://cloud.google.com/datastore/docs + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-datastore + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +Google `Cloud Datastore`_ (`Datastore API docs`_) is a fully managed, +schemaless database for storing non-relational data. Cloud Datastore +automatically scales with your users and supports ACID transactions, high +availability of reads and writes, strong consistency for reads and ancestor +queries, and eventual consistency for all other queries. + +.. _Cloud Datastore: https://cloud.google.com/datastore/docs +.. _Datastore API docs: https://cloud.google.com/datastore/docs/ + +See the ``google-cloud-python`` API `datastore documentation`_ to learn how to +interact with the Cloud Datastore using this Client Library. + +.. _datastore documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/datastore-client.html + +See the `official Google Cloud Datastore documentation`_ for more details on +how to activate Cloud Datastore for your project. + +.. _official Google Cloud Datastore documentation: https://cloud.google.com/datastore/docs/activate + +.. code:: python + + from google.cloud import datastore + # Create, populate and persist an entity + entity = datastore.Entity(key=datastore.Key('EntityKind')) + entity.update({ + 'foo': u'bar', + 'baz': 1337, + 'qux': False, + }) + # Then query for entities + query = datastore.Query(kind='EntityKind') + for result in query.fetch(): + print(result) diff --git a/datastore/google/__init__.py b/datastore/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/datastore/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datastore/google/cloud/__init__.py b/datastore/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/datastore/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/datastore/__init__.py b/datastore/google/cloud/datastore/__init__.py similarity index 100% rename from google/cloud/datastore/__init__.py rename to datastore/google/cloud/datastore/__init__.py diff --git a/google/cloud/datastore/_generated/__init__.py b/datastore/google/cloud/datastore/_generated/__init__.py similarity index 100% rename from google/cloud/datastore/_generated/__init__.py rename to datastore/google/cloud/datastore/_generated/__init__.py diff --git a/google/cloud/datastore/_generated/_datastore.proto b/datastore/google/cloud/datastore/_generated/_datastore.proto similarity index 100% rename from google/cloud/datastore/_generated/_datastore.proto rename to datastore/google/cloud/datastore/_generated/_datastore.proto diff --git a/google/cloud/datastore/_generated/_entity.proto b/datastore/google/cloud/datastore/_generated/_entity.proto similarity index 100% rename from google/cloud/datastore/_generated/_entity.proto rename to datastore/google/cloud/datastore/_generated/_entity.proto diff --git a/google/cloud/datastore/_generated/_query.proto b/datastore/google/cloud/datastore/_generated/_query.proto similarity index 100% rename from google/cloud/datastore/_generated/_query.proto rename to datastore/google/cloud/datastore/_generated/_query.proto diff --git a/google/cloud/datastore/_generated/datastore_grpc_pb2.py b/datastore/google/cloud/datastore/_generated/datastore_grpc_pb2.py similarity index 100% rename from google/cloud/datastore/_generated/datastore_grpc_pb2.py rename to datastore/google/cloud/datastore/_generated/datastore_grpc_pb2.py diff --git a/google/cloud/datastore/_generated/datastore_pb2.py b/datastore/google/cloud/datastore/_generated/datastore_pb2.py similarity index 100% rename from google/cloud/datastore/_generated/datastore_pb2.py rename to datastore/google/cloud/datastore/_generated/datastore_pb2.py diff --git a/google/cloud/datastore/_generated/entity_pb2.py b/datastore/google/cloud/datastore/_generated/entity_pb2.py similarity index 100% rename from google/cloud/datastore/_generated/entity_pb2.py rename to datastore/google/cloud/datastore/_generated/entity_pb2.py diff --git a/google/cloud/datastore/_generated/query_pb2.py b/datastore/google/cloud/datastore/_generated/query_pb2.py similarity index 100% rename from google/cloud/datastore/_generated/query_pb2.py rename to datastore/google/cloud/datastore/_generated/query_pb2.py diff --git a/google/cloud/datastore/batch.py b/datastore/google/cloud/datastore/batch.py similarity index 100% rename from google/cloud/datastore/batch.py rename to datastore/google/cloud/datastore/batch.py diff --git a/google/cloud/datastore/client.py b/datastore/google/cloud/datastore/client.py similarity index 100% rename from google/cloud/datastore/client.py rename to datastore/google/cloud/datastore/client.py diff --git a/google/cloud/datastore/connection.py b/datastore/google/cloud/datastore/connection.py similarity index 100% rename from google/cloud/datastore/connection.py rename to datastore/google/cloud/datastore/connection.py diff --git a/google/cloud/datastore/entity.py b/datastore/google/cloud/datastore/entity.py similarity index 100% rename from google/cloud/datastore/entity.py rename to datastore/google/cloud/datastore/entity.py diff --git a/google/cloud/datastore/helpers.py b/datastore/google/cloud/datastore/helpers.py similarity index 100% rename from google/cloud/datastore/helpers.py rename to datastore/google/cloud/datastore/helpers.py diff --git a/google/cloud/datastore/key.py b/datastore/google/cloud/datastore/key.py similarity index 100% rename from google/cloud/datastore/key.py rename to datastore/google/cloud/datastore/key.py diff --git a/google/cloud/datastore/query.py b/datastore/google/cloud/datastore/query.py similarity index 100% rename from google/cloud/datastore/query.py rename to datastore/google/cloud/datastore/query.py diff --git a/google/cloud/datastore/transaction.py b/datastore/google/cloud/datastore/transaction.py similarity index 100% rename from google/cloud/datastore/transaction.py rename to datastore/google/cloud/datastore/transaction.py diff --git a/datastore/setup.py b/datastore/setup.py new file mode 100644 index 000000000000..3b2f460e768a --- /dev/null +++ b/datastore/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-datastore', + version='0.19.0', + description='Python Client for Google Cloud Datastore', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/dns/MANIFEST.in b/dns/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/dns/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/dns/README.rst b/dns/README.rst new file mode 100644 index 000000000000..1f76c88cf343 --- /dev/null +++ b/dns/README.rst @@ -0,0 +1,44 @@ +Python Client for Google Cloud DNS +================================== + + Python idiomatic client for `Google Cloud DNS`_ + +.. _Google Cloud DNS: https://cloud.google.com/dns/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-dns + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +The Cloud `DNS`_ API (`DNS API docs`_) provides methods that you can use to +manage DNS for your applications. + +.. _DNS: https://cloud.google.com/dns/ +.. _DNS API docs: https://cloud.google.com/dns/docs/apis + +See the ``google-cloud-python`` API `DNS documentation`_ to learn +how to manage DNS records using this Client Library. + +.. _DNS documentation: https://google-cloud-python.readthedocs.io/en/stable/dns-usage.html diff --git a/dns/google/__init__.py b/dns/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/dns/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/dns/google/cloud/__init__.py b/dns/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/dns/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/dns/__init__.py b/dns/google/cloud/dns/__init__.py similarity index 100% rename from google/cloud/dns/__init__.py rename to dns/google/cloud/dns/__init__.py diff --git a/google/cloud/dns/changes.py b/dns/google/cloud/dns/changes.py similarity index 100% rename from google/cloud/dns/changes.py rename to dns/google/cloud/dns/changes.py diff --git a/google/cloud/dns/client.py b/dns/google/cloud/dns/client.py similarity index 100% rename from google/cloud/dns/client.py rename to dns/google/cloud/dns/client.py diff --git a/google/cloud/dns/connection.py b/dns/google/cloud/dns/connection.py similarity index 100% rename from google/cloud/dns/connection.py rename to dns/google/cloud/dns/connection.py diff --git a/google/cloud/dns/resource_record_set.py b/dns/google/cloud/dns/resource_record_set.py similarity index 100% rename from google/cloud/dns/resource_record_set.py rename to dns/google/cloud/dns/resource_record_set.py diff --git a/google/cloud/dns/zone.py b/dns/google/cloud/dns/zone.py similarity index 100% rename from google/cloud/dns/zone.py rename to dns/google/cloud/dns/zone.py diff --git a/dns/setup.py b/dns/setup.py new file mode 100644 index 000000000000..7542d9585023 --- /dev/null +++ b/dns/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-dns', + version='0.19.0', + description='Python Client for Google Cloud DNS', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/docs/MANIFEST.in b/docs/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/docs/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/error_reporting/MANIFEST.in b/error_reporting/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/error_reporting/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/error_reporting/README.rst b/error_reporting/README.rst new file mode 100644 index 000000000000..81ca524c695e --- /dev/null +++ b/error_reporting/README.rst @@ -0,0 +1,49 @@ +Python Client for Stackdriver Error Reporting +============================================= + + Python idiomatic client for `Stackdriver Error Reporting`_ + +.. _Stackdriver Error Reporting: https://cloud.google.com/error-reporting/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-error-reporting + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +The Stackdriver `Error Reporting`_ API (`Error Reporting API docs`_) +counts, analyzes and aggregates the crashes in your running cloud services. +A centralized error management interface displays the results with sorting +and filtering capabilities. A dedicated view shows the error details: time +chart, occurrences, affected user count, first and last seen dates and a +cleaned exception stack trace. Opt-in to receive email and mobile alerts +on new errors. + +.. _Error Reporting: https://cloud.google.com/error-reporting/ +.. _Error Reporting API docs: https://cloud.google.com/error-reporting/reference/ + +See the ``google-cloud-python`` API `Error Reporting documentation`_ to learn +how to get started using this library. + +.. _Error Reporting documentation: https://google-cloud-python.readthedocs.io/en/stable/error-reporting-usage.html diff --git a/error_reporting/google/__init__.py b/error_reporting/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/error_reporting/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/error_reporting/google/cloud/__init__.py b/error_reporting/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/error_reporting/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/error_reporting/__init__.py b/error_reporting/google/cloud/error_reporting/__init__.py similarity index 100% rename from google/cloud/error_reporting/__init__.py rename to error_reporting/google/cloud/error_reporting/__init__.py diff --git a/google/cloud/error_reporting/client.py b/error_reporting/google/cloud/error_reporting/client.py similarity index 100% rename from google/cloud/error_reporting/client.py rename to error_reporting/google/cloud/error_reporting/client.py diff --git a/error_reporting/setup.py b/error_reporting/setup.py new file mode 100644 index 000000000000..b303d85ec20c --- /dev/null +++ b/error_reporting/setup.py @@ -0,0 +1,55 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', + 'google-cloud-logging >= 0.19.0', +] + +setup( + name='google-cloud-error-reporting', + version='0.19.0', + description='Python Client for Stackdriver Error Reporting', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/language/MANIFEST.in b/language/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/language/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/language/README.rst b/language/README.rst new file mode 100644 index 000000000000..5086be4e8a78 --- /dev/null +++ b/language/README.rst @@ -0,0 +1,48 @@ +Python Client for Google Cloud Natural Language +=============================================== + + Python idiomatic client for `Google Cloud Natural Language`_ + +.. _Google Cloud Natural Language: https://cloud.google.com/natural-language/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-language + $ # OR + $ pip install --upgrade google-cloud-natural-language + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +The Google Cloud `Natural Language`_ API (`Natural Language API docs`_) +provides natural language understanding technologies to developers, +including sentiment analysis, entity recognition, and syntax analysis. +This API is part of the larger Cloud Machine Learning API. + +.. _Natural Language: https://cloud.google.com/natural-language/ +.. _Natural Language API docs: https://cloud.google.com/natural-language/reference/rest/ + +See the ``google-cloud-python`` API `Natural Language documentation`_ to learn +how to analyze text with this API. + +.. _Natural Language documentation: https://google-cloud-python.readthedocs.io/en/stable/language-usage.html diff --git a/language/google/__init__.py b/language/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/language/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/language/google/cloud/__init__.py b/language/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/language/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/language/__init__.py b/language/google/cloud/language/__init__.py similarity index 100% rename from google/cloud/language/__init__.py rename to language/google/cloud/language/__init__.py diff --git a/google/cloud/language/client.py b/language/google/cloud/language/client.py similarity index 100% rename from google/cloud/language/client.py rename to language/google/cloud/language/client.py diff --git a/google/cloud/language/connection.py b/language/google/cloud/language/connection.py similarity index 100% rename from google/cloud/language/connection.py rename to language/google/cloud/language/connection.py diff --git a/google/cloud/language/document.py b/language/google/cloud/language/document.py similarity index 100% rename from google/cloud/language/document.py rename to language/google/cloud/language/document.py diff --git a/google/cloud/language/entity.py b/language/google/cloud/language/entity.py similarity index 100% rename from google/cloud/language/entity.py rename to language/google/cloud/language/entity.py diff --git a/google/cloud/language/sentiment.py b/language/google/cloud/language/sentiment.py similarity index 100% rename from google/cloud/language/sentiment.py rename to language/google/cloud/language/sentiment.py diff --git a/google/cloud/language/syntax.py b/language/google/cloud/language/syntax.py similarity index 100% rename from google/cloud/language/syntax.py rename to language/google/cloud/language/syntax.py diff --git a/language/setup.py b/language/setup.py new file mode 100644 index 000000000000..08f121afc43c --- /dev/null +++ b/language/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-language', + version='0.19.0', + description='Python Client for Google Cloud Natural Language', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/logging/MANIFEST.in b/logging/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/logging/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/logging/README.rst b/logging/README.rst new file mode 100644 index 000000000000..4eb89312e041 --- /dev/null +++ b/logging/README.rst @@ -0,0 +1,59 @@ +Python Client for Stackdriver Logging +===================================== + + Python idiomatic client for `Stackdriver Logging`_ + +.. _Stackdriver Logging: https://cloud.google.com/logging/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-logging + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +`Stackdriver Logging`_ API (`Logging API docs`_) allows you to store, search, +analyze, monitor, and alert on log data and events from Google Cloud Platform. + +.. _Stackdriver Logging: https://cloud.google.com/logging/ +.. _Logging API docs: https://cloud.google.com/logging/docs/ + +.. code:: python + + from google.cloud import logging + client = logging.Client() + logger = client.logger('log_name') + logger.log_text('A simple entry') # API call + +Example of fetching entries: + +.. code:: python + + entries, token = logger.list_entries() + for entry in entries: + print entry.payload + +See the ``google-cloud-python`` API `logging documentation`_ to learn how to +connect to Stackdriver Logging using this Client Library. + +.. _logging documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/logging-usage.html diff --git a/logging/google/__init__.py b/logging/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/logging/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/logging/google/cloud/__init__.py b/logging/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/logging/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/logging/__init__.py b/logging/google/cloud/logging/__init__.py similarity index 100% rename from google/cloud/logging/__init__.py rename to logging/google/cloud/logging/__init__.py diff --git a/google/cloud/logging/_gax.py b/logging/google/cloud/logging/_gax.py similarity index 100% rename from google/cloud/logging/_gax.py rename to logging/google/cloud/logging/_gax.py diff --git a/google/cloud/logging/client.py b/logging/google/cloud/logging/client.py similarity index 100% rename from google/cloud/logging/client.py rename to logging/google/cloud/logging/client.py diff --git a/google/cloud/logging/connection.py b/logging/google/cloud/logging/connection.py similarity index 100% rename from google/cloud/logging/connection.py rename to logging/google/cloud/logging/connection.py diff --git a/google/cloud/logging/entries.py b/logging/google/cloud/logging/entries.py similarity index 100% rename from google/cloud/logging/entries.py rename to logging/google/cloud/logging/entries.py diff --git a/google/cloud/logging/handlers/__init__.py b/logging/google/cloud/logging/handlers/__init__.py similarity index 100% rename from google/cloud/logging/handlers/__init__.py rename to logging/google/cloud/logging/handlers/__init__.py diff --git a/google/cloud/logging/handlers/handlers.py b/logging/google/cloud/logging/handlers/handlers.py similarity index 100% rename from google/cloud/logging/handlers/handlers.py rename to logging/google/cloud/logging/handlers/handlers.py diff --git a/google/cloud/logging/handlers/transports/__init__.py b/logging/google/cloud/logging/handlers/transports/__init__.py similarity index 100% rename from google/cloud/logging/handlers/transports/__init__.py rename to logging/google/cloud/logging/handlers/transports/__init__.py diff --git a/google/cloud/logging/handlers/transports/background_thread.py b/logging/google/cloud/logging/handlers/transports/background_thread.py similarity index 100% rename from google/cloud/logging/handlers/transports/background_thread.py rename to logging/google/cloud/logging/handlers/transports/background_thread.py diff --git a/google/cloud/logging/handlers/transports/base.py b/logging/google/cloud/logging/handlers/transports/base.py similarity index 100% rename from google/cloud/logging/handlers/transports/base.py rename to logging/google/cloud/logging/handlers/transports/base.py diff --git a/google/cloud/logging/handlers/transports/sync.py b/logging/google/cloud/logging/handlers/transports/sync.py similarity index 100% rename from google/cloud/logging/handlers/transports/sync.py rename to logging/google/cloud/logging/handlers/transports/sync.py diff --git a/google/cloud/logging/logger.py b/logging/google/cloud/logging/logger.py similarity index 100% rename from google/cloud/logging/logger.py rename to logging/google/cloud/logging/logger.py diff --git a/google/cloud/logging/metric.py b/logging/google/cloud/logging/metric.py similarity index 100% rename from google/cloud/logging/metric.py rename to logging/google/cloud/logging/metric.py diff --git a/google/cloud/logging/sink.py b/logging/google/cloud/logging/sink.py similarity index 100% rename from google/cloud/logging/sink.py rename to logging/google/cloud/logging/sink.py diff --git a/logging/setup.py b/logging/setup.py new file mode 100644 index 000000000000..a38d98fc2e3d --- /dev/null +++ b/logging/setup.py @@ -0,0 +1,57 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', + 'google-gax >= 0.13.0, < 0.14dev', + 'gapic-google-logging-v2 >= 0.9.0, < 0.10dev', + 'grpc-google-logging-v2 >= 0.9.0, < 0.10dev', +] + +setup( + name='google-cloud-logging', + version='0.19.0', + description='Python Client for Stackdriver Logging', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/monitoring/MANIFEST.in b/monitoring/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/monitoring/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/monitoring/README.rst b/monitoring/README.rst new file mode 100644 index 000000000000..f969e82fa1b3 --- /dev/null +++ b/monitoring/README.rst @@ -0,0 +1,68 @@ +Python Client for Stackdriver Monitoring +======================================== + + Python idiomatic client for `Stackdriver Monitoring`_ + +.. _Stackdriver Monitoring: https://cloud.google.com/monitoring/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-monitoring + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +`Stackdriver Monitoring`_ (`Monitoring API docs`_) collects metrics, +events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), +hosted uptime probes, application instrumentation, and a variety of common +application components including Cassandra, Nginx, Apache Web Server, +Elasticsearch and many others. Stackdriver ingests that data and generates +insights via dashboards, charts, and alerts. + +This package currently supports all Monitoring API operations other than +writing custom metrics. + +.. _Stackdriver Monitoring: https://cloud.google.com/monitoring/ +.. _Monitoring API docs: https://cloud.google.com/monitoring/api/ref_v3/rest/ + +List available metric types: + +.. code:: python + + from google.cloud import monitoring + client = monitoring.Client() + for descriptor in client.list_metric_descriptors(): + print(descriptor.type) + +Display CPU utilization across your GCE instances during the last five minutes: + +.. code:: python + + metric = 'compute.googleapis.com/instance/cpu/utilization' + query = client.query(metric, minutes=5) + print(query.as_dataframe()) + +See the ``google-cloud-python`` API `monitoring documentation`_ to learn how +to connect to Stackdriver Monitoring using this Client Library. + +.. _monitoring documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/monitoring-usage.html diff --git a/monitoring/google/__init__.py b/monitoring/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/monitoring/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/monitoring/google/cloud/__init__.py b/monitoring/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/monitoring/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/monitoring/__init__.py b/monitoring/google/cloud/monitoring/__init__.py similarity index 100% rename from google/cloud/monitoring/__init__.py rename to monitoring/google/cloud/monitoring/__init__.py diff --git a/google/cloud/monitoring/_dataframe.py b/monitoring/google/cloud/monitoring/_dataframe.py similarity index 100% rename from google/cloud/monitoring/_dataframe.py rename to monitoring/google/cloud/monitoring/_dataframe.py diff --git a/google/cloud/monitoring/client.py b/monitoring/google/cloud/monitoring/client.py similarity index 100% rename from google/cloud/monitoring/client.py rename to monitoring/google/cloud/monitoring/client.py diff --git a/google/cloud/monitoring/connection.py b/monitoring/google/cloud/monitoring/connection.py similarity index 100% rename from google/cloud/monitoring/connection.py rename to monitoring/google/cloud/monitoring/connection.py diff --git a/google/cloud/monitoring/group.py b/monitoring/google/cloud/monitoring/group.py similarity index 100% rename from google/cloud/monitoring/group.py rename to monitoring/google/cloud/monitoring/group.py diff --git a/google/cloud/monitoring/label.py b/monitoring/google/cloud/monitoring/label.py similarity index 100% rename from google/cloud/monitoring/label.py rename to monitoring/google/cloud/monitoring/label.py diff --git a/google/cloud/monitoring/metric.py b/monitoring/google/cloud/monitoring/metric.py similarity index 100% rename from google/cloud/monitoring/metric.py rename to monitoring/google/cloud/monitoring/metric.py diff --git a/google/cloud/monitoring/query.py b/monitoring/google/cloud/monitoring/query.py similarity index 100% rename from google/cloud/monitoring/query.py rename to monitoring/google/cloud/monitoring/query.py diff --git a/google/cloud/monitoring/resource.py b/monitoring/google/cloud/monitoring/resource.py similarity index 100% rename from google/cloud/monitoring/resource.py rename to monitoring/google/cloud/monitoring/resource.py diff --git a/google/cloud/monitoring/timeseries.py b/monitoring/google/cloud/monitoring/timeseries.py similarity index 100% rename from google/cloud/monitoring/timeseries.py rename to monitoring/google/cloud/monitoring/timeseries.py diff --git a/monitoring/setup.py b/monitoring/setup.py new file mode 100644 index 000000000000..5033789722a2 --- /dev/null +++ b/monitoring/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-monitoring', + version='0.19.0', + description='Python Client for Stackdriver Monitoring', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/pubsub/MANIFEST.in b/pubsub/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/pubsub/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/pubsub/README.rst b/pubsub/README.rst new file mode 100644 index 000000000000..201a61e3eaf2 --- /dev/null +++ b/pubsub/README.rst @@ -0,0 +1,61 @@ +Python Client for Google Cloud Pub / Sub +======================================== + + Python idiomatic client for `Google Cloud Pub / Sub`_ + +.. _Google Cloud Pub / Sub: https://cloud.google.com/pubsub/docs + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-pubsub + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +Google `Cloud Pub/Sub`_ (`Pub/Sub API docs`_) is designed to provide reliable, +many-to-many, asynchronous messaging between applications. Publisher +applications can send messages to a ``topic`` and other applications can +subscribe to that topic to receive the messages. By decoupling senders and +receivers, Google Cloud Pub/Sub allows developers to communicate between +independently written applications. + +.. _Cloud Pub/Sub: https://cloud.google.com/pubsub/docs +.. _Pub/Sub API docs: https://cloud.google.com/pubsub/reference/rest/ + +See the ``google-cloud-python`` API `Pub/Sub documentation`_ to learn how to connect +to Cloud Pub/Sub using this Client Library. + +.. _Pub/Sub documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/pubsub-usage.html + +To get started with this API, you'll need to create + +.. code:: python + + from google.cloud import pubsub + + client = pubsub.Client() + topic = client.topic('topic_name') + topic.create() + + topic.publish('this is the message_payload', + attr1='value1', attr2='value2') diff --git a/pubsub/google/__init__.py b/pubsub/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/pubsub/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/pubsub/google/cloud/__init__.py b/pubsub/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/pubsub/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/pubsub/__init__.py b/pubsub/google/cloud/pubsub/__init__.py similarity index 100% rename from google/cloud/pubsub/__init__.py rename to pubsub/google/cloud/pubsub/__init__.py diff --git a/google/cloud/pubsub/_gax.py b/pubsub/google/cloud/pubsub/_gax.py similarity index 100% rename from google/cloud/pubsub/_gax.py rename to pubsub/google/cloud/pubsub/_gax.py diff --git a/google/cloud/pubsub/_helpers.py b/pubsub/google/cloud/pubsub/_helpers.py similarity index 100% rename from google/cloud/pubsub/_helpers.py rename to pubsub/google/cloud/pubsub/_helpers.py diff --git a/google/cloud/pubsub/client.py b/pubsub/google/cloud/pubsub/client.py similarity index 100% rename from google/cloud/pubsub/client.py rename to pubsub/google/cloud/pubsub/client.py diff --git a/google/cloud/pubsub/connection.py b/pubsub/google/cloud/pubsub/connection.py similarity index 100% rename from google/cloud/pubsub/connection.py rename to pubsub/google/cloud/pubsub/connection.py diff --git a/google/cloud/pubsub/iam.py b/pubsub/google/cloud/pubsub/iam.py similarity index 100% rename from google/cloud/pubsub/iam.py rename to pubsub/google/cloud/pubsub/iam.py diff --git a/google/cloud/pubsub/message.py b/pubsub/google/cloud/pubsub/message.py similarity index 100% rename from google/cloud/pubsub/message.py rename to pubsub/google/cloud/pubsub/message.py diff --git a/google/cloud/pubsub/subscription.py b/pubsub/google/cloud/pubsub/subscription.py similarity index 100% rename from google/cloud/pubsub/subscription.py rename to pubsub/google/cloud/pubsub/subscription.py diff --git a/google/cloud/pubsub/topic.py b/pubsub/google/cloud/pubsub/topic.py similarity index 100% rename from google/cloud/pubsub/topic.py rename to pubsub/google/cloud/pubsub/topic.py diff --git a/pubsub/setup.py b/pubsub/setup.py new file mode 100644 index 000000000000..459b81b760ba --- /dev/null +++ b/pubsub/setup.py @@ -0,0 +1,57 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', + 'google-gax >= 0.13.0, < 0.14dev', + 'gapic-google-pubsub-v1 >= 0.9.0, < 0.10dev', + 'grpc-google-pubsub-v1 >= 0.9.0, < 0.10dev', +] + +setup( + name='google-cloud-pubsub', + version='0.19.0', + description='Python Client for Google Cloud Pub/Sub', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/resource_manager/MANIFEST.in b/resource_manager/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/resource_manager/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/resource_manager/README.rst b/resource_manager/README.rst new file mode 100644 index 000000000000..f70e3839322f --- /dev/null +++ b/resource_manager/README.rst @@ -0,0 +1,45 @@ +Python Client for Google Cloud Resource Manager +=============================================== + + Python idiomatic client for `Google Cloud Resource Manager`_ + +.. _Google Cloud Resource Manager: https://cloud.google.com/resource-manager/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-resource-manager + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +The Cloud `Resource Manager`_ API (`Resource Manager API docs`_) provides +methods that you can use to programmatically manage your projects in the +Google Cloud Platform. + +.. _Resource Manager: https://cloud.google.com/resource-manager/ +.. _Resource Manager API docs: https://cloud.google.com/resource-manager/reference/rest/ + +See the ``google-cloud-python`` API `Resource Manager documentation`_ to learn +how to manage projects using this Client Library. + +.. _Resource Manager documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/resource-manager-api.html diff --git a/resource_manager/google/__init__.py b/resource_manager/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/resource_manager/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/resource_manager/google/cloud/__init__.py b/resource_manager/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/resource_manager/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/resource_manager/__init__.py b/resource_manager/google/cloud/resource_manager/__init__.py similarity index 100% rename from google/cloud/resource_manager/__init__.py rename to resource_manager/google/cloud/resource_manager/__init__.py diff --git a/google/cloud/resource_manager/client.py b/resource_manager/google/cloud/resource_manager/client.py similarity index 100% rename from google/cloud/resource_manager/client.py rename to resource_manager/google/cloud/resource_manager/client.py diff --git a/google/cloud/resource_manager/connection.py b/resource_manager/google/cloud/resource_manager/connection.py similarity index 100% rename from google/cloud/resource_manager/connection.py rename to resource_manager/google/cloud/resource_manager/connection.py diff --git a/google/cloud/resource_manager/project.py b/resource_manager/google/cloud/resource_manager/project.py similarity index 100% rename from google/cloud/resource_manager/project.py rename to resource_manager/google/cloud/resource_manager/project.py diff --git a/resource_manager/setup.py b/resource_manager/setup.py new file mode 100644 index 000000000000..8fe97aed2783 --- /dev/null +++ b/resource_manager/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-resource-manager', + version='0.19.0', + description='Python Client for Google Cloud Resource Manager', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/scripts/run_pylint.py b/scripts/run_pylint.py index 8f875b7e2748..9e3a820d2d5e 100644 --- a/scripts/run_pylint.py +++ b/scripts/run_pylint.py @@ -31,14 +31,17 @@ IGNORED_DIRECTORIES = [ - os.path.join('google', 'cloud', 'bigtable', '_generated'), - os.path.join('google', 'cloud', 'datastore', '_generated'), - 'scripts/verify_included_modules.py', + os.path.join('bigtable', 'google', 'cloud', 'bigtable', '_generated'), + os.path.join('datastore', 'google', 'cloud', 'datastore', '_generated'), ] IGNORED_FILES = [ os.path.join('docs', 'conf.py'), + os.path.join('vision', 'google', 'cloud', 'vision', '_fixtures.py'), +] +IGNORED_POSTFIXES = [ + os.path.join('google', '__init__.py'), + os.path.join('google', 'cloud', '__init__.py'), 'setup.py', - os.path.join('google', 'cloud', 'vision', '_fixtures.py'), ] SCRIPTS_DIR = os.path.abspath(os.path.dirname(__file__)) PRODUCTION_RC = os.path.join(SCRIPTS_DIR, 'pylintrc_default') @@ -114,6 +117,9 @@ def make_test_rc(base_rc_filename, additions_dict, def valid_filename(filename): """Checks if a file is a Python file and is not ignored.""" + for postfix in IGNORED_POSTFIXES: + if filename.endswith(postfix): + return False for directory in IGNORED_DIRECTORIES: if filename.startswith(directory): return False diff --git a/scripts/verify_included_modules.py b/scripts/verify_included_modules.py index a45774239bc0..b4507ff73583 100644 --- a/scripts/verify_included_modules.py +++ b/scripts/verify_included_modules.py @@ -56,6 +56,22 @@ 'google.cloud.vision.__init__', 'google.cloud.vision.fixtures', ]) +PACKAGES = ( + 'bigquery', + 'bigtable', + 'core', + 'datastore', + 'dns', + 'error_reporting', + 'language', + 'logging', + 'monitoring', + 'pubsub', + 'resource_manager', + 'storage', + 'translate', + 'vision', +) class SphinxApp(object): @@ -126,6 +142,11 @@ def main(build_root='_build'): :param build_root: The root of the directory where docs are built into. Defaults to ``_build``. """ + if build_root is None: + parser = get_parser() + args = parser.parse_args() + build_root = args.build_root + object_inventory_relpath = os.path.join(build_root, 'html', 'objects.inv') mock_uri = '' @@ -133,10 +154,12 @@ def main(build_root='_build'): object_inventory_relpath) sphinx_mods = set(inventory['py:module'].keys()) - library_dir = os.path.join(BASE_DIR, 'google', 'cloud') - public_mods = get_public_modules(library_dir, - base_package='google.cloud') - public_mods = set(public_mods) + public_mods = set() + for package in PACKAGES: + library_dir = os.path.join(BASE_DIR, package, 'google', 'cloud') + package_mods = get_public_modules(library_dir, + base_package='google.cloud') + public_mods.update(package_mods) if not sphinx_mods <= public_mods: unexpected_mods = sphinx_mods - public_mods @@ -172,6 +195,4 @@ def get_parser(): if __name__ == '__main__': - parser = get_parser() - args = parser.parse_args() - main(build_root=args.build_root) + main(build_root=None) diff --git a/setup.py b/setup.py index f1e9a2eac826..3c0270f6cc2d 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,7 @@ import os -import sys +import json from setuptools import setup -from setuptools import find_packages PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) @@ -10,48 +9,18 @@ with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_obj: README = file_obj.read() - -REQUIREMENTS = [ - 'httplib2 >= 0.9.1', - 'googleapis-common-protos', - 'oauth2client >= 2.0.1', - 'protobuf >= 3.0.0', - 'six', -] - -GRPC_PACKAGES = [ - 'grpcio >= 1.0.0', - 'google-gax >= 0.13.0, < 0.14dev', - 'gapic-google-pubsub-v1 >= 0.9.0, < 0.10dev', - 'grpc-google-pubsub-v1 >= 0.9.0, < 0.10dev', - 'gapic-google-logging-v2 >= 0.9.0, < 0.10dev', - 'grpc-google-logging-v2 >= 0.9.0, < 0.10dev', -] - -RTD_ENV_VAR = 'READTHEDOCS' -if RTD_ENV_VAR not in os.environ: - REQUIREMENTS.extend(GRPC_PACKAGES) - -setup( - name='google-cloud', - version='0.19.0', - description='API Client library for Google Cloud', - author='Google Cloud Platform', - author_email='jjg+google-cloud-python@google.com', - long_description=README, - scripts=[], - url='https://github.com/GoogleCloudPlatform/google-cloud-python', - namespace_packages=[ - 'google', - 'google.cloud', - ], - packages=find_packages(), - license='Apache 2.0', - platforms='Posix; MacOS X; Windows', - include_package_data=True, - zip_safe=False, - install_requires=REQUIREMENTS, - classifiers=[ +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', @@ -62,5 +31,37 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Internet', - ] + ], +} + + +MISSING_REQUIREMENTS = [ + 'google-cloud-bigquery', + 'google-cloud-bigtable', + 'google-cloud-datastore', + 'google-cloud-dns', + 'google-cloud-error-reporting', + 'google-cloud-happybase', + 'google-cloud-language', + 'google-cloud-logging', + 'google-cloud-monitoring', + # 'google-cloud-natural-language', # Synonym for -language + 'google-cloud-pubsub', + 'google-cloud-resource-manager', + 'google-cloud-speech', + 'google-cloud-storage', + 'google-cloud-translate', + 'google-cloud-vision', +] +REQUIREMENTS = [ + 'google-cloud-core', # Redunant +] + +setup( + name='google-cloud', + version='0.19.0', + description='API Client library for Google Cloud', + long_description=README, + install_requires=REQUIREMENTS, + **SETUP_BASE ) diff --git a/storage/MANIFEST.in b/storage/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/storage/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/storage/README.rst b/storage/README.rst new file mode 100644 index 000000000000..27b780676f2a --- /dev/null +++ b/storage/README.rst @@ -0,0 +1,64 @@ +Python Client for Google Cloud Storage +====================================== + + Python idiomatic client for `Google Cloud Storage`_ + +.. _Google Cloud Storage: https://cloud.google.com/storage/docs + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-storage + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +Google `Cloud Storage`_ (`Storage API docs`_) allows you to store data on +Google infrastructure with very high reliability, performance and +availability, and can be used to distribute large data objects to users +via direct download. + +.. _Cloud Storage: https://cloud.google.com/storage/docs +.. _Storage API docs: https://cloud.google.com/storage/docs/json_api/v1 + +See the ``google-cloud-python`` API `storage documentation`_ to learn how to +connect to Cloud Storage using this Client Library. + +.. _storage documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/storage-client.html + +You need to create a Google Cloud Storage bucket to use this client library. +Follow along with the `official Google Cloud Storage documentation`_ to learn +how to create a bucket. + +.. _official Google Cloud Storage documentation: https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets + +.. code:: python + + from google.cloud import storage + client = storage.Client() + bucket = client.get_bucket('bucket-id-here') + # Then do other things... + blob = bucket.get_blob('remote/path/to/file.txt') + print blob.download_as_string() + blob.upload_from_string('New contents!') + blob2 = bucket.blob('remote/path/storage.txt') + blob2.upload_from_filename(filename='/local/path.txt') diff --git a/storage/google/__init__.py b/storage/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/storage/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/storage/google/cloud/__init__.py b/storage/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/storage/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/storage/__init__.py b/storage/google/cloud/storage/__init__.py similarity index 100% rename from google/cloud/storage/__init__.py rename to storage/google/cloud/storage/__init__.py diff --git a/google/cloud/storage/_helpers.py b/storage/google/cloud/storage/_helpers.py similarity index 100% rename from google/cloud/storage/_helpers.py rename to storage/google/cloud/storage/_helpers.py diff --git a/google/cloud/storage/acl.py b/storage/google/cloud/storage/acl.py similarity index 100% rename from google/cloud/storage/acl.py rename to storage/google/cloud/storage/acl.py diff --git a/google/cloud/storage/batch.py b/storage/google/cloud/storage/batch.py similarity index 100% rename from google/cloud/storage/batch.py rename to storage/google/cloud/storage/batch.py diff --git a/google/cloud/storage/blob.py b/storage/google/cloud/storage/blob.py similarity index 100% rename from google/cloud/storage/blob.py rename to storage/google/cloud/storage/blob.py diff --git a/google/cloud/storage/bucket.py b/storage/google/cloud/storage/bucket.py similarity index 100% rename from google/cloud/storage/bucket.py rename to storage/google/cloud/storage/bucket.py diff --git a/google/cloud/storage/client.py b/storage/google/cloud/storage/client.py similarity index 100% rename from google/cloud/storage/client.py rename to storage/google/cloud/storage/client.py diff --git a/google/cloud/storage/connection.py b/storage/google/cloud/storage/connection.py similarity index 100% rename from google/cloud/storage/connection.py rename to storage/google/cloud/storage/connection.py diff --git a/storage/setup.py b/storage/setup.py new file mode 100644 index 000000000000..50e1d73a65d1 --- /dev/null +++ b/storage/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-storage', + version='0.19.0', + description='Python Client for Google Cloud Storage', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/tox.ini b/tox.ini index 8c9dc47f3b9b..f6e6541a21d6 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,20 @@ envlist = [testing] deps = + {toxinidir}/core + {toxinidir}/bigquery + {toxinidir}/bigtable + {toxinidir}/datastore + {toxinidir}/dns + {toxinidir}/language + {toxinidir}/logging + {toxinidir}/error_reporting + {toxinidir}/monitoring + {toxinidir}/pubsub + {toxinidir}/resource_manager + {toxinidir}/storage + {toxinidir}/translate + {toxinidir}/vision pytest covercmd = py.test \ @@ -82,8 +96,7 @@ passenv = {[testenv:system-tests]passenv} SPHINX_RELEASE READTHEDOCS [pep8] exclude = docs/conf.py, - google/cloud/bigtable/_generated*/*, - google/cloud/datastore/_generated/* + */_generated/*, verbose = 1 [testenv:lint] diff --git a/translate/MANIFEST.in b/translate/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/translate/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/translate/README.rst b/translate/README.rst new file mode 100644 index 000000000000..ece6f4469156 --- /dev/null +++ b/translate/README.rst @@ -0,0 +1,44 @@ +Python Client for Google Translate +================================== + + Python idiomatic client for `Google Translate`_ + +.. _Google Translate: https://cloud.google.com/translate/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-translate + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +With the Google `Translate`_ API (`Translate API docs`_), you can +dynamically translate text between thousands of language pairs. + +.. _Translate: https://cloud.google.com/translate/ +.. _Translate API docs: https://cloud.google.com/translate/docs/apis + +See the ``google-cloud-python`` API `Translate documentation`_ to learn +how to translate text using this library. + +.. _Translate documentation: https://google-cloud-python.readthedocs.io/en/stable/translate-usage.html diff --git a/translate/google/__init__.py b/translate/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/translate/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/translate/google/cloud/__init__.py b/translate/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/translate/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/translate/__init__.py b/translate/google/cloud/translate/__init__.py similarity index 100% rename from google/cloud/translate/__init__.py rename to translate/google/cloud/translate/__init__.py diff --git a/google/cloud/translate/client.py b/translate/google/cloud/translate/client.py similarity index 100% rename from google/cloud/translate/client.py rename to translate/google/cloud/translate/client.py diff --git a/google/cloud/translate/connection.py b/translate/google/cloud/translate/connection.py similarity index 100% rename from google/cloud/translate/connection.py rename to translate/google/cloud/translate/connection.py diff --git a/translate/setup.py b/translate/setup.py new file mode 100644 index 000000000000..a27a77a0e614 --- /dev/null +++ b/translate/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-translate', + version='0.19.0', + description='Python Client for Google Translate', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/vision/MANIFEST.in b/vision/MANIFEST.in new file mode 100644 index 000000000000..ae20b86a84fd --- /dev/null +++ b/vision/MANIFEST.in @@ -0,0 +1,3 @@ +include README.rst +graft google +global-exclude *.pyc diff --git a/vision/README.rst b/vision/README.rst new file mode 100644 index 000000000000..35902b4cf303 --- /dev/null +++ b/vision/README.rst @@ -0,0 +1,52 @@ +Python Client for Google Cloud Vision +===================================== + + Python idiomatic client for `Google Cloud Vision`_ + +.. _Google Cloud Vision: https://cloud.google.com/vision/ + +- `Homepage`_ +- `API Documentation`_ + +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/ + +Quick Start +----------- + +:: + + $ pip install --upgrade google-cloud-vision + +Authentication +-------------- + +With ``google-cloud-python`` we try to make authentication as painless as +possible. Check out the `Authentication section`_ in our documentation to +learn more. You may also find the `authentication document`_ shared by all +the ``google-cloud-*`` libraries to be helpful. + +.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html +.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication + +Using the API +------------- + +The Google Cloud `Vision`_ (`Vision API docs`_) API enables developers to +understand the content of an image by encapsulating powerful machine +learning models in an easy to use REST API. It quickly classifies images +into thousands of categories (e.g., "sailboat", "lion", "Eiffel Tower"), +detects individual objects and faces within images, and finds and reads +printed words contained within images. You can build metadata on your +image catalog, moderate offensive content, or enable new marketing +scenarios through image sentiment analysis. Analyze images uploaded +in the request or integrate with your image storage on Google Cloud +Storage. + +.. _Vision: https://cloud.google.com/vision/ +.. _Vision API docs: https://cloud.google.com/vision/reference/rest/ + +See the ``google-cloud-python`` API `Vision documentation`_ to learn +how to analyze images using this library. + +.. _Vision documentation: https://google-cloud-python.readthedocs.io/en/stable/vision-usage.html diff --git a/vision/google/__init__.py b/vision/google/__init__.py new file mode 100644 index 000000000000..23249e594bab --- /dev/null +++ b/vision/google/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/vision/google/cloud/__init__.py b/vision/google/cloud/__init__.py new file mode 100644 index 000000000000..ba4ea9e9702a --- /dev/null +++ b/vision/google/cloud/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/google/cloud/vision/__init__.py b/vision/google/cloud/vision/__init__.py similarity index 100% rename from google/cloud/vision/__init__.py rename to vision/google/cloud/vision/__init__.py diff --git a/google/cloud/vision/_fixtures.py b/vision/google/cloud/vision/_fixtures.py similarity index 100% rename from google/cloud/vision/_fixtures.py rename to vision/google/cloud/vision/_fixtures.py diff --git a/google/cloud/vision/client.py b/vision/google/cloud/vision/client.py similarity index 100% rename from google/cloud/vision/client.py rename to vision/google/cloud/vision/client.py diff --git a/google/cloud/vision/color.py b/vision/google/cloud/vision/color.py similarity index 100% rename from google/cloud/vision/color.py rename to vision/google/cloud/vision/color.py diff --git a/google/cloud/vision/connection.py b/vision/google/cloud/vision/connection.py similarity index 100% rename from google/cloud/vision/connection.py rename to vision/google/cloud/vision/connection.py diff --git a/google/cloud/vision/entity.py b/vision/google/cloud/vision/entity.py similarity index 100% rename from google/cloud/vision/entity.py rename to vision/google/cloud/vision/entity.py diff --git a/google/cloud/vision/face.py b/vision/google/cloud/vision/face.py similarity index 100% rename from google/cloud/vision/face.py rename to vision/google/cloud/vision/face.py diff --git a/google/cloud/vision/feature.py b/vision/google/cloud/vision/feature.py similarity index 100% rename from google/cloud/vision/feature.py rename to vision/google/cloud/vision/feature.py diff --git a/google/cloud/vision/geometry.py b/vision/google/cloud/vision/geometry.py similarity index 100% rename from google/cloud/vision/geometry.py rename to vision/google/cloud/vision/geometry.py diff --git a/google/cloud/vision/image.py b/vision/google/cloud/vision/image.py similarity index 100% rename from google/cloud/vision/image.py rename to vision/google/cloud/vision/image.py diff --git a/google/cloud/vision/likelihood.py b/vision/google/cloud/vision/likelihood.py similarity index 100% rename from google/cloud/vision/likelihood.py rename to vision/google/cloud/vision/likelihood.py diff --git a/google/cloud/vision/safe.py b/vision/google/cloud/vision/safe.py similarity index 100% rename from google/cloud/vision/safe.py rename to vision/google/cloud/vision/safe.py diff --git a/vision/setup.py b/vision/setup.py new file mode 100644 index 000000000000..27cba583ded9 --- /dev/null +++ b/vision/setup.py @@ -0,0 +1,54 @@ +import os + +from setuptools import setup +from setuptools import find_packages + + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: + README = file_obj.read() + +# NOTE: This is duplicated throughout and we should try to +# consolidate. +SETUP_BASE = { + 'author': 'Google Cloud Platform', + 'author_email': 'jjg+google-cloud-python@google.com', + 'scripts': [], + 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', + 'license': 'Apache 2.0', + 'platforms': 'Posix; MacOS X; Windows', + 'include_package_data': True, + 'zip_safe': False, + 'classifiers': [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Topic :: Internet', + ], +} + + +REQUIREMENTS = [ + 'google-cloud-core >= 0.19.0', +] + +setup( + name='google-cloud-vision', + version='0.19.0', + description='Python Client for Google Cloud Vision', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +)