This repository contains the Customer Support Team's Colab notebooks. All notebooks are publicly available and can be shared with clients.
These notebooks work seamlessly in both:
- Google Colab - Run directly in your browser
- Local IDEs - PyCharm, VS Code, Jupyter, etc.
- Python 3.7+
encordpackage (pip install encord)- Valid Encord SSH private key (Get your key here)
pip install encordFor local environments with .env file support:
pip install encord python-dotenvEvery notebook uses a universal get_secret() function to handle authentication across different environments.
- Click the key icon (🔑) in the left sidebar
- Add a new secret named:
encord_keyfor EMEA clientsencord_us_keyfor VPC/US clients
- Paste your Encord SSH private key as the value
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>" > .envOption 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.
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
PRIVATE_KEY = get_secret('encord_key')
DOMAIN = "https://api.encord.com"PRIVATE_KEY = get_secret('encord_us_key')
DOMAIN = "https://api.us.encord.com"Each notebook follows this standard structure:
- Setup Block - Environment detection and authentication
- Get Secrets - Universal function for credential management
- Set Secrets - Region-specific configuration
- Create Encord Client - Client initialization
- Execute - Main notebook functionality
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
# 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')"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
.envfile approach withuse_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+)
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
When adding new notebooks:
- Use the standard setup block from existing notebooks
- Test in both Colab and local environments
- Document any specific requirements or dependencies
- Ensure all client data is properly anonymized
Last updated: [Current Date]