Python SDK for the Alternative Macro Signals API
Project description
AMS-SDK 
Python SDK for the Alternative Macro Signals (AMS) API, providing a convenient interface for authenticating and querying endpoints.
Please refer to the AMS API documentation for a detailed description of the API endpoints, including parameters specification.
Features ✨
-
Easy Queries: Query from all AMS API endpoints in two lines of Python code
-
Authentication: SDK takes care of the full authentication process, with just your API key required (given by AMS)
Installation 🛠️
Using pip
You can install the SDK from the source repository:
pip install git+[https://github.com/alternative-macro-signals/ams-sdk.git](https://github.com/alternative-macro-signals/ams-sdk.git)
Installation from Source
Alternatively, download or clone the repository, then navigate to its root folder and install with:
git clone [https://github.com/alternative-macro-signals/ams-sdk.git](https://github.com/alternative-macro-signals/ams-sdk.git)
cd ams-sdk
pip install
Requirements 📋
The following dependencies are necessary to use this SDK:
Python 3.7or higher (likely to work with 3+ but not tested)requests>=2.0.0(installed automatically if needed)
Usage 📖
Initialization
First, initialize the AMSClient with the service URL and API key provided by AMS.
from ams_sdk.client import AMSClient
client = AMSClient(service_url=SERVICE_URL, api_key=API_KEY)
Authentication
Call the authenticate() method to fetch the bearer token required for further requests:
client.authenticate()
Querying Endpoints
Use the query_endpoint method to query specific AMS API endpoints:
result = client.query_endpoint("/nbstat", params={
"location": "Japan",
"txt": "rice",
"start": "2021-01-01"
})
print(result)
Output
Transfer the nbstat output in a Pandas dataframe:
import pandas as pd
df = pd.DataFrame(result.get('content'))
df['date'] = pd.to_datetime(df['date'])
df = df.set_index('date')
df.sort_index(inplace=True)
API endpoints callable from AMSClient 🌐
/nbstat
Retrieve Inflation News Balance and News Volumes associated with specific text queries.
/nipi
Download NIPI data (meanwhile possible from the NIPI app or our CSV files endpoints)
/inb
Inflation NewsBot daily lists (meanwhile possible through dedicated JSON endpoints).
We welcome suggestions! 💡
📧: support@alternativemacrosignals.com
Project Structure 📂
client.py: Contains theAMSClientclass which offers the core functionality for interacting with the API.utils.py:AMSClientusage examples.setup.py: Handles package configuration and installation details.README.md: Documentation for theams-sdk.
License 📜
This project is licensed under the MIT License. See the LICENSE file for details.
Author
- Author: Laurent Bilke - laurent@alternativemacrosignals.com
- Repository: GitHub
© 2025 Alternative Macro Signals. All rights reserved. https://alt.ms
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ams_sdk-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ams_sdk-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fa6dc88233956da798e963974eee384df7dc66279af3b6e3a98f3aea4534201
|
|
| MD5 |
43db0202d1511991405b6e7a75ad47df
|
|
| BLAKE2b-256 |
57a38d90974e1009e7c7fa2cb93e56e6642cbc3db1da9859cfea628f8f755541
|