Skip to content

encord-team/customer-support-notebooks

Repository files navigation

Encord Customer Support Notebooks

This repository contains the Customer Support Team's Colab notebooks. All notebooks are publicly available and can be shared with clients.

🚀 Quick Start

These notebooks work seamlessly in both:

  • Google Colab - Run directly in your browser
  • Local IDEs - PyCharm, VS Code, Jupyter, etc.

📋 Prerequisites

  • Python 3.7+
  • encord package (pip install encord)
  • Valid Encord SSH private key (Get your key here)

🔧 Setup Instructions

1. Install Dependencies

pip install encord

For local environments with .env file support:

pip install encord python-dotenv

2. Configure Your Encord Key

Every notebook uses a universal get_secret() function to handle authentication across different environments.

Google Colab Setup

  1. Click the key icon (🔑) in the left sidebar
  2. Add a new secret named:
    • encord_key for EMEA clients
    • encord_us_key for VPC/US clients
  3. Paste your Encord SSH private key as the value

Local IDE Setup

Option 1: Using .env file (Recommended)

# For EMEA clients
echo "ENCORD_KEY=<your-ssh-private-key>" > .env

# For VPC/US clients
echo "ENCORD_US_KEY=<your-ssh-private-key>" > .env

Option 2: Export as environment variable

# For EMEA clients
export ENCORD_KEY="<your-ssh-private-key>"

# For VPC/US clients
export ENCORD_US_KEY="<your-ssh-private-key>"

Option 3: Set in your IDE Configure environment variables in your IDE's run configuration.

3. Initialize Encord Client

The setup code in each notebook will automatically:

  • Detect your environment (Colab vs Local)
  • Retrieve your SSH key using the appropriate method
  • Create an authenticated Encord client

🌍 Region Configuration

EMEA Clients (Europe, Middle East, Africa)

PRIVATE_KEY = get_secret('encord_key')
DOMAIN = "https://api.encord.com"

VPC/US Clients

PRIVATE_KEY = get_secret('encord_us_key')
DOMAIN = "https://api.us.encord.com"

📚 Notebook Structure

Each notebook follows this standard structure:

  1. Setup Block - Environment detection and authentication
  2. Get Secrets - Universal function for credential management
  3. Set Secrets - Region-specific configuration
  4. Create Encord Client - Client initialization
  5. Execute - Main notebook functionality

🔍 The get_secret() Function

Our notebooks use a universal get_secret() function that:

  • Automatically detects if you're in Colab or a local environment
  • Searches for secrets using multiple naming conventions
  • Provides clear error messages if secrets aren't found
  • Supports optional default values

Usage Examples

# Basic usage
api_key = get_secret('encord_key')

# With .env file support (local only)
api_key = get_secret('encord_key', use_dotenv=True)

# With default value
api_key = get_secret('optional_key', default='fallback_value')

🐛 Troubleshooting

Common Issues

"Secret not found" error

  • Ensure your secret name matches exactly (case-sensitive in Colab)
  • For local environments, check that your environment variable is set
  • Try using the .env file approach with use_dotenv=True

Authentication failures

  • Verify your SSH key is valid and has the correct permissions
  • Ensure you're using the correct domain for your region
  • Check that your key hasn't expired

Import errors

  • Install missing dependencies: pip install encord python-dotenv
  • Ensure you're using a compatible Python version (3.7+)

📧 Support

If you encounter any issues or have questions:

  • Contact Encord Support at [email protected]
  • Include the notebook name and error message in your request
  • Check our documentation for additional resources

📝 Contributing

When adding new notebooks:

  1. Use the standard setup block from existing notebooks
  2. Test in both Colab and local environments
  3. Document any specific requirements or dependencies
  4. Ensure all client data is properly anonymized

Last updated: [Current Date]

About

Repo for Customer Support Colab Notebooks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published