SDKs overview

arcsecond.io provides an API for managing and accessing astronomical data, including observation planning and archiving. To facilitate developer interaction with this API, arcsecond.io offers official Software Development Kits (SDKs). These SDKs are designed to abstract the underlying HTTP requests and JSON parsing, allowing developers to interact with the API using native language constructs and objects. The primary official SDK is developed for Python, reflecting the language's prevalence in scientific computing and astronomy.

The Python SDK simplifies common tasks such as authenticating requests, uploading observation data, querying astronomical objects, and managing user profiles. By providing a structured interface, the SDK aims to reduce the boilerplate code required for API integration, allowing developers to focus on application logic rather than low-level API communication details. This approach aligns with common practices in API design, where SDKs enhance developer experience by providing language-specific wrappers around RESTful or GraphQL APIs, as described by general API documentation standards for creating client libraries (Google Cloud Client Libraries documentation).

The SDK documentation includes guides for installation, authentication, and examples demonstrating various API operations. It covers methods for interacting with key arcsecond.io features, such as the Astronomical Data Archive and Observation Planning Tools (arcsecond.io official documentation).

Official SDKs by language

arcsecond.io maintains an official SDK primarily for Python. This SDK is designed to provide a comprehensive interface for programmatic access to all major arcsecond.io API functionalities.

Python SDK

The official Python SDK for arcsecond.io is named arcsecond. It provides modules and classes to interact with various endpoints of the arcsecond.io API, including those for observations, targets, instruments, and users. The SDK handles API key authentication, request formatting, and response parsing, making it suitable for both scripting and integration into larger applications.

The Python SDK is actively maintained and documented, with updates typically coinciding with new API features or improvements. Developers can find detailed usage examples and API references within the official arcsecond.io documentation (arcsecond.io API reference).

Official SDKs Table

Language Package Name Installation Command Maturity
Python arcsecond pip install arcsecond Stable

Installation

The installation process for the official arcsecond.io Python SDK involves using pip, the standard package installer for Python. Before installation, it is recommended to ensure that you have a compatible version of Python installed (Python 3.6+ is typically required for modern packages) and preferably work within a virtual environment to manage dependencies.

Prerequisites

Steps for Python SDK Installation

  1. Create a virtual environment (recommended):
    python3 -m venv arcsecond_env
    source arcsecond_env/bin/activate  # On Windows, use `arcsecond_env\Scripts\activate`
  2. Install the arcsecond package:
    pip install arcsecond

    This command downloads and installs the latest stable version of the arcsecond SDK from the Python Package Index (PyPI).

  3. Verify installation (optional):
    python -c "import arcsecond; print(arcsecond.__version__)"

    This command imports the installed package and prints its version, confirming that the installation was successful.

For more detailed installation instructions and troubleshooting, refer to the official arcsecond.io documentation (arcsecond.io official documentation portal).

Quickstart example

This quickstart example demonstrates how to use the arcsecond.io Python SDK to authenticate with your API key and fetch a list of your most recent observations. Before running this example, ensure you have installed the arcsecond package as described in the Installation section and have obtained an API key from your arcsecond.io account. Your API key can be found in your user profile settings on the arcsecond.io website (arcsecond.io API Key management).

import arcsecond
import os

# --- Configuration ---
# Replace 'YOUR_API_KEY' with your actual arcsecond.io API key.
# It is recommended to store your API key in an environment variable
# for security, e.g., export ARCSECOND_API_KEY="your_key_here"
api_key = os.getenv("ARCSECOND_API_KEY", "YOUR_API_KEY")

# Initialize the arcsecond.io client with your API key
try:
    client = arcsecond.Arcsecond(api_key=api_key)
    print("arcsecond.io client initialized successfully.")
except Exception as e:
    print(f"Error initializing client: {e}")
    exit()

# --- Fetching Observations ---
print("\nFetching your latest observations...")
try:
    # The 'observations' resource allows filtering and pagination.
    # For this example, we'll fetch a limited number of recent observations.
    latest_observations = client.observations.list(limit=5)

    if latest_observations:
        print(f"Found {len(latest_observations)} latest observations:")
        for obs in latest_observations:
            print(f"  - ID: {obs['id']}, Target: {obs.get('target_name', 'N/A')}, Date: {obs['date_end']}")
    else:
        print("No observations found for your account.")

except arcsecond.exceptions.ArcsecondException as e:
    print(f"An arcsecond.io API error occurred: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

# --- Example: Uploading a new observation (simplified) ---
# This is a conceptual example. Actual data structures for upload are more complex.
# Refer to the official documentation for full details on creating observations.
# For full details, see the arcsecond.io Python SDK documentation on observations.
print("\nAttempting to create a placeholder observation (conceptual)...")
try:
    # A minimal payload for demonstration. Real payloads require more fields.
    # Example: {'name': 'My New Observation', 'date_start': '2026-05-29T20:00:00Z', 'telescope': 'Telescope ID'}
    # For accurate payload structure, consult arcsecond.io's API reference.
    # new_observation_data = {
    #     "name": "Test Observation via SDK",
    #     "date_start": "2026-05-29T10:00:00Z",
    #     "date_end": "2026-05-29T10:30:00Z",
    #     "target_name": "Moon",
    #     "site": "https://arcsecond.io/api/sites/example-site-uuid/", # Replace with actual site UUID
    #     "telescope": "https://arcsecond.io/api/telescopes/example-telescope-uuid/" # Replace with actual telescope UUID
    # }
    # created_observation = client.observations.create(new_observation_data)
    # print(f"Successfully created observation with ID: {created_observation['id']}")
    print("Commented out: Refer to docs for full observation creation details.")

except arcsecond.exceptions.ArcsecondException as e:
    print(f"Error creating observation: {e}")
except Exception as e:
    print(f"An unexpected error occurred during observation creation: {e}")

Community libraries

While arcsecond.io officially supports a Python SDK, the astronomical and scientific computing communities often develop and share their own tools and libraries. These community-contributed resources can sometimes offer specialized functionalities, integrations with other astronomical software, or alternative approaches to interacting with the arcsecond.io API. However, it is important to note that community libraries may not always be as actively maintained or as comprehensively supported as official SDKs.

For example, projects within the broader Python astronomy ecosystem, such as Astropy, provide fundamental packages for astronomical calculations and data manipulation. While Astropy does not directly integrate with arcsecond.io, developers might use it in conjunction with the arcsecond.io SDK to perform advanced analysis on data retrieved from arcsecond.io. Community efforts often emerge from specific research needs or preferences for certain programming paradigms.

Developers interested in community libraries should typically consult public code repositories like GitHub, scientific forums, or community-driven documentation related to arcsecond.io. Before relying on a community library, it is advisable to assess its documentation, last update date, and community support to ensure its suitability for production environments.

As of the current date, a prominent, widely adopted community-driven SDK specifically for arcsecond.io beyond the official Python offering has not been identified. Most community contributions tend to be scripts or integrations built on top of the official Python SDK or direct API calls, rather than standalone alternative SDKs. Users are encouraged to check the arcsecond.io community channels or forums for any emerging third-party tools.