diff --git a/.coveragerc b/.coveragerc index 78c1c89b1406..197d0c6039f7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,13 +1,13 @@ [run] branch = True -[report] -fail_under = 100 -show_missing = True - [report] omit = */_generated/*.py + # Packages in the "google.cloud" package that we don't own. + */google/cloud/logging/v2/* + */google/cloud/pubsub/v1/* +fail_under = 100 show_missing = True exclude_lines = # Re-enable the standard pragma diff --git a/.travis.yml b/.travis.yml index f5ad2f3126f5..8add43491b7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ script: - tox -e system-tests - tox -e system-tests3 - tox -e docs - - tox -e json-docs after_success: - tox -e coveralls @@ -25,7 +24,7 @@ deploy: secure: keSFPLzVj/yAAJ8kw4m+U5kpIiGqubpDqhcHPlGAvMohFMIO4D8ffgCqJdbhQshTtb/wiS5ajK1KNpEzq4BKD/5oRXuj/sIRTMENzX/azUXkT/bADLEGocyfE4/NAGQ9mcDOmHntjt7UUhYN6H87rgex22er4V1vD5tGf5Kc1HU= on: tags: true - repo: GoogleCloudPlatform/gcloud-python + repo: GoogleCloudPlatform/google-cloud-python # until this is fixed: https://github.com/travis-ci/travis-ci/issues/1675 all_branches: true # 'bdist_wheel' builds disabled until #1879 et al. are resolved. diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 153301006bdc..37686c3ad620 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -6,32 +6,32 @@ Contributing #. Make sure that your commit messages clearly describe the changes. #. Send a pull request. -Here are some guidelines for hacking on ``gcloud-python``. +Here are some guidelines for hacking on ``google-cloud-python``. Using a Development Checkout ---------------------------- -You'll have to create a development environment to hack on ``gcloud-python``, +You'll have to create a development environment to hack on ``google-cloud-python``, using a Git checkout: -- While logged into your GitHub account, navigate to the ``gcloud-python`` repo +- While logged into your GitHub account, navigate to the ``google-cloud-python`` repo on GitHub. - https://github.com/GoogleCloudPlatform/gcloud-python + https://github.com/GoogleCloudPlatform/google-cloud-python -- Fork and clone the ``gcloud-python`` repository to your GitHub account by +- Fork and clone the ``google-cloud-python`` repository to your GitHub account by clicking the "Fork" button. -- Clone your fork of ``gcloud-python`` from your GitHub account to your local +- Clone your fork of ``google-cloud-python`` from your GitHub account to your local computer, substituting your account username and specifying the destination - as "hack-on-gcloud". E.g.:: + as "hack-on-google-cloud-python". E.g.:: $ cd ~ - $ git clone git@github.com:USERNAME/gcloud-python.git hack-on-gcloud - $ cd hack-on-gcloud - # Configure remotes such that you can pull changes from the gcloud-python + $ git clone git@github.com:USERNAME/google-cloud-python.git hack-on-google-cloud-python + $ cd hack-on-google-cloud-python + # Configure remotes such that you can pull changes from the google-cloud-python # repository into your local repository. - $ git remote add upstream https://github.com:GoogleCloudPlatform/gcloud-python + $ git remote add upstream https://github.com:GoogleCloudPlatform/google-cloud-python # fetch and merge changes from upstream into master $ git fetch upstream $ git merge upstream/master @@ -39,9 +39,9 @@ using a Git checkout: Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. -- Create a virtualenv in which to install ``gcloud-python``:: +- Create a virtualenv in which to install ``google-cloud-python``:: - $ cd ~/hack-on-gcloud + $ cd ~/hack-on-google-cloud-python $ virtualenv --python python2.7 env Note that very old versions of virtualenv (virtualenv versions below, say, @@ -52,16 +52,16 @@ repo, from which you can submit a pull request. flag to ``virtualenv``. For example, ``virtualenv --python python2.7`` chooses the Python 2.7 interpreter to be installed. - From here on in within these instructions, the ``~/hack-on-gcloud/env`` + From here on in within these instructions, the ``~/hack-on-google-cloud-python/env`` virtual environment you created above will be referred to as ``$VENV``. To use the instructions in the steps that follow literally, use the - ``export VENV=~/hack-on-gcloud/env`` command. + ``export VENV=~/hack-on-google-cloud-python/env`` command. -- Install ``gcloud-python`` from the checkout into the virtualenv using +- Install ``google-cloud-python`` from the checkout into the virtualenv using ``setup.py develop``. Running ``setup.py develop`` *must* be done while - the current working directory is the ``gcloud-python`` checkout directory:: + the current working directory is the ``google-cloud-python`` checkout directory:: - $ cd ~/hack-on-gcloud + $ cd ~/hack-on-google-cloud-python $ $VENV/bin/python setup.py develop I'm getting weird errors... Can you help? @@ -76,7 +76,7 @@ On Debian/Ubuntu:: Adding Features --------------- -In order to add a feature to ``gcloud-python``: +In order to add a feature to ``google-cloud-python``: - The feature must be documented in both the API and narrative documentation (in ``docs/``). @@ -100,11 +100,11 @@ Coding Style - In order to make ``tox -e lint`` run faster, you can set some environment variables:: - export GCLOUD_REMOTE_FOR_LINT="upstream" - export GCLOUD_BRANCH_FOR_LINT="master" + export GOOGLE_CLOUD_REMOTE_FOR_LINT="upstream" + export GOOGLE_CLOUD_BRANCH_FOR_LINT="master" By doing this, you are specifying the location of the most up-to-date - version of ``gcloud-python``. The the suggested remote name ``upstream`` + version of ``google-cloud-python``. The the suggested remote name ``upstream`` should point to the official ``GoogleCloudPlatform`` checkout and the the branch should be the main branch on that remote (``master``). @@ -117,21 +117,21 @@ Exceptions to PEP8: Running Tests -------------- -- To run all tests for ``gcloud-python`` on a single Python version, run +- To run all tests for ``google-cloud-python`` on a single Python version, run ``py.test`` from your development virtualenv (See *Using a Development Checkout* above). -- To run the full set of ``gcloud-python`` tests on all platforms, install +- To run the full set of ``google-cloud-python`` tests on all platforms, install ``tox`` (https://testrun.org/tox/) into a system Python. The ``tox`` console script will be installed into the scripts location for that Python. While - ``cd``'ed to the ``gcloud-python`` checkout root directory (it contains + ``cd``'ed to the ``google-cloud-python`` checkout root directory (it contains ``tox.ini``), invoke the ``tox`` console script. This will read the ``tox.ini`` file and execute the tests on multiple Python versions and platforms; while it runs, it creates a virtualenv for each version/platform combination. For example:: $ sudo /usr/bin/pip install tox - $ cd ~/hack-on-gcloud/ + $ cd ~/hack-on-google-cloud-python/ $ /usr/bin/tox Running System Tests @@ -153,7 +153,7 @@ Running System Tests so you'll need to provide some environment variables to facilitate authentication to your project: - - ``GCLOUD_TESTS_PROJECT_ID``: Developers Console project ID (e.g. + - ``GOOGLE_CLOUD_TESTS_PROJECT_ID``: Developers Console project ID (e.g. bamboo-shift-455). - ``GOOGLE_APPLICATION_CREDENTIALS``: The path to a JSON key file; see ``system_tests/app_credentials.json.sample`` as an example. Such a file @@ -187,7 +187,7 @@ Running System Tests # Create the indexes $ gcloud preview datastore create-indexes system_tests/data/index.yaml \ - > --project=$GCLOUD_TESTS_PROJECT_ID + > --project=$GOOGLE_CLOUD_TESTS_PROJECT_ID # Restore your environment to its previous state. $ unset CLOUDSDK_PYTHON_SITEPACKAGES @@ -223,14 +223,14 @@ Running System Tests $ gcloud beta emulators datastore env-init export DATASTORE_LOCAL_HOST=localhost:8417 export DATASTORE_HOST=http://localhost:8417 - export DATASTORE_DATASET=gcloud-settings-app-id - export DATASTORE_PROJECT_ID=gcloud-settings-app-id + export DATASTORE_DATASET=google-cloud-settings-app-id + export DATASTORE_PROJECT_ID=google-cloud-settings-app-id using these environment variables run the emulator:: $ DATASTORE_HOST=http://localhost:8471 \ - > DATASTORE_DATASET=gcloud-settings-app-id \ - > GCLOUD_NO_PRINT=true \ + > DATASTORE_DATASET=google-cloud-settings-app-id \ + > GOOGLE_CLOUD_NO_PRINT=true \ > python system_tests/run_system_test.py \ > --package=datastore --ignore-requirements @@ -283,22 +283,22 @@ changed to reflect the bug fix, ideally in the same commit that fixes the bug or adds the feature. To build and review docs (where ``$VENV`` refers to the virtualenv you're -using to develop ``gcloud-python``): +using to develop ``google-cloud-python``): 1. After following the steps above in "Using a Development Checkout", install Sphinx and all development requirements in your virtualenv:: - $ cd ~/hack-on-gcloud + $ cd ~/hack-on-google-cloud-python $ $VENV/bin/pip install Sphinx -2. Change into the ``docs`` directory within your ``gcloud-python`` checkout and +2. Change into the ``docs`` directory within your ``google-cloud-python`` checkout and execute the ``make`` command with some flags:: - $ cd ~/hack-on-gcloud/gcloud-python/docs + $ cd ~/hack-on-google-cloud-python/google-cloud-python/docs $ make clean html SPHINXBUILD=$VENV/bin/sphinx-build The ``SPHINXBUILD=...`` argument tells Sphinx to use the virtualenv Python, - which will have both Sphinx and ``gcloud-python`` (for API documentation + which will have both Sphinx and ``google-cloud-python`` (for API documentation generation) installed. 3. Open the ``docs/_build/html/index.html`` file to see the resulting HTML @@ -314,7 +314,7 @@ build via:: $ tox -e docs-rtd -.. _readthedocs: http://gcloud-python.readthedocs.org/ +.. _readthedocs: http://google-cloud-python.readthedocs.org/ Note About ``README`` as it pertains to PyPI -------------------------------------------- @@ -323,10 +323,10 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/CONTRIBUTING.rst``) +``https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. -.. _description on PyPI: https://pypi.python.org/pypi/gcloud +.. _description on PyPI: https://pypi.python.org/pypi/google-cloud Travis Configuration and Build Optimizations -------------------------------------------- @@ -364,7 +364,7 @@ We support: Supported versions can be found in our ``tox.ini`` `config`_. -.. _config: https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/tox.ini +.. _config: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/tox.ini We explicitly decided not to support `Python 2.5`_ due to `decreased usage`_ and lack of continuous integration `support`_. @@ -387,7 +387,7 @@ We also explicitly decided to support Python 3 beginning with version .. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django .. _projects: http://flask.pocoo.org/docs/0.10/python3/ .. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/ -.. _dropped 2.6: https://github.com/GoogleCloudPlatform/gcloud-python/issues/995 +.. _dropped 2.6: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/995 Versioning ---------- diff --git a/MANIFEST.in b/MANIFEST.in index 5d1af3e9f0b0..ae20b86a84fd 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include README.rst -graft gcloud +graft google global-exclude *.pyc diff --git a/Makefile.bigtable_v2 b/Makefile.bigtable_v2 index fa921203fb2d..46a958cf4234 100644 --- a/Makefile.bigtable_v2 +++ b/Makefile.bigtable_v2 @@ -1,12 +1,12 @@ GRPCIO_VIRTUALENV=$(shell pwd)/grpc_python_venv GENERATED_DIR=$(shell pwd)/generated_python GENERATED_SUBDIR=_generated -BIGTABLE_DIR=$(shell pwd)/gcloud/bigtable/$(GENERATED_SUBDIR) +BIGTABLE_DIR=$(shell pwd)/google/cloud/bigtable/$(GENERATED_SUBDIR) PROTOC_CMD=$(GRPCIO_VIRTUALENV)/bin/python -m grpc.tools.protoc GOOGLEAPIS_PROTOS_DIR=$(shell pwd)/googleapis-pb help: - @echo 'Makefile for gcloud-python Bigtable protos ' + @echo 'Makefile for google-cloud-python Bigtable protos ' @echo ' ' @echo ' make generate Generates the protobuf modules ' @echo ' make clean Clean generated files ' diff --git a/Makefile.datastore b/Makefile.datastore index d9af38948ccf..837f5ba26390 100644 --- a/Makefile.datastore +++ b/Makefile.datastore @@ -1,11 +1,11 @@ GRPCIO_VIRTUALENV=$(shell pwd)/grpc_python_venv GENERATED_DIR=$(shell pwd)/generated_python -DATASTORE_DIR=$(shell pwd)/gcloud/datastore/_generated +DATASTORE_DIR=$(shell pwd)/google/cloud/datastore/_generated PROTOC_CMD=$(GRPCIO_VIRTUALENV)/bin/python -m grpc.tools.protoc GOOGLEAPIS_PROTOS_DIR=$(shell pwd)/googleapis-pb help: - @echo 'Makefile for gcloud-python Bigtable protos ' + @echo 'Makefile for google-cloud-python Bigtable protos ' @echo ' ' @echo ' make generate Generates the protobuf modules ' @echo ' make clean Clean generated files ' diff --git a/README.rst b/README.rst index 68bad65d7ea4..cf8c4941c561 100644 --- a/README.rst +++ b/README.rst @@ -10,8 +10,8 @@ Google Cloud Python Client - `Homepage`_ - `API Documentation`_ -.. _Homepage: https://googlecloudplatform.github.io/gcloud-python/ -.. _API Documentation: http://googlecloudplatform.github.io/gcloud-python/#/docs/master/gcloud +.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/ +.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/#/docs/master/google-cloud This client supports the following Google Cloud Platform services: @@ -23,13 +23,13 @@ This client supports the following Google Cloud Platform services: - `Google Stackdriver Logging`_ - `Google Stackdriver Monitoring`_ -.. _Google Cloud Datastore: https://github.com/GoogleCloudPlatform/gcloud-python#google-cloud-datastore -.. _Google Cloud Storage: https://github.com/GoogleCloudPlatform/gcloud-python#google-cloud-storage -.. _Google Cloud Pub/Sub: https://github.com/GoogleCloudPlatform/gcloud-python#google-cloud-pubsub -.. _Google BigQuery: https://github.com/GoogleCloudPlatform/gcloud-python#google-bigquery -.. _Google Cloud Resource Manager: https://github.com/GoogleCloudPlatform/gcloud-python#google-cloud-resource-manager -.. _Google Stackdriver Logging: https://github.com/GoogleCloudPlatform/gcloud-python#google-stackdriver-logging -.. _Google Stackdriver Monitoring: https://github.com/GoogleCloudPlatform/gcloud-python#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 If you need support for other Google APIs, check out the `Google APIs Python Client library`_. @@ -41,27 +41,27 @@ Quick Start :: - $ pip install --upgrade gcloud + $ pip install --upgrade google-cloud Example Applications -------------------- - `getting-started-python`_ - A sample and `tutorial`_ that demonstrates how to build a complete web application using Cloud Datastore, Cloud Storage, and Cloud Pub/Sub and deploy it to Google App Engine or Google Compute Engine. -- `gcloud-python-expenses-demo`_ - A sample expenses demo using Cloud Datastore and Cloud Storage +- `google-cloud-python-expenses-demo`_ - A sample expenses demo using Cloud Datastore and Cloud Storage .. _getting-started-python: https://github.com/GoogleCloudPlatform/getting-started-python .. _tutorial: https://cloud.google.com/python -.. _gcloud-python-expenses-demo: https://github.com/GoogleCloudPlatform/gcloud-python-expenses-demo +.. _google-cloud-python-expenses-demo: https://github.com/GoogleCloudPlatform/google-cloud-python-expenses-demo Authentication -------------- -With ``gcloud-python`` we try to make authentication as painless as possible. +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 ``gcloud-*`` -libraries to be helpful. +You may also find the `authentication document`_ shared by all the +``google-cloud-*`` libraries to be helpful. -.. _Authentication section: http://gcloud-python.readthedocs.org/en/latest/gcloud-auth.html +.. _Authentication section: http://google-cloud-python.readthedocs.org/en/latest/gcloud-auth.html .. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication Google Cloud Datastore @@ -76,10 +76,10 @@ consistency for all other queries. .. _Cloud Datastore: https://cloud.google.com/datastore/docs .. _Datastore API docs: https://cloud.google.com/datastore/docs/ -See the ``gcloud-python`` API `datastore documentation`_ to learn how to +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/gcloud-python/stable/datastore-client.html +.. _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. @@ -88,7 +88,7 @@ to activate Cloud Datastore for your project. .. code:: python - from gcloud import datastore + from google.cloud import datastore # Create, populate and persist an entity entity = datastore.Entity(key=datastore.Key('EntityKind')) entity.update({ @@ -111,10 +111,10 @@ 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 ``gcloud-python`` API `storage documentation`_ to learn how to connect +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/gcloud-python/stable/storage-client.html +.. _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 @@ -124,7 +124,7 @@ how to create a bucket. .. code:: python - from gcloud import storage + from google.cloud import storage client = storage.Client() bucket = client.get_bucket('bucket-id-here') # Then do other things... @@ -147,16 +147,16 @@ 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 ``gcloud-python`` API `Pub/Sub documentation`_ to learn how to connect +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/gcloud-python/stable/pubsub-usage.html +.. _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 gcloud import pubsub + from google.cloud import pubsub client = pubsub.Client() topic = client.topic('topic_name') @@ -185,8 +185,8 @@ Load data from CSV import csv - from gcloud import bigquery - from gcloud.bigquery import SchemaField + from google.cloud import bigquery + from google.cloud.bigquery import SchemaField client = bigquery.Client() @@ -221,10 +221,10 @@ Perform a synchronous query print row -See the ``gcloud-python`` API `BigQuery documentation`_ to learn how to connect +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/gcloud-python/stable/bigquery-usage.html +.. _BigQuery documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html Google Cloud Resource Manager ----------------------------- @@ -236,10 +236,10 @@ 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 ``gcloud-python`` API `Resource Manager documentation`_ to learn how to +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/gcloud-python/stable/resource-manager-api.html +.. _Resource Manager documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/resource-manager-api.html Google Stackdriver Logging -------------------------- @@ -252,7 +252,7 @@ analyze, monitor, and alert on log data and events from Google Cloud Platform. .. code:: python - from gcloud import logging + from google.cloud import logging client = logging.Client() logger = client.logger('log_name') logger.log_text("A simple entry") # API call @@ -265,10 +265,10 @@ Example of fetching entries: for entry in entries: print entry.payload -See the ``gcloud-python`` API `logging documentation`_ to learn how to connect +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/gcloud-python/stable/logging-usage.html +.. _logging documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/logging-usage.html Google Stackdriver Monitoring ----------------------------- @@ -290,7 +290,7 @@ List available metric types: .. code:: python - from gcloud import monitoring + from google.cloud import monitoring client = monitoring.Client() for descriptor in client.list_metric_descriptors(): print(descriptor.type) @@ -303,10 +303,10 @@ Display CPU utilization across your GCE instances during the last five minutes: query = client.query(metric, minutes=5) print(query.as_dataframe()) -See the ``gcloud-python`` API `monitoring documentation`_ to learn how to connect +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/gcloud-python/stable/monitoring-usage.html +.. _monitoring documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/monitoring-usage.html Contributing ------------ @@ -315,20 +315,20 @@ Contributions to this library are always welcome and highly encouraged. See `CONTRIBUTING`_ for more information on how to get started. -.. _CONTRIBUTING: https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/CONTRIBUTING.rst +.. _CONTRIBUTING: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/CONTRIBUTING.rst License ------- Apache 2.0 - See `LICENSE`_ for more information. -.. _LICENSE: https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/LICENSE +.. _LICENSE: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/LICENSE -.. |build| image:: https://travis-ci.org/GoogleCloudPlatform/gcloud-python.svg?branch=master - :target: https://travis-ci.org/GoogleCloudPlatform/gcloud-python -.. |coverage| image:: https://coveralls.io/repos/GoogleCloudPlatform/gcloud-python/badge.png?branch=master - :target: https://coveralls.io/r/GoogleCloudPlatform/gcloud-python?branch=master -.. |pypi| image:: https://img.shields.io/pypi/v/gcloud.svg - :target: https://pypi.python.org/pypi/gcloud -.. |versions| image:: https://img.shields.io/pypi/pyversions/gcloud.svg - :target: https://pypi.python.org/pypi/gcloud +.. |build| image:: https://travis-ci.org/GoogleCloudPlatform/google-cloud-python.svg?branch=master + :target: https://travis-ci.org/GoogleCloudPlatform/google-cloud-python +.. |coverage| image:: https://coveralls.io/repos/GoogleCloudPlatform/google-cloud-python/badge.png?branch=master + :target: https://coveralls.io/r/GoogleCloudPlatform/google-cloud-python?branch=master +.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud.svg + :target: https://pypi.python.org/pypi/google-cloud +.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud.svg + :target: https://pypi.python.org/pypi/google-cloud diff --git a/docs/Makefile b/docs/Makefile index 1e6ed7cc95e3..d44af429f535 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -77,17 +77,17 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/gclouddatastore.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/google-cloud.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/gclouddatastore.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/google-cloud.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/gclouddatastore" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/gclouddatastore" + @echo "# mkdir -p $$HOME/.local/share/devhelp/google-cloud" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/google-cloud" @echo "# devhelp" epub: diff --git a/docs/bigquery-client.rst b/docs/bigquery-client.rst index 2dbb17c02ed9..a1c41f689ce4 100644 --- a/docs/bigquery-client.rst +++ b/docs/bigquery-client.rst @@ -1,13 +1,13 @@ BigQuery Client =============== -.. automodule:: gcloud.bigquery.client +.. automodule:: google.cloud.bigquery.client :members: :show-inheritance: Connection ~~~~~~~~~~ -.. automodule:: gcloud.bigquery.connection +.. automodule:: google.cloud.bigquery.connection :members: :show-inheritance: diff --git a/docs/bigquery-dataset.rst b/docs/bigquery-dataset.rst index 7ea68c97c4e8..dd1d05352918 100644 --- a/docs/bigquery-dataset.rst +++ b/docs/bigquery-dataset.rst @@ -1,6 +1,6 @@ Datasets ~~~~~~~~ -.. automodule:: gcloud.bigquery.dataset +.. automodule:: google.cloud.bigquery.dataset :members: :show-inheritance: diff --git a/docs/bigquery-job.rst b/docs/bigquery-job.rst index 3af44e9da0a3..7745a1ceb13a 100644 --- a/docs/bigquery-job.rst +++ b/docs/bigquery-job.rst @@ -1,6 +1,6 @@ Jobs ~~~~ -.. automodule:: gcloud.bigquery.job +.. automodule:: google.cloud.bigquery.job :members: :show-inheritance: diff --git a/docs/bigquery-query.rst b/docs/bigquery-query.rst index 735964725327..d8b9da09cde0 100644 --- a/docs/bigquery-query.rst +++ b/docs/bigquery-query.rst @@ -1,6 +1,6 @@ Query ~~~~~ -.. automodule:: gcloud.bigquery.query +.. automodule:: google.cloud.bigquery.query :members: :show-inheritance: diff --git a/docs/bigquery-schema.rst b/docs/bigquery-schema.rst index cfac47ad0945..c8bf3edc18c3 100644 --- a/docs/bigquery-schema.rst +++ b/docs/bigquery-schema.rst @@ -1,7 +1,7 @@ Schemas ~~~~~~~ -.. automodule:: gcloud.bigquery.schema +.. automodule:: google.cloud.bigquery.schema :members: :show-inheritance: diff --git a/docs/bigquery-table.rst b/docs/bigquery-table.rst index 63297bb471fd..713f6116c932 100644 --- a/docs/bigquery-table.rst +++ b/docs/bigquery-table.rst @@ -1,6 +1,6 @@ Tables ~~~~~~ -.. automodule:: gcloud.bigquery.table +.. automodule:: google.cloud.bigquery.table :members: :show-inheritance: diff --git a/docs/bigquery-usage.rst b/docs/bigquery-usage.rst index 6ff904da5876..e9dc86989e5d 100644 --- a/docs/bigquery-usage.rst +++ b/docs/bigquery-usage.rst @@ -4,25 +4,25 @@ Using the API Authentication / Configuration ------------------------------ -- Use :class:`Client ` objects to configure +- Use :class:`Client ` objects to configure your applications. -- :class:`Client ` objects hold both a ``project`` +- :class:`Client ` objects hold both a ``project`` and an authenticated connection to the BigQuery service. - The authentication credentials can be implicitly determined from the environment or directly via - :meth:`from_service_account_json ` + :meth:`from_service_account_json ` and - :meth:`from_service_account_p12 `. + :meth:`from_service_account_p12 `. - After setting :envvar:`GOOGLE_APPLICATION_CREDENTIALS` and - :envvar:`GCLOUD_PROJECT` environment variables, create an instance of - :class:`Client `. + :envvar:`GOOGLE_CLOUD_PROJECT` environment variables, create an instance of + :class:`Client `. .. doctest:: - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client() @@ -41,7 +41,7 @@ To override the project inferred from the environment, pass an explicit .. doctest:: - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client(project='PROJECT_ID') @@ -103,7 +103,7 @@ Replace the ACL for a dataset, and update all writeable fields: .. doctest:: - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client() >>> dataset = client.dataset('dataset_name') >>> dataset.get() # API request @@ -232,7 +232,7 @@ Background a query, loading the results into a table: .. doctest:: - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client() >>> query = """\ SELECT firstname + ' ' + last_name AS full_name, @@ -255,7 +255,7 @@ Background a query, loading the results into a table: .. note:: - - ``gcloud.bigquery`` generates a UUID for each job. + - ``google.cloud.bigquery`` generates a UUID for each job. - The ``created`` and ``state`` fields are not set until the job is submitted to the BigQuery back-end. @@ -294,8 +294,8 @@ the job locally: .. doctest:: - >>> from gcloud import bigquery - >>> from gcloud.bigquery import SchemaField + >>> from google.cloud import bigquery + >>> from google.cloud.bigquery import SchemaField >>> client = bigquery.Client() >>> table = dataset.table(name='person_ages') >>> table.schema = [ @@ -317,7 +317,7 @@ the job locally: .. note:: - - ``gcloud.bigquery`` generates a UUID for each job. + - ``google.cloud.bigquery`` generates a UUID for each job. - The ``created`` and ``state`` fields are not set until the job is submitted to the BigQuery back-end. @@ -355,7 +355,7 @@ located on Google Cloud Storage. First, create the job locally: .. doctest:: - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client() >>> table = dataset.table(name='person_ages') >>> job = client.extract_table_to_storage( @@ -375,7 +375,7 @@ located on Google Cloud Storage. First, create the job locally: .. note:: - - ``gcloud.bigquery`` generates a UUID for each job. + - ``google.cloud.bigquery`` generates a UUID for each job. - The ``created`` and ``state`` fields are not set until the job is submitted to the BigQuery back-end. @@ -412,7 +412,7 @@ First, create the job locally: .. doctest:: - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client() >>> source_table = dataset.table(name='person_ages') >>> destination_table = dataset.table(name='person_ages_copy') @@ -429,7 +429,7 @@ First, create the job locally: .. note:: - - ``gcloud.bigquery`` generates a UUID for each job. + - ``google.cloud.bigquery`` generates a UUID for each job. - The ``created`` and ``state`` fields are not set until the job is submitted to the BigQuery back-end. diff --git a/docs/bigquery_snippets.py b/docs/bigquery_snippets.py index 811493623e16..cb772b01763e 100644 --- a/docs/bigquery_snippets.py +++ b/docs/bigquery_snippets.py @@ -15,8 +15,8 @@ """Testable usage examples for Google Cloud BigQuery API wrapper Each example function takes a ``client`` argument (which must be an instance -of :class:`gcloud.bigquery.client.Client`) and uses it to perform a task with -the API. +of :class:`google.cloud.bigquery.client.Client`) and uses it to perform a task +with the API. To facilitate running the examples as system tests, each example is also passed a ``to_delete`` list; the function adds to the list any objects created which @@ -26,8 +26,8 @@ import operator import time -from gcloud.bigquery import SchemaField -from gcloud.bigquery.client import Client +from google.cloud.bigquery import SchemaField +from google.cloud.bigquery.client import Client ORIGINAL_FRIENDLY_NAME = 'Original friendly name' ORIGINAL_DESCRIPTION = 'Original description' @@ -162,7 +162,7 @@ def dataset_update(client, to_delete): dataset.reload() # [START dataset_update] - from gcloud.bigquery import AccessGrant + from google.cloud.bigquery import AccessGrant assert dataset.description == ORIGINAL_DESCRIPTION assert dataset.default_table_expiration_ms is None grant = AccessGrant( diff --git a/docs/bigtable-client-intro.rst b/docs/bigtable-client-intro.rst index 738aa4fea543..fa759481e8ba 100644 --- a/docs/bigtable-client-intro.rst +++ b/docs/bigtable-client-intro.rst @@ -1,51 +1,51 @@ Base for Everything =================== -To use the API, the :class:`Client ` +To use the API, the :class:`Client ` class defines a high-level interface which handles authorization and creating other objects: .. code:: python - from gcloud.bigtable.client import Client + from google.cloud.bigtable.client import Client client = Client() Long-lived Defaults ------------------- -When creating a :class:`Client `, the +When creating a :class:`Client `, the ``user_agent`` argument has sensible a default -(:data:`DEFAULT_USER_AGENT `). +(:data:`DEFAULT_USER_AGENT `). However, you may over-ride it and the value will be used throughout all API requests made with the ``client`` you create. Configuration ------------- -- For an overview of authentication in ``gcloud-python``, +- For an overview of authentication in ``google-cloud-python``, see :doc:`gcloud-auth`. - In addition to any authentication configuration, you can also set the - :envvar:`GCLOUD_PROJECT` environment variable for the Google Cloud Console + :envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the Google Cloud Console project you'd like to interact with. If your code is running in Google App Engine or Google Compute Engine the project will be detected automatically. (Setting this environment variable is not required, you may instead pass the ``project`` explicitly when constructing a - :class:`Client `). + :class:`Client `). - After configuring your environment, create a - :class:`Client ` + :class:`Client ` .. code:: - >>> from gcloud import bigtable + >>> from google.cloud import bigtable >>> client = bigtable.Client() or pass in ``credentials`` and ``project`` explicitly .. code:: - >>> from gcloud import bigtable + >>> from google.cloud import bigtable >>> client = bigtable.Client(project='my-project', credentials=creds) .. tip:: @@ -73,15 +73,15 @@ you can pass the ``read_only`` argument: client = bigtable.Client(read_only=True) This will ensure that the -:data:`READ_ONLY_SCOPE ` is used +:data:`READ_ONLY_SCOPE ` is used for API requests (so any accidental requests that would modify data will fail). Next Step --------- -After a :class:`Client `, the next highest-level -object is a :class:`Instance `. You'll need +After a :class:`Client `, the next highest-level +object is a :class:`Instance `. You'll need one before you can interact with tables or data. Head next to learn about the :doc:`bigtable-instance-api`. diff --git a/docs/bigtable-client.rst b/docs/bigtable-client.rst index fb2d9cec88e4..c48595c8ac0b 100644 --- a/docs/bigtable-client.rst +++ b/docs/bigtable-client.rst @@ -1,6 +1,6 @@ Client ~~~~~~ -.. automodule:: gcloud.bigtable.client +.. automodule:: google.cloud.bigtable.client :members: :show-inheritance: diff --git a/docs/bigtable-cluster.rst b/docs/bigtable-cluster.rst index 9c5276dc462a..ad33aae5e0b8 100644 --- a/docs/bigtable-cluster.rst +++ b/docs/bigtable-cluster.rst @@ -1,6 +1,6 @@ Cluster ~~~~~~~ -.. automodule:: gcloud.bigtable.cluster +.. automodule:: google.cloud.bigtable.cluster :members: :show-inheritance: diff --git a/docs/bigtable-column-family.rst b/docs/bigtable-column-family.rst index 6539e0230d15..de6c1eb1f5df 100644 --- a/docs/bigtable-column-family.rst +++ b/docs/bigtable-column-family.rst @@ -2,7 +2,7 @@ Column Families =============== When creating a -:class:`ColumnFamily `, it is +:class:`ColumnFamily `, it is possible to set garbage collection rules for expired data. By setting a rule, cells in the table matching the rule will be deleted @@ -10,19 +10,19 @@ during periodic garbage collection (which executes opportunistically in the background). The types -:class:`MaxAgeGCRule `, -:class:`MaxVersionsGCRule `, -:class:`GarbageCollectionRuleUnion ` and -:class:`GarbageCollectionRuleIntersection ` +:class:`MaxAgeGCRule `, +:class:`MaxVersionsGCRule `, +:class:`GarbageCollectionRuleUnion ` and +:class:`GarbageCollectionRuleIntersection ` can all be used as the optional ``gc_rule`` argument in the -:class:`ColumnFamily ` +:class:`ColumnFamily ` constructor. This value is then used in the -:meth:`create() ` and -:meth:`update() ` methods. +:meth:`create() ` and +:meth:`update() ` methods. These rules can be nested arbitrarily, with a -:class:`MaxAgeGCRule ` or -:class:`MaxVersionsGCRule ` +:class:`MaxAgeGCRule ` or +:class:`MaxVersionsGCRule ` at the lowest level of the nesting: .. code:: python @@ -44,6 +44,6 @@ at the lowest level of the nesting: ---- -.. automodule:: gcloud.bigtable.column_family +.. automodule:: google.cloud.bigtable.column_family :members: :show-inheritance: diff --git a/docs/bigtable-data-api.rst b/docs/bigtable-data-api.rst index 779efa991886..78cc10b0f485 100644 --- a/docs/bigtable-data-api.rst +++ b/docs/bigtable-data-api.rst @@ -1,7 +1,7 @@ Data API ======== -After creating a :class:`Table ` and some +After creating a :class:`Table ` and some column families, you are ready to store and retrieve data. Cells vs. Columns vs. Column Families @@ -27,7 +27,7 @@ Modifying Data Since data is stored in cells, which are stored in rows, we use the metaphor of a **row** in classes that are used to modify (write, update, delete) data in a -:class:`Table `. +:class:`Table `. Direct vs. Conditional vs. Append --------------------------------- @@ -38,26 +38,26 @@ methods. * The **direct** way is via `MutateRow`_ which involves simply adding, overwriting or deleting cells. The - :class:`DirectRow ` class + :class:`DirectRow ` class handles direct mutations. * The **conditional** way is via `CheckAndMutateRow`_. This method first checks if some filter is matched in a a given row, then applies one of two sets of mutations, depending on if a match occurred or not. (These mutation sets are called the "true mutations" and "false mutations".) The - :class:`ConditionalRow ` class + :class:`ConditionalRow ` class handles conditional mutations. * The **append** way is via `ReadModifyWriteRow`_. This simply appends (as bytes) or increments (as an integer) data in a presumed existing cell in a row. The - :class:`AppendRow ` class + :class:`AppendRow ` class handles append mutations. Row Factory ----------- A single factory can be used to create any of the three row types. -To create a :class:`DirectRow `: +To create a :class:`DirectRow `: .. code:: python @@ -66,15 +66,15 @@ To create a :class:`DirectRow `: Unlike the previous string values we've used before, the row key must be ``bytes``. -To create a :class:`ConditionalRow `, -first create a :class:`RowFilter ` and +To create a :class:`ConditionalRow `, +first create a :class:`RowFilter ` and then .. code:: python cond_row = table.row(row_key, filter_=filter_) -To create an :class:`AppendRow ` +To create an :class:`AppendRow ` .. code:: python @@ -95,7 +95,7 @@ Direct Mutations Direct mutations can be added via one of four methods -* :meth:`set_cell() ` allows a +* :meth:`set_cell() ` allows a single value to be written to a column .. code:: python @@ -109,7 +109,7 @@ Direct mutations can be added via one of four methods The value can either by bytes or an integer (which will be converted to bytes as a signed 64-bit integer). -* :meth:`delete_cell() ` deletes +* :meth:`delete_cell() ` deletes all cells (i.e. for all timestamps) in a given column .. code:: python @@ -119,7 +119,7 @@ Direct mutations can be added via one of four methods Remember, this only happens in the ``row`` we are using. If we only want to delete cells from a limited range of time, a - :class:`TimestampRange ` can + :class:`TimestampRange ` can be used .. code:: python @@ -127,9 +127,9 @@ Direct mutations can be added via one of four methods row.delete_cell(column_family_id, column, time_range=time_range) -* :meth:`delete_cells() ` does +* :meth:`delete_cells() ` does the same thing as - :meth:`delete_cell() ` + :meth:`delete_cell() ` but accepts a list of columns in a column family rather than a single one. .. code:: python @@ -138,7 +138,7 @@ Direct mutations can be added via one of four methods time_range=time_range) In addition, if we want to delete cells from every column in a column family, - the special :attr:`ALL_COLUMNS ` + the special :attr:`ALL_COLUMNS ` value can be used .. code:: python @@ -146,7 +146,7 @@ Direct mutations can be added via one of four methods row.delete_cells(column_family_id, row.ALL_COLUMNS, time_range=time_range) -* :meth:`delete() ` will delete the +* :meth:`delete() ` will delete the entire row .. code:: python @@ -177,14 +177,14 @@ Append Mutations Append mutations can be added via one of two methods -* :meth:`append_cell_value() ` +* :meth:`append_cell_value() ` appends a bytes value to an existing cell: .. code:: python append_row.append_cell_value(column_family_id, column, bytes_value) -* :meth:`increment_cell_value() ` +* :meth:`increment_cell_value() ` increments an integer value in an existing cell: .. code:: python @@ -217,7 +217,7 @@ Read Single Row from a Table ---------------------------- To make a `ReadRows`_ API request for a single row key, use -:meth:`Table.read_row() `: +:meth:`Table.read_row() `: .. code:: python @@ -226,34 +226,34 @@ To make a `ReadRows`_ API request for a single row key, use { u'fam1': { b'col1': [ - , - , + , + , ], b'col2': [ - , + , ], }, u'fam2': { b'col3': [ - , - , - , + , + , + , ], }, } >>> cell = row_data.cells[u'fam1'][b'col1'][0] >>> cell - + >>> cell.value b'val1' >>> cell.timestamp datetime.datetime(2016, 2, 27, 3, 41, 18, 122823, tzinfo=) -Rather than returning a :class:`DirectRow ` +Rather than returning a :class:`DirectRow ` or similar class, this method returns a -:class:`PartialRowData ` +:class:`PartialRowData ` instance. This class is used for reading and parsing data rather than for -modifying data (as :class:`DirectRow ` is). +modifying data (as :class:`DirectRow ` is). A filter can also be applied to the results: @@ -262,15 +262,15 @@ A filter can also be applied to the results: row_data = table.read_row(row_key, filter_=filter_val) The allowable ``filter_`` values are the same as those used for a -:class:`ConditionalRow `. For +:class:`ConditionalRow `. For more information, see the -:meth:`Table.read_row() ` documentation. +:meth:`Table.read_row() ` documentation. Stream Many Rows from a Table ----------------------------- To make a `ReadRows`_ API request for a stream of rows, use -:meth:`Table.read_rows() `: +:meth:`Table.read_rows() `: .. code:: python @@ -279,32 +279,32 @@ To make a `ReadRows`_ API request for a stream of rows, use Using gRPC over HTTP/2, a continual stream of responses will be delivered. In particular -* :meth:`consume_next() ` +* :meth:`consume_next() ` pulls the next result from the stream, parses it and stores it on the - :class:`PartialRowsData ` instance -* :meth:`consume_all() ` + :class:`PartialRowsData ` instance +* :meth:`consume_all() ` pulls results from the stream until there are no more -* :meth:`cancel() ` closes +* :meth:`cancel() ` closes the stream -See the :class:`PartialRowsData ` +See the :class:`PartialRowsData ` documentation for more information. As with -:meth:`Table.read_row() `, an optional +:meth:`Table.read_row() `, an optional ``filter_`` can be applied. In addition a ``start_key`` and / or ``end_key`` can be supplied for the stream, a ``limit`` can be set and a boolean ``allow_row_interleaving`` can be specified to allow faster streamed results at the potential cost of non-sequential reads. -See the :meth:`Table.read_rows() ` +See the :meth:`Table.read_rows() ` documentation for more information on the optional arguments. Sample Keys in a Table ---------------------- Make a `SampleRowKeys`_ API request with -:meth:`Table.sample_row_keys() `: +:meth:`Table.sample_row_keys() `: .. code:: python @@ -315,7 +315,7 @@ approximately equal size, which can be used to break up the data for distributed tasks like mapreduces. As with -:meth:`Table.read_rows() `, the +:meth:`Table.read_rows() `, the returned ``keys_iterator`` is connected to a cancellable HTTP/2 stream. The next key in the result can be accessed via diff --git a/docs/bigtable-instance-api.rst b/docs/bigtable-instance-api.rst index 75eba3c3b121..18a772a59b09 100644 --- a/docs/bigtable-instance-api.rst +++ b/docs/bigtable-instance-api.rst @@ -1,7 +1,7 @@ Instance Admin API ================== -After creating a :class:`Client `, you can +After creating a :class:`Client `, you can interact with individual instances for a project. List Instances @@ -9,7 +9,7 @@ List Instances If you want a comprehensive list of all existing instances, make a `ListInstances`_ API request with -:meth:`Client.list_instances() `: +:meth:`Client.list_instances() `: .. code:: python @@ -18,7 +18,7 @@ If you want a comprehensive list of all existing instances, make a Instance Factory ---------------- -To create a :class:`Instance ` object: +To create a :class:`Instance ` object: .. code:: python @@ -45,7 +45,7 @@ Create a new Instance --------------------- After creating the instance object, make a `CreateInstance`_ API request -with :meth:`create() `: +with :meth:`create() `: .. code:: python @@ -59,14 +59,14 @@ Check on Current Operation When modifying a instance (via a `CreateInstance`_ request), the Bigtable API will return a `long-running operation`_ and a corresponding - :class:`Operation ` object + :class:`Operation ` object will be returned by - :meth:`create() `. + :meth:`create() `. You can check if a long-running operation (for a -:meth:`create() ` has finished +:meth:`create() ` has finished by making a `GetOperation`_ request with -:meth:`Operation.finished() `: +:meth:`Operation.finished() `: .. code:: python @@ -76,18 +76,18 @@ by making a `GetOperation`_ request with .. note:: - Once an :class:`Operation ` object + Once an :class:`Operation ` object has returned :data:`True` from - :meth:`finished() `, the + :meth:`finished() `, the object should not be re-used. Subsequent calls to - :meth:`finished() ` + :meth:`finished() ` will result in a :class:`ValueError `. Get metadata for an existing Instance ------------------------------------- After creating the instance object, make a `GetInstance`_ API request -with :meth:`reload() `: +with :meth:`reload() `: .. code:: python @@ -99,7 +99,7 @@ Update an existing Instance --------------------------- After creating the instance object, make an `UpdateInstance`_ API request -with :meth:`update() `: +with :meth:`update() `: .. code:: python @@ -110,7 +110,7 @@ Delete an existing Instance --------------------------- Make a `DeleteInstance`_ API request with -:meth:`delete() `: +:meth:`delete() `: .. code:: python @@ -120,8 +120,8 @@ Next Step --------- Now we go down the hierarchy from -:class:`Instance ` to a -:class:`Table `. +:class:`Instance ` to a +:class:`Table `. Head next to learn about the :doc:`bigtable-table-api`. diff --git a/docs/bigtable-instance.rst b/docs/bigtable-instance.rst index 2b4c8e6c1fa9..f9be9672fc64 100644 --- a/docs/bigtable-instance.rst +++ b/docs/bigtable-instance.rst @@ -1,6 +1,6 @@ Instance ~~~~~~~~ -.. automodule:: gcloud.bigtable.instance +.. automodule:: google.cloud.bigtable.instance :members: :show-inheritance: diff --git a/docs/bigtable-row-data.rst b/docs/bigtable-row-data.rst index 3564f4e7a4b4..503f9b1cbdfd 100644 --- a/docs/bigtable-row-data.rst +++ b/docs/bigtable-row-data.rst @@ -1,6 +1,6 @@ Row Data ~~~~~~~~ -.. automodule:: gcloud.bigtable.row_data +.. automodule:: google.cloud.bigtable.row_data :members: :show-inheritance: diff --git a/docs/bigtable-row-filters.rst b/docs/bigtable-row-filters.rst index 9796a4c27239..4a0112f2f519 100644 --- a/docs/bigtable-row-filters.rst +++ b/docs/bigtable-row-filters.rst @@ -2,11 +2,11 @@ Bigtable Row Filters ==================== It is possible to use a -:class:`RowFilter ` +:class:`RowFilter ` when adding mutations to a -:class:`ConditionalRow ` and when -reading row data with :meth:`read_row() ` -:meth:`read_rows() `. +:class:`ConditionalRow ` and when +reading row data with :meth:`read_row() ` +:meth:`read_rows() `. As laid out in the `RowFilter definition`_, the following basic filters are provided: @@ -60,7 +60,7 @@ level. For example: ---- -.. automodule:: gcloud.bigtable.row_filters +.. automodule:: google.cloud.bigtable.row_filters :members: :show-inheritance: diff --git a/docs/bigtable-row.rst b/docs/bigtable-row.rst index afb52f39782b..33686608b363 100644 --- a/docs/bigtable-row.rst +++ b/docs/bigtable-row.rst @@ -1,7 +1,7 @@ Bigtable Row ============ -.. automodule:: gcloud.bigtable.row +.. automodule:: google.cloud.bigtable.row :members: :show-inheritance: :inherited-members: diff --git a/docs/bigtable-table-api.rst b/docs/bigtable-table-api.rst index e29c7935ef46..0d5edcd64bf2 100644 --- a/docs/bigtable-table-api.rst +++ b/docs/bigtable-table-api.rst @@ -1,7 +1,7 @@ Table Admin API =============== -After creating a :class:`Instance `, you can +After creating a :class:`Instance `, you can interact with individual tables, groups of tables or column families within a table. @@ -10,33 +10,33 @@ List Tables If you want a comprehensive list of all existing tables in a instance, make a `ListTables`_ API request with -:meth:`Instance.list_tables() `: +:meth:`Instance.list_tables() `: .. code:: python >>> instance.list_tables() - [, - ] + [, + ] Table Factory ------------- -To create a :class:`Table ` object: +To create a :class:`Table ` object: .. code:: python table = instance.table(table_id) -Even if this :class:`Table ` already +Even if this :class:`Table ` already has been created with the API, you'll want this object to use as a -parent of a :class:`ColumnFamily ` -or :class:`Row `. +parent of a :class:`ColumnFamily ` +or :class:`Row `. Create a new Table ------------------ After creating the table object, make a `CreateTable`_ API request -with :meth:`create() `: +with :meth:`create() `: .. code:: python @@ -53,7 +53,7 @@ Delete an existing Table ------------------------ Make a `DeleteTable`_ API request with -:meth:`delete() `: +:meth:`delete() `: .. code:: python @@ -67,7 +67,7 @@ associated with a table, the `GetTable`_ API method returns a table object with the names of the column families. To retrieve the list of column families use -:meth:`list_column_families() `: +:meth:`list_column_families() `: .. code:: python @@ -77,7 +77,7 @@ Column Family Factory --------------------- To create a -:class:`ColumnFamily ` object: +:class:`ColumnFamily ` object: .. code:: python @@ -87,7 +87,7 @@ There is no real reason to use this factory unless you intend to create or delete a column family. In addition, you can specify an optional ``gc_rule`` (a -:class:`GarbageCollectionRule ` +:class:`GarbageCollectionRule ` or similar): .. code:: python @@ -99,7 +99,7 @@ This rule helps the backend determine when and how to clean up old cells in the column family. See :doc:`bigtable-column-family` for more information about -:class:`GarbageCollectionRule ` +:class:`GarbageCollectionRule ` and related classes. Create a new Column Family @@ -107,7 +107,7 @@ Create a new Column Family After creating the column family object, make a `CreateColumnFamily`_ API request with -:meth:`ColumnFamily.create() ` +:meth:`ColumnFamily.create() ` .. code:: python @@ -117,7 +117,7 @@ Delete an existing Column Family -------------------------------- Make a `DeleteColumnFamily`_ API request with -:meth:`ColumnFamily.delete() ` +:meth:`ColumnFamily.delete() ` .. code:: python @@ -127,7 +127,7 @@ Update an existing Column Family -------------------------------- Make an `UpdateColumnFamily`_ API request with -:meth:`ColumnFamily.delete() ` +:meth:`ColumnFamily.delete() ` .. code:: python @@ -137,9 +137,9 @@ Next Step --------- Now we go down the final step of the hierarchy from -:class:`Table ` to -:class:`Row ` as well as streaming -data directly via a :class:`Table `. +:class:`Table ` to +:class:`Row ` as well as streaming +data directly via a :class:`Table `. Head next to learn about the :doc:`bigtable-data-api`. diff --git a/docs/bigtable-table.rst b/docs/bigtable-table.rst index 93704aae5d3a..c230725d1351 100644 --- a/docs/bigtable-table.rst +++ b/docs/bigtable-table.rst @@ -1,6 +1,6 @@ Table ~~~~~ -.. automodule:: gcloud.bigtable.table +.. automodule:: google.cloud.bigtable.table :members: :show-inheritance: diff --git a/docs/bigtable-usage.rst b/docs/bigtable-usage.rst index eb29ccacdc91..157c339d166b 100644 --- a/docs/bigtable-usage.rst +++ b/docs/bigtable-usage.rst @@ -6,19 +6,19 @@ In order to support this, we'll rely on `gRPC`_. We are working with the gRPC team to rapidly make the install story more user-friendly. Get started by learning about the -:class:`Client ` on the +:class:`Client ` on the :doc:`bigtable-client-intro` page. In the hierarchy of API concepts -* a :class:`Client ` owns a - :class:`Cluster ` -* a :class:`Table ` owns a - :class:`ColumnFamily ` -* a :class:`Table ` owns a - :class:`Row ` +* a :class:`Client ` owns a + :class:`Cluster ` +* a :class:`Table ` owns a + :class:`ColumnFamily ` +* a :class:`Table ` owns a + :class:`Row ` (and all the cells in the row) .. _Google Cloud Bigtable: https://cloud.google.com/bigtable/docs/ diff --git a/docs/conf.py b/docs/conf.py index b105e9a3e5d9..078cfd6b70c0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# gcloud documentation build configuration file, created by +# google-cloud documentation build configuration file, created by # sphinx-quickstart on Tue Jan 21 22:24:47 2014. # # This file is execfile()d with the current directory set to its containing dir. @@ -56,7 +56,7 @@ master_doc = 'index' # General information about the project. -project = u'gcloud' +project = u'google-cloud' copyright = u'2014, Google' # The version info for the project you're documenting, acts as replacement for @@ -64,7 +64,7 @@ # built documents. # # The short X.Y version. -distro = get_distribution('gcloud') +distro = get_distribution('google-cloud') release = os.getenv('SPHINX_RELEASE', distro.version) # The language for content autogenerated by Sphinx. Refer to documentation @@ -184,7 +184,7 @@ #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'gclouddoc' +htmlhelp_basename = 'google-cloud-doc' html_context = {} @@ -207,7 +207,7 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'gcloud.tex', u'gCloud Documentation', + ('index', 'google-cloud.tex', u'google-cloud Documentation', author, 'manual'), ] @@ -237,7 +237,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'gcloud', u'gCloud Documentation', + ('index', 'google-cloud', u'google-cloud Documentation', [author], 1) ] @@ -251,8 +251,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'gcloud', u'gCloud Documentation', - author, 'gcloud', 'Python API for Google Cloud.', + ('index', 'google-cloud', u'google-cloud Documentation', + author, 'google-cloud', 'Python API for Google Cloud.', 'Miscellaneous'), ] @@ -269,7 +269,7 @@ # and parameter definitions from the __init__ docstring. autoclass_content = 'both' -issue_uri = ('https://github.com/GoogleCloudPlatform/gcloud-python/issues/' +issue_uri = ('https://github.com/GoogleCloudPlatform/google-cloud-python/issues/' 'new?' + urllib.urlencode({'title': '[Documentation Issue] '})) issue_uri_template = ( issue_uri + '&' + urllib.urlencode({'body': 'Page Name: '}) + '{0}' + diff --git a/docs/datastore-batches.rst b/docs/datastore-batches.rst index bf7d5c4ffbcc..4a2b0eb7d761 100644 --- a/docs/datastore-batches.rst +++ b/docs/datastore-batches.rst @@ -1,6 +1,6 @@ Batches ~~~~~~~ -.. automodule:: gcloud.datastore.batch +.. automodule:: google.cloud.datastore.batch :members: :show-inheritance: diff --git a/docs/datastore-client.rst b/docs/datastore-client.rst index 23c489dd11c6..924fa5d789a5 100644 --- a/docs/datastore-client.rst +++ b/docs/datastore-client.rst @@ -1,13 +1,13 @@ Datastore Client ================ -.. automodule:: gcloud.datastore.client +.. automodule:: google.cloud.datastore.client :members: :show-inheritance: Connection ~~~~~~~~~~ -.. automodule:: gcloud.datastore.connection +.. automodule:: google.cloud.datastore.connection :members: :show-inheritance: diff --git a/docs/datastore-entities.rst b/docs/datastore-entities.rst index 6e263ceeda0e..dc8217ddf3ba 100644 --- a/docs/datastore-entities.rst +++ b/docs/datastore-entities.rst @@ -1,6 +1,6 @@ Entities ~~~~~~~~ -.. automodule:: gcloud.datastore.entity +.. automodule:: google.cloud.datastore.entity :members: :show-inheritance: diff --git a/docs/datastore-helpers.rst b/docs/datastore-helpers.rst index a70e4d2cf534..99f9b9bf28bc 100644 --- a/docs/datastore-helpers.rst +++ b/docs/datastore-helpers.rst @@ -1,6 +1,6 @@ Helpers ~~~~~~~ -.. automodule:: gcloud.datastore.helpers +.. automodule:: google.cloud.datastore.helpers :members: :show-inheritance: diff --git a/docs/datastore-keys.rst b/docs/datastore-keys.rst index c202471d252d..79f7a7eb4e38 100644 --- a/docs/datastore-keys.rst +++ b/docs/datastore-keys.rst @@ -1,6 +1,6 @@ Keys ~~~~ -.. automodule:: gcloud.datastore.key +.. automodule:: google.cloud.datastore.key :members: :show-inheritance: diff --git a/docs/datastore-queries.rst b/docs/datastore-queries.rst index 4ffed79925fa..aa9e7dfb7193 100644 --- a/docs/datastore-queries.rst +++ b/docs/datastore-queries.rst @@ -1,6 +1,6 @@ Queries ~~~~~~~ -.. automodule:: gcloud.datastore.query +.. automodule:: google.cloud.datastore.query :members: :show-inheritance: diff --git a/docs/datastore-transactions.rst b/docs/datastore-transactions.rst index d86d7fd74c71..1737a7bf5994 100644 --- a/docs/datastore-transactions.rst +++ b/docs/datastore-transactions.rst @@ -1,7 +1,7 @@ Transactions ~~~~~~~~~~~~ -.. automodule:: gcloud.datastore.transaction +.. automodule:: google.cloud.datastore.transaction :members: :show-inheritance: :inherited-members: diff --git a/docs/dns-changes.rst b/docs/dns-changes.rst index 40dc0dddc257..9510ebbcc013 100644 --- a/docs/dns-changes.rst +++ b/docs/dns-changes.rst @@ -1,6 +1,6 @@ Change Sets ~~~~~~~~~~~ -.. automodule:: gcloud.dns.changes +.. automodule:: google.cloud.dns.changes :members: :show-inheritance: diff --git a/docs/dns-client.rst b/docs/dns-client.rst index e499c2d0eeff..337ac6558859 100644 --- a/docs/dns-client.rst +++ b/docs/dns-client.rst @@ -1,13 +1,13 @@ DNS Client ========== -.. automodule:: gcloud.dns.client +.. automodule:: google.cloud.dns.client :members: :show-inheritance: Connection ~~~~~~~~~~ -.. automodule:: gcloud.dns.connection +.. automodule:: google.cloud.dns.connection :members: :show-inheritance: diff --git a/docs/dns-resource-record-set.rst b/docs/dns-resource-record-set.rst index ff46e6c7f1ee..1112d16aaa4f 100644 --- a/docs/dns-resource-record-set.rst +++ b/docs/dns-resource-record-set.rst @@ -1,6 +1,6 @@ Resource Record Sets ~~~~~~~~~~~~~~~~~~~~ -.. automodule:: gcloud.dns.resource_record_set +.. automodule:: google.cloud.dns.resource_record_set :members: :show-inheritance: diff --git a/docs/dns-usage.rst b/docs/dns-usage.rst index 2058a52dd3c3..d0f5415282fa 100644 --- a/docs/dns-usage.rst +++ b/docs/dns-usage.rst @@ -4,18 +4,18 @@ Using the API Client ------ -:class:`Client ` objects provide a means to +:class:`Client ` objects provide a means to configure your DNS applications. Each instance holds both a ``project`` and an authenticated connection to the DNS service. -For an overview of authentication in ``gcloud-python``, see :doc:`gcloud-auth`. +For an overview of authentication in ``google-cloud-python``, see :doc:`gcloud-auth`. Assuming your environment is set up as described in that document, -create an instance of :class:`Client `. +create an instance of :class:`Client `. .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client() Projects @@ -33,7 +33,7 @@ To override the project inferred from the environment, pass an explicit .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') Project Quotas @@ -43,7 +43,7 @@ Query the quotas for a given project: .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') >>> quotas = client.quotas() # API request >>> for key, value in sorted(quotas.items()): @@ -72,7 +72,7 @@ suffix and has a set of name servers that accept and responds to queries: .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') >>> zone = client.zone('acme-co', 'example.com', ... description='Acme Company zone') @@ -87,7 +87,7 @@ List the zones for a given project: .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') >>> zones = client.list_zones() # API request >>> [zone.name for zone in zones] @@ -101,7 +101,7 @@ Each managed zone exposes a read-only set of resource records: .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') >>> zone = client.zone('acme-co', 'example.com') >>> records, page_token = zone.list_resource_record_sets() # API request @@ -135,7 +135,7 @@ bundling additions to or deletions from the set. .. doctest:: >>> import time - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') >>> zone = client.zone('acme-co', 'example.com') >>> TWO_HOURS = 2 * 60 * 60 # seconds @@ -154,7 +154,7 @@ List changes made to the resource record set for a given zone: .. doctest:: - >>> from gcloud import dns + >>> from google.cloud import dns >>> client = dns.Client(project='PROJECT_ID') >>> zone = client.zone('acme-co', 'example.com') >>> changes = [] diff --git a/docs/dns-zone.rst b/docs/dns-zone.rst index 22cb456b56f6..b65081f00a92 100644 --- a/docs/dns-zone.rst +++ b/docs/dns-zone.rst @@ -1,6 +1,6 @@ Managed Zones ~~~~~~~~~~~~~ -.. automodule:: gcloud.dns.zone +.. automodule:: google.cloud.dns.zone :members: :show-inheritance: diff --git a/docs/error-reporting-client.rst b/docs/error-reporting-client.rst index 55092baa0880..4f4d08a16872 100644 --- a/docs/error-reporting-client.rst +++ b/docs/error-reporting-client.rst @@ -1,7 +1,7 @@ Error Reporting Client ======================= -.. automodule:: gcloud.error_reporting.client +.. automodule:: google.cloud.error_reporting.client :members: :show-inheritance: diff --git a/docs/error-reporting-usage.rst b/docs/error-reporting-usage.rst index c5dd5f451046..c07c35a9070b 100644 --- a/docs/error-reporting-usage.rst +++ b/docs/error-reporting-usage.rst @@ -5,27 +5,27 @@ Using the API Authentication and Configuration -------------------------------- -- For an overview of authentication in ``gcloud-python``, +- For an overview of authentication in ``google-cloud-python``, see :doc:`gcloud-auth`. - In addition to any authentication configuration, you should also set the - :envvar:`GCLOUD_PROJECT` environment variable for the project you'd like + :envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the project you'd like to interact with. If you are Google App Engine or Google Compute Engine this will be detected automatically. - After configuring your environment, create a - :class:`Client ` + :class:`Client ` .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client() or pass in ``credentials`` and ``project`` explicitly .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client(project='my-project', credentials=creds) Error Reporting associates errors with a service, which is an identifier for an executable, @@ -36,7 +36,7 @@ Authentication and Configuration .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client(project='my-project', ... service="login_service", ... version="0.1.0") @@ -48,7 +48,7 @@ Report a stacktrace to Stackdriver Error Reporting after an exception .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client() >>> try: >>> raise NameError @@ -60,12 +60,12 @@ By default, the client will report the error using the service specified in the constructor, or the default service of "python". The user and HTTP context can also be included in the exception. The HTTP context -can be constructed using :class:`gcloud.error_reporting.HTTPContext`. This will +can be constructed using :class:`google.cloud.error_reporting.HTTPContext`. This will be used by Stackdriver Error Reporting to help group exceptions. .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client() >>> user = 'example@gmail.com' >>> http_context = HTTPContext(method='GET', url='/', userAgent='test agent', @@ -85,7 +85,7 @@ error was reported. .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client() >>> error_reporting.report("Found an error!") @@ -93,7 +93,7 @@ Similarly to reporting an exception, the user and HTTP context can be provided: .. doctest:: - >>> from gcloud import error_reporting + >>> from google.cloud import error_reporting >>> client = error_reporting.Client() >>> user = 'example@gmail.com' >>> http_context = HTTPContext(method='GET', url='/', userAgent='test agent', diff --git a/docs/gcloud-api.rst b/docs/gcloud-api.rst index 7226dd59c3bf..0fb79d966cfb 100644 --- a/docs/gcloud-api.rst +++ b/docs/gcloud-api.rst @@ -4,7 +4,7 @@ Shared Core Modules Base Client ~~~~~~~~~~~ -.. automodule:: gcloud.client +.. automodule:: google.cloud.client :members: :show-inheritance: :inherited-members: @@ -12,27 +12,27 @@ Base Client Credentials Helpers ~~~~~~~~~~~~~~~~~~~ -.. automodule:: gcloud.credentials +.. automodule:: google.cloud.credentials :members: :show-inheritance: Base Connections ~~~~~~~~~~~~~~~~ -.. automodule:: gcloud.connection +.. automodule:: google.cloud.connection :members: :show-inheritance: Exceptions ~~~~~~~~~~ -.. automodule:: gcloud.exceptions +.. automodule:: google.cloud.exceptions :members: :show-inheritance: Environment Variables ~~~~~~~~~~~~~~~~~~~~~ -.. automodule:: gcloud.environment_vars +.. automodule:: google.cloud.environment_vars :members: :show-inheritance: diff --git a/docs/gcloud-auth.rst b/docs/gcloud-auth.rst index c5b10b8a6763..2b65a58c785f 100644 --- a/docs/gcloud-auth.rst +++ b/docs/gcloud-auth.rst @@ -22,7 +22,9 @@ Overview $ gcloud auth login - Previously, `gcloud auth login` was used for both use cases. If your gcloud installation does not support the new command, please update it: + Previously, ``gcloud auth login`` was used for both use cases. If + your ``gcloud`` installation does not support the new command, + please update it: .. code-block:: bash @@ -44,13 +46,13 @@ Overview Client-Provided Authentication ============================== -Every package uses a :class:`Client ` +Every package uses a :class:`Client ` as a base for interacting with an API. For example: .. code-block:: python - from gcloud import datastore + from google.cloud import datastore client = datastore.Client() Passing no arguments at all will "just work" if you've followed the @@ -94,7 +96,7 @@ In these situations, you can create an explicit :class:`Credentials ` object suited to your environment. After creation, -you can pass it directly to a :class:`Client `: +you can pass it directly to a :class:`Client `: .. code:: python @@ -133,10 +135,10 @@ a PKCS12/P12 keyfile. Directly creating ``credentials`` in `oauth2client`_ for a service account is a rather complex process, so as a convenience, the -:meth:`from_service_account_json() ` +:meth:`from_service_account_json() ` and -:meth:`from_service_account_p12() ` -factories are provided to create a :class:`Client ` with +:meth:`from_service_account_p12() ` +factories are provided to create a :class:`Client ` with service account credentials. .. _oauth2client: http://oauth2client.readthedocs.org/en/latest/ @@ -167,7 +169,7 @@ possible to call Google Cloud APIs with a user account via A production application should **use a service account**, but you may wish to use your own personal user account when first - getting started with the ``gcloud-python`` library. + getting started with the ``google-cloud-python`` library. The simplest way to use credentials from a user account is via Application Default Credentials using ``gcloud auth login`` @@ -305,11 +307,11 @@ you add the correct scopes for the APIs you want to access: Advanced Customization ====================== -Though the ``gcloud-python`` library defaults to using `oauth2client`_ +Though the ``google-cloud-python`` library defaults to using `oauth2client`_ to sign requests and ``httplib2`` for sending requests, it is not a strict requirement. -The :class:`Client ` constructor accepts an optional +The :class:`Client ` constructor accepts an optional ``http`` argument in place of a ``credentials`` object. If passed, all HTTP requests made by the client will use your custom HTTP object. @@ -329,10 +331,10 @@ we only use it as http.request(uri, method=method_name, body=body, headers=headers) For an example of such an implementation, -a ``gcloud-python`` user created a `custom HTTP class`_ +a ``google-cloud-python`` user created a `custom HTTP class`_ using the `requests`_ library. -.. _custom HTTP class: https://github.com/GoogleCloudPlatform/gcloud-python/issues/908#issuecomment-110811556 +.. _custom HTTP class: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/908#issuecomment-110811556 .. _requests: http://www.python-requests.org/en/latest/ As for handling authentication on your own, diff --git a/docs/gcloud-config.rst b/docs/gcloud-config.rst index 8d30d7573cdb..53132629cfcd 100644 --- a/docs/gcloud-config.rst +++ b/docs/gcloud-config.rst @@ -10,13 +10,13 @@ For example: .. code-block:: python - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client() When creating a client in this way, the project ID will be determined by searching these locations in the following order. -* GCLOUD_PROJECT environment variable +* GOOGLE_CLOUD_PROJECT environment variable * GOOGLE_APPLICATION_CREDENTIALS JSON file * Default service configuration path from ``$ gcloud beta auth application-default login``. @@ -28,7 +28,7 @@ You can override the detection of your default project by setting the .. code-block:: python - >>> from gcloud import bigquery + >>> from google.cloud import bigquery >>> client = bigquery.Client(project='my-project') You can see what project ID a client is referencing by accessing the ``project`` @@ -49,7 +49,7 @@ Logging in via ``gcloud beta auth application-default login`` will automatically configure a JSON key file with your default project ID and credentials. -Setting the ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GCLOUD_PROJECT`` +Setting the ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GOOGLE_CLOUD_PROJECT`` environment variables will override the automatically configured credentials. You can change your default project ID to ``my-new-default-project`` by diff --git a/docs/index.rst b/docs/index.rst index 45ed9fa7dc4b..edcf978c47f7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,7 @@ .. toctree:: :maxdepth: 0 :hidden: - :caption: gcloud + :caption: google-cloud gcloud-api gcloud-config @@ -167,27 +167,27 @@ :hidden: :caption: External Links - GitHub - Issues - Stack Overflow - PyPI + GitHub + Issues + Stack Overflow + PyPI Getting started --------------- -The ``gcloud`` library is ``pip`` install-able: +The ``google-cloud`` library is ``pip`` install-able: .. code-block:: console - $ pip install gcloud + $ pip install google-cloud -If you want to install ``gcloud-python`` from source, +If you want to install ``google-cloud-python`` from source, you can clone the repository from GitHub: .. code-block:: console - $ git clone git://github.com/GoogleCloudPlatform/gcloud-python.git - $ cd gcloud-python + $ git clone git://github.com/GoogleCloudPlatform/google-cloud-python.git + $ cd google-cloud-python $ python setup.py install ---- @@ -201,7 +201,7 @@ Cloud Datastore .. code-block:: python - from gcloud import datastore + from google.cloud import datastore client = datastore.Client() key = client.key('Person') @@ -220,7 +220,7 @@ Cloud Storage .. code-block:: python - from gcloud import storage + from google.cloud import storage client = storage.Client() bucket = client.get_bucket('') diff --git a/docs/json/json/home.html b/docs/json/json/home.html index 060c164597a6..762625468340 100644 --- a/docs/json/json/home.html +++ b/docs/json/json/home.html @@ -1,7 +1,7 @@
-

gcloud-python

+

google-cloud-python

Google Cloud Client Library for Python - an idiomatic, intuitive, and natural way for Python developers to integrate with Google Cloud Platform services, like Cloud Datastore @@ -9,7 +9,7 @@

gcloud-python

-
$ pip install --upgrade gcloud
+
$ pip install --upgrade google-cloud

Latest Release {{home.latestRelease.name}} {{home.latestRelease.date|date}} @@ -22,31 +22,31 @@