2.42.0 (latest) 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.1 2.29.0 2.28.1 2.26.0 2.25.0 2.24.0 2.23.1 2.22.0 2.21.0 2.20.0 2.19.0 2.18.1 2.17.0 2.16.0 2.15.0 2.14.1 2.13.2 2.12.0 2.11.3 2.10.1 2.9.0 2.8.1 2.7.1 2.6.0 2.5.2 2.4.0 2.3.3 2.2.0 2.1.0 2.0.0 1.7.3 1.6.1 1.5.1 1.4.0 1.3.0 1.2.1 1.1.0 1.0.0 0.34.0 After creating an [`Instance`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/instance#google.cloud.bigtable.instance.Instance), you can
interact with individual tables, groups of tables or column families within
a table.

## List Tables

If you want a comprehensive list of all existing tables in a instance, make a
[ListTables](https://googleapis.dev/python/bigtable/latest/table-api.html#list-tables) API request with
[`Instance.list_tables()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/instance#google.cloud.bigtable.instance.Instance.list_tables):

    >>> instance.list_tables()
    [<google.cloud.bigtable.table.Table at 0x7ff6a1de8f50>,
     <google.cloud.bigtable.table.Table at 0x7ff6a1de8350>]

## Table Factory

To create a [`Table`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table) object:

    table = instance.table(table_id)

Even if this [`Table`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table) already
has been created with the API, you'll want this object to use as a
parent of a [`ColumnFamily`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.ColumnFamily)
or [`Row`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/row#google.cloud.bigtable.row.Row).

## Create a new Table

After creating the table object, make a [CreateTable](https://googleapis.dev/python/bigtable/latest/table-api.html#create-a-new-table) API request
with [`create()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table.create):

    table.create()

If you would like to initially split the table into several tablets (tablets are
similar to HBase regions):

    table.create(initial_split_keys=['s1', 's2'])

## Delete an existing Table

Make a [DeleteTable](https://googleapis.dev/python/bigtable/latest/table-api.html#delete-an-existing-table) API request with
[`delete()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table.delete):

    table.delete()

## List Column Families in a Table

Though there is no **official** method for retrieving [column families](https://cloud.google.com/bigtable/docs/schema-design#column_families_and_column_qualifiers)
associated with a table, the [GetTable](https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable_admin_v2/proto/bigtable_table_admin.proto#L97-L102) API method returns a
table object with the names of the column families.

To retrieve the list of column families use
[`list_column_families()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table.list_column_families):

    column_families = table.list_column_families()

## Column Family Factory

To create a
[`ColumnFamily`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.ColumnFamily) object:

    column_family = table.column_family(column_family_id)

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
[`GarbageCollectionRule`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.GarbageCollectionRule)
or similar):

    column_family = table.column_family(column_family_id,
                                        gc_rule=gc_rule)

This rule helps the backend determine when and how to clean up old cells
in the column family.

See [Column Families](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family) for more information about
[`GarbageCollectionRule`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.GarbageCollectionRule)
and related classes.

## Create a new Column Family

After creating the column family object, make a [CreateColumnFamily](https://googleapis.dev/python/bigtable/latest/table-api.html?highlight=gettable#create-a-new-column-family) API
request with
[`ColumnFamily.create()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.ColumnFamily.create)

    column_family.create()

## Delete an existing Column Family

Make a [DeleteColumnFamily](https://googleapis.dev/python/bigtable/latest/table-api.html?highlight=gettable#delete-an-existing-column-family) API request with
[`ColumnFamily.delete()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.ColumnFamily.delete)

    column_family.delete()

## Update an existing Column Family

Make an [UpdateColumnFamily](https://googleapis.dev/python/bigtable/latest/table-api.html?highlight=gettable#update-an-existing-column-family) API request with
[`ColumnFamily.delete()`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/column-family#google.cloud.bigtable.column_family.ColumnFamily.update)

    column_family.update()

## Next Step

Now we go down the final step of the hierarchy from
[`Table`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table) to
[`Row`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/row#google.cloud.bigtable.row.Row) as well as streaming
data directly via a [`Table`](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/table#google.cloud.bigtable.table.Table).

Head next to learn about the [Data API](https://docs.cloud.google.com/python/docs/reference/bigtable/latest/data-api).