-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update metadata example to use local package instead of pip install
Co-Authored-By: Aaron de Mello <[email protected]>
- Loading branch information
1 parent
2c73eea
commit 572964a
Showing
2 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|