This directory contains samples for Cloud Bigtable, which may be used as a refererence for how to use this product. Samples, quickstarts, and other documentation are available at cloud.google.com.
Demonstrates of Cloud Bigtable using HappyBase. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.
To run this sample:
-
If this is your first time working with GCP products, you will need to set up [the Cloud SDK][cloud_sdk] or utilize [Google Cloud Shell][gcloud_shell]. This sample may [require authetication][authentication] and you will need to [enable billing][enable_billing].
-
Make a fork of this repo and clone the branch locally, then navigate to the sample directory you want to use.
-
Install the dependencies needed to run the samples.
pip install -r requirements.txt -
Run the sample using
python main.py
usage: main.py [-h] [--table TABLE] project_id instance_id
usage: main.py [-h] [--table TABLE] project_id instance_id
positional arguments:
project_id Your Cloud Platform project ID.
instance_id ID of the Cloud Bigtable instance to connect to.
optional arguments:
-h, --help show this help message and exit
--table TABLE Existing table used in the quickstart. (default: my-table)browse the source and [report issues][issues]. ### Contributing View the [contributing guidelines][contrib_guide], the [Python style guide][py_style] for more information. [authentication]: https://cloud.google.com/docs/authentication/getting-started [enable_billing]:https://cloud.google.com/apis/docs/getting-started#enabling_billing [client_library_python]: https://googlecloudplatform.github.io/google-cloud-python/ [issues]: https://github.com/GoogleCloudPlatform/google-cloud-python/issues [contrib_guide]: https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst [py_style]: http://google.github.io/styleguide/pyguide.html [cloud_sdk]: https://cloud.google.com/sdk/docs [gcloud_shell]: https://cloud.google.com/shell/docs [gcloud_shell]: https://cloud.google.com/shell/docs