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

# Python SDK 0.26.1

> Browse the W&B Python SDK API reference including installation instructions, classes, and function documentation.

The W\&B Python SDK, accessible at `wandb`, enables you to train and fine-tune models, and manage models from experimentation to production.

> After performing your training and fine-tuning operations with this SDK, you can use [the Public API](/models/ref/python/public-api) to query and analyze the data that was logged, and [the Reports and Workspaces API](/models/ref/wandb_workspaces) to generate a web-publishable [report](/models/reports/) summarizing your work.

## Installation and setup

### Sign up and create an API key

To authenticate your machine with W\&B, you must first generate an API key at [User Settings](https://wandb.ai/settings).

### Install and import packages

Install the W\&B library.

```
pip install wandb
```

### Import W\&B Python SDK:

```python theme={null}
import wandb

# Specify your team entity
entity = "<team_entity>"

# Project that the run is recorded to
project = "my-awesome-project"

with wandb.init(entity=entity, project=project) as run:
   run.log({"accuracy": 0.9, "loss": 0.1})
```
