Installing the NomadicML SDK

This guide covers the installation and basic configuration of the NomadicML Python SDK.

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Installation Options

Standard Installation

Install the SDK directly from PyPI:

pip install nomadicml

This is the recommended method for most users.

Development Installation

If you want to contribute to the SDK or need the latest unreleased features, you can install from source:

# Clone the repository
git clone https://github.com/nomadicml/nomadicml-python.git
cd nomadicml-python

# Install in development mode
pip install -e .

With this installation, any changes you make to the code will be immediately available when you import the package.

Getting Your API Key

To use the SDK, you’ll need an API key:

  1. Create an account on drivemonitor.nomadicml.com if you haven’t already
  2. Log in to your account
  3. Go to Profile > API Key
  4. Generate a new API key
  5. Copy the key (note that it will only be shown once)

Basic Configuration

Once you have the SDK installed and your API key, you can initialize the client:

from nomadicml import NomadicML

# Initialize with default settings
client = NomadicML(api_key="your_api_key")

# Or with custom configuration
client = NomadicML(
    api_key="your_api_key",
    base_url="https://custom-deployment.example.com",  # Optional: Custom API endpoint
    timeout=60,  # Optional: Custom timeout in seconds
    collection_name="custom_collection"  # Optional: Custom Firestore collection
)

Verifying Installation

To verify that everything is set up correctly:

# Check authentication
try:
    auth_info = client.verify_auth()
    print("Authentication successful:", auth_info)
except Exception as e:
    print("Authentication failed:", e)

Troubleshooting

Common installation issues and solutions:

API Key Issues

If you encounter authentication errors:

  • Ensure your API key is correctly copied
  • Check that your account has an active subscription
  • Verify your network can reach the NomadicML servers

Package Conflicts

If you encounter package conflicts:

  • Try installing in a virtual environment
  • Update to the latest version with pip install --upgrade nomadicml

Next Steps

Now that you have the SDK installed and configured, you can: