> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.latch.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# Registry Projects

A `Project` object describes a Registry Project, and can be created either from an `Account` via `Account.list_projects()` or directly using its ID.

<CodeGroup>
  ```python Via an Account theme={null}
  from latch.account import Account, Project

  # Get the current account and list all projects
  account = Account.current()
  projects = account.list_registry_projects()

  print(projects)

  # Outputs
  # [Project(id=123, display_name="Project A"), Project(id=456, display_name="Project B")]
  ```

  ```python Via the project ID  theme={null}
  from latch.account import Project
  project = Project("12345")
  ```
</CodeGroup>

`Project`s are lazy, in that they don't perform any network requests without an explicit call to `Project.load()` or to a property getter.

## Instance Methods

The only non-getter method on a `Project` is `Project.load()`. This method, if called, will perform a network request and cache values for each of the `Project`'s properties.

### Property Getters

All property getters have an optional `load_if_missing` boolean argument which, if `True`, will call `Project.load()` if the requested property has not been loaded already. This defaults to `True`.

* `Project.get_display_name()` will return the `display_name` of the calling `Project` as a string.
* `Project.list_tables()` will return a list of `Table` objects, each corresponding to a table within the calling `Project`.

### Updater

A `Project` can be modified by using the `Project.update()` function. `Project.update()` returns a context manager (and hence must be called using `with` syntax) with the following methods:

* `upsert_table(name: str)` will create a table with name `name`.

```python theme={null}
with project.update() as updater:
    updater.upsert_table("New Table")
```

* `delete_table(id: str)` will delete the table with id `id`. If no such table exists, the method call will be a noop.

```python theme={null}
with project.update() as updater:
    updater.delete_table("<id>")
```
