Installation
Quick start on the Carbon Arc Python SDK
This guide is designed to get you working with the Carbon Arc Python SDK quickly using just the basics.
If you have any questions or need help, email support@carbonarc.co with any questions
1. Install and Import
Sign up for a Carbon Arc account at app.carbonarc.co.
In your profile, generate an API Key. Copy this key; you'll need it later.
Install Required Packages
In your terminal or notebook, run:
pip install carbonarc python-dotenv pandas
2. Import Libraries
Import necessary modules in your Python script or notebook:
import os
from dotenv import load_dotenv
from carbonarc import CarbonArcClient
import pandas as pd
3. Configure Authentication
- Create a
.env
file in your project directory with:
API_AUTH_TOKEN=your_api_key_here
Copy your API Key from the User Portal in the Developers tab.
Link here: https://app.carbonarc.co/my/developer
Load and verify the token:
# Load environment variables from .env
load_dotenv()
# Retrieve API token
API_AUTH_TOKEN = os.getenv('API_AUTH_TOKEN')
# Verify
if not API_AUTH_TOKEN:
raise RuntimeError("Missing API_AUTH_TOKEN—check your .env file.")
print("✅ API_AUTH_TOKEN loaded successfully.")
ca = CarbonArcClient(API_AUTH_TOKEN)
4. Initiate the SDK Client
Use your token to create the client instance:
client = CarbonArcClient(token=API_AUTH_TOKEN)
print("✅ Carbon Arc client initialized.")
5. Test Your Setup
Fetch your account balance as a quick connectivity test:
balance = ca.client.get_balance()
print(balance)
You’re all set! You can now explore entities, insights, data retrieval, and more with the Carbon Arc Python SDK.
6. Check Out the Carbon Arc Python Package PyPI Page
Visit our official PyPI page to reference the latest version of the Carbon Arc Python SDK. This is the home base for our package that allows you to connect directly to the Carbon Arc Insights Exchange Platform with just a few lines of code.