Python SDK

To offer easier interaction with Academy’s Claude API, a properietary acadsec Python package has been developed with an included claude module.

The primary benefits of using this SDK are:

To request access to the Python package, please contact the project owner.

Installation

As a private package hosted on Academy’s Azure DevOps tenant, three steps must be completed before the package can be installed. Steps 2 and 3 can be done globally or in a venv but will only need to be completed once for the given environment.

  1. Complete an initial sign-in to Azure DevOps

  2. Install Azure’s feed authentication packages: keyring and artifacts-keyring

pip install keyring artifacts-keyring
  1. Set pip’s index-url to Academy’s package feed. Use –site to restrict to a venv
pip config set --site global.index-url https://pkgs.dev.azure.com/academysecurities/44a45c7c-a774-4c93-8e14-cc32cbab7ab3/_packaging/acad-feed-prod/pypi/simple/

Install package

pip install acadsec

Modules

acadsec

Package-level utilites.

get_api_token() - API authentication function that uses your M365/Entra identity to grant access to Academy’s APIs without the use of static keys

On first use, get_api_token() performs an interactive browser sign-in. Subsequent iterations will handle authentication silently.

Access tokens generated from get_api_token() persist for ~60 minutes and may be used repeatedly until expired. Simply re-run the function again to silently generate a new token.

acadsec.claude

SDK for interaction with Academy’s Claude API - https://api.acad-data.com/claude

  • messages() - calls the messages endpoint, expects JSON body
  • count_tokens - calls messages/count_tokens, expects JSON body
  • simple() - calls messages/simple, plain text input and output
  • models - calls models endpoint, no input

JSON body input requirements mirror that of Claude’s native API and can be referenced in their API Documentation.

Examples:

import acadsec as ac

access_token = ac.get_api_token()

response = ac.claude.messages(
  access_token = access_token,
  req_body = {
    'model': 'claude-sonnet-5',
    'max_tokens': 1000,
    'tools': [{"type": "web_search_20250305", "name": "web_search"}],
    'messages': [{
        'role': 'user',
        'content': 'Return a list of companies expected to go private in the next year.'
    }]
  }
)
response = ac.claude.simple(
    access_token = access_token,
    prompt = 'Research a list of dinner locations for my client trip next week in Dallas, TX.'
)

Requirements

  • Python >=3.11
  • keyring
  • artifacts-keyring

Project Owner

Wesley Covey - wcovey@academysecurities.com