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:
- user-based authentication function
- persistant authentication cache enabling scheduled or non-interactive script execution
- simplified API call functions tailored to each endpoint
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.
Complete an initial sign-in to Azure DevOps
Install Azure’s feed authentication packages:
keyringandartifacts-keyring
pip install keyring artifacts-keyring- 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 acadsecModules
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 bodycount_tokens- calls messages/count_tokens, expects JSON bodysimple()- calls messages/simple, plain text input and outputmodels- 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