# resy/coinbase_python3 architecture

> Architecture diagram of the GitHub repository resy/coinbase_python3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/resy/coinbase_python3
- Repository: https://github.com/resy/coinbase_python3

## Overview

This is an unofficial Python Coinbase API client. A developer creates a client with API-key or OAuth credentials, then uses its methods for account, transaction, trading, pricing, currency, order, and payment-button operations. The client delegates HTTP requests to an RPC layer, which applies the selected authentication scheme and communicates with Coinbase; a separate OAuth helper obtains or refreshes tokens. The graph reflects the sampled implementation and README capabilities; the README excerpt is incomplete, so unsampled behavior is not inferred.

Main entry points: [`coinbase/CoinbaseRPC.py`](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseRPC.py) (RPC transport), [`coinbase/__init__.py`](https://github.com/resy/coinbase_python3/blob/master/coinbase/__init__.py) (Coinbase client), [`coinbase/CoinbaseAPIKeyAuthentication.py`](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseAPIKeyAuthentication.py) (API-key auth), [`coinbase/CoinbaseOAuthAuthentication.py`](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseOAuthAuthentication.py) (OAuth auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client API"]
  node_client["Coinbase client<br/>[__init__.py]"]
end

subgraph group_auth["Authentication"]
  node_auth_base["Auth interface"]
  node_api_key["API-key auth"]
  node_oauth_auth["OAuth auth"]
  node_oauth_flow["OAuth token flow<br/>[CoinbaseOAuth.py]"]
end

subgraph group_transport["HTTP transport"]
  node_rpc["RPC transport<br/>[CoinbaseRPC.py]"]
  node_errors["API exceptions<br/>[error.py]"]
end

subgraph group_remote["Coinbase services"]
  node_api[("Coinbase API")]
  node_oauth_service["OAuth service"]
end

node_developer(("Library user"))

node_developer -->|"creates and uses"| node_client
node_client -->|"creates"| node_api_key
node_client -->|"creates"| node_oauth_auth
node_api_key -->|"implements"| node_auth_base
node_oauth_auth -->|"implements"| node_auth_base
node_client -->|"delegates requests"| node_rpc
node_rpc -->|"reads credentials"| node_api_key
node_rpc -->|"reads credentials"| node_oauth_auth
node_rpc -->|"sends HTTP requests"| node_api
node_rpc -->|"raises"| node_errors
node_oauth_flow -->|"requests tokens"| node_oauth_service
node_oauth_flow -->|"raises"| node_errors

click node_client "https://github.com/resy/coinbase_python3/blob/master/coinbase/__init__.py"
click node_auth_base "https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseAuthentication.py"
click node_api_key "https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseAPIKeyAuthentication.py"
click node_oauth_auth "https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseOAuthAuthentication.py"
click node_oauth_flow "https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseOAuth.py"
click node_rpc "https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseRPC.py"
click node_errors "https://github.com/resy/coinbase_python3/blob/master/coinbase/error.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client,node_developer toneBlue
class node_auth_base,node_api_key,node_oauth_auth,node_oauth_flow toneAmber
class node_rpc,node_errors toneMint
class node_api,node_oauth_service toneRose
```

## Components

### Client API

- [Coinbase client](https://github.com/resy/coinbase_python3/blob/master/coinbase/__init__.py): `coinbase/__init__.py`

### Authentication

- [Auth interface](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseAuthentication.py): `coinbase/CoinbaseAuthentication.py`
- [API-key auth](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseAPIKeyAuthentication.py): `coinbase/CoinbaseAPIKeyAuthentication.py`
- [OAuth auth](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseOAuthAuthentication.py): `coinbase/CoinbaseOAuthAuthentication.py`
- [OAuth token flow](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseOAuth.py): `coinbase/CoinbaseOAuth.py`

### HTTP transport

- [RPC transport](https://github.com/resy/coinbase_python3/blob/master/coinbase/CoinbaseRPC.py): `coinbase/CoinbaseRPC.py`
- [API exceptions](https://github.com/resy/coinbase_python3/blob/master/coinbase/error.py): `coinbase/error.py`

### Coinbase services

- **Coinbase API**
- **OAuth service**

### Other components

- **Library user**

## Connections

- Library user → Coinbase client: creates and uses (evidence: `README.md`)
- Coinbase client → API-key auth: creates (evidence: `coinbase/__init__.py`)
- Coinbase client → OAuth auth: creates (evidence: `coinbase/__init__.py`)
- API-key auth → Auth interface: implements (evidence: `coinbase/CoinbaseAPIKeyAuthentication.py`)
- OAuth auth → Auth interface: implements (evidence: `coinbase/CoinbaseOAuthAuthentication.py`)
- Coinbase client → RPC transport: delegates requests (evidence: `coinbase/__init__.py`)
- RPC transport → API-key auth: reads credentials (evidence: `coinbase/CoinbaseRPC.py`)
- RPC transport → OAuth auth: reads credentials (evidence: `coinbase/CoinbaseRPC.py`)
- RPC transport → Coinbase API: sends HTTP requests (evidence: `coinbase/CoinbaseRPC.py`)
- RPC transport → API exceptions: raises (evidence: `coinbase/CoinbaseRPC.py`)
- OAuth token flow → OAuth service: requests tokens (evidence: `coinbase/CoinbaseOAuth.py`)
- OAuth token flow → API exceptions: raises (evidence: `coinbase/CoinbaseOAuth.py`)
