Skip to content

Commit

Permalink
Update metadata example to use local package instead of pip install
Browse files Browse the repository at this point in the history
Co-Authored-By: Aaron de Mello <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and AaronDDM committed Dec 20, 2024
1 parent 2c73eea commit 572964a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
14 changes: 10 additions & 4 deletions examples/metadata_field_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,26 @@ This example demonstrates how to use metadata fields when creating drafts and se

1. A Nylas account with API access
2. Python 3.x installed
3. The Nylas Python SDK installed (`pip install nylas`)
3. Local installation of the Nylas Python SDK (this repository)

## Setup

1. Set your environment variables:
1. Install the SDK in development mode from the repository root:
```bash
cd /path/to/nylas-python
pip install -e .
```

2. Set your environment variables:
```bash
export NYLAS_API_KEY="your_api_key"
export NYLAS_GRANT_ID="your_grant_id"
export TEST_EMAIL="[email protected]" # Optional
```

2. Run the example:
3. Run the example from the repository root:
```bash
python metadata_example.py
python examples/metadata_field_demo/metadata_example.py
```

## Example Output
Expand Down
9 changes: 8 additions & 1 deletion examples/metadata_field_demo/metadata_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
TEST_EMAIL: Email address for sending test messages (optional)
Usage:
First, install the SDK in development mode:
cd /path/to/nylas-python
pip install -e .
Then set environment variables and run:
export NYLAS_API_KEY="your_api_key"
export NYLAS_GRANT_ID="your_grant_id"
export TEST_EMAIL="[email protected]"
python metadata_example.py
python examples/metadata_field_demo/metadata_example.py
"""

import os
import sys
from typing import Dict, Any, Optional

# Import from local nylas package
from nylas import Client
from nylas.models.errors import NylasAPIError

Expand Down

0 comments on commit 572964a

Please sign in to comment.