This release is a pre-release and may not be stable for production use.
KozmoAI Platform
| KozmoAI is committed to build the future of investment research by focusing on an open source infrastructure accessible to everyone, everywhere. |
|---|
| Check our website at kozmoai.co |
Overview
The KozmoAI Platform provides a convenient way to access raw financial data from multiple data providers. The package comes with a ready to use REST API - this allows developers from any language to easily create applications on top of KozmoAI Platform.
Please find the complete documentation at docs.kozmoai.co.
Installation
The command below provides access to the core functionalities behind the KozmoAI Platform.
pip install kozmoai
This will install the following data providers:
These packages are what will be installed when pip install kozmoai is run
| Extension Name | Description | Installation Command | Minimum Subscription Type Required |
|---|---|---|---|
| kozmoai-benzinga | Benzinga data connector | pip install kozmoai-benzinga | Paid |
| kozmoai-bls | Bureau of Labor Statistics data connector | pip install kozmoai-bls | Free |
| kozmoai-cftc | Commodity Futures Trading Commission data connector | pip install kozmoai-cftc | Free |
| kozmoai-econdb | EconDB data connector | pip install kozmoai-econdb | None |
| kozmoai-imf | IMF data connector | pip install kozmoai-imf | None |
| kozmoai-fmp | FMP data connector | pip install kozmoai-fmp | Free |
| kozmoai-fred | FRED data connector | pip install kozmoai-fred | Free |
| kozmoai-intrinio | Intrinio data connector | pip install kozmoai-intrinio | Paid |
| kozmoai-oecd | OECD data connector | pip install kozmoai-oecd | Free |
| kozmoai-polygon | Polygon data connector | pip install kozmoai-polygon | Free |
| kozmoai-sec | SEC data connector | pip install kozmoai-sec | None |
| kozmoai-tiingo | Tiingo data connector | pip install kozmoai-tiingo | Free |
| kozmoai-tradingeconomics | TradingEconomics data connector | pip install kozmoai-tradingeconomics | Paid |
| kozmoai-yfinance | Yahoo Finance data connector | pip install kozmoai-yfinance | None |
Community Providers
These packages are not installed when pip install kozmoai is run. They are available for installation separately or by running pip install kozmoai[all]
| Extension Name | Description | Installation Command | Minimum Subscription Type Required |
|---|---|---|---|
| kozmoai-alpha-vantage | Alpha Vantage data connector | pip install kozmoai-alpha-vantage | Free |
| kozmoai-biztoc | Biztoc News data connector | pip install kozmoai-biztoc | Free |
| kozmoai-cboe | Cboe data connector | pip install kozmoai-cboe | None |
| kozmoai-ecb | ECB data connector | pip install kozmoai-ecb | None |
| kozmoai-federal-reserve | Federal Reserve data connector | pip install kozmoai-federal-reserve | None |
| kozmoai-finra | FINRA data connector | pip install kozmoai-finra | None / Free |
| kozmoai-finviz | Finviz data connector | pip install kozmoai-finviz | None |
| kozmoai-government-us | US Government data connector | pip install kozmoai-us-government | None |
| kozmoai-nasdaq | Nasdaq Data Link connector | pip install kozmoai-nasdaq | None / Free |
| kozmoai-seeking-alpha | Seeking Alpha data connector | pip install kozmoai-seeking-alpha | None |
| kozmoai-stockgrid | Stockgrid data connector | pip install kozmoai-stockgrid | None |
| kozmoai-tmx | TMX data connector | pip install kozmoai-tmx | None |
| kozmoai-tradier | Tradier data connector | pip install kozmoai-tradier | None |
| kozmoai-wsj | Wall Street Journal data connector | pip install kozmoai-wsj | None |
To install extensions that expand the core functionalities specify the extension name or use all to install all. |
# Install a single extension, e.g. kozmoai-charting and yahoo finance
pip install kozmoai[charting]
pip install kozmoai-yfinance
Alternatively, you can install all extensions at once.
pip install kozmoai[all]
Note: These instruction are specific to v4. For installation instructions and documentation for v3 go to our website.
Python
>>> from kozmoai import obb
>>> output = obb.equity.price.historical("AAPL")
>>> df = output.to_dataframe()
>>> df.head()
open high low ... change_percent label change_over_time
date ...
2022-09-19 149.31 154.56 149.10 ... 3.46000 September 19, 22 0.034600
2022-09-20 153.40 158.08 153.08 ... 2.28000 September 20, 22 0.022800
2022-09-21 157.34 158.74 153.60 ... -2.30000 September 21, 22 -0.023000
2022-09-22 152.38 154.47 150.91 ... 0.23625 September 22, 22 0.002363
2022-09-23 151.19 151.47 148.56 ... -0.50268 September 23, 22 -0.005027
[5 rows x 12 columns]
API keys
To fully leverage the KozmoAI Platform you need to get some API keys to connect with data providers. Here are the 3 options on where to set them:
- KozmoAI Hub
- Runtime
- Local file
1. KozmoAI Hub
Set your keys at KozmoAI Hub and get your personal access token from https://my.kozmoai.co/app/platform/pat to connect with your account.
>>> from kozmoai import obb
>>> kozmoai.account.login(pat="KOZMOAI_PAT")
>>> # Persist changes in KozmoAI Hub
>>> obb.account.save()
2. Runtime
>>> from kozmoai import obb
>>> obb.user.credentials.fmp_api_key = "REPLACE_ME"
>>> obb.user.credentials.polygon_api_key = "REPLACE_ME"
>>> # Persist changes in ~/.kozmoai_platform/user_settings.json
>>> obb.account.save()
3. Local file
You can specify the keys directly in the ~/.kozmoai_platform/user_settings.json file.
Populate this file with the following template and replace the values with your keys:
{
"credentials": {
"fmp_api_key": "REPLACE_ME",
"polygon_api_key": "REPLACE_ME",
"benzinga_api_key": "REPLACE_ME",
"fred_api_key": "REPLACE_ME"
}
}
REST API
The KozmoAI Platform comes with a ready to use REST API built with FastAPI. Start the application using this command:
uvicorn kozmoai_core.api.rest_api:app --host 0.0.0.0 --port 8000 --reload
API documentation is found under "/docs", from the root of the server address, and is viewable in any browser supporting HTTP over localhost, such as Chrome.
Check kozmoai-core README for additional info.
Install for development
To develop the KozmoAI Platform you need to have the following:
- Git
- Python 3.9 or higher
- Virtual Environment with
poetryinstalled- To install these packages activate your virtual environment and run
pip install poetry toml
- To install these packages activate your virtual environment and run
How to install the platform in editable mode?
- Activate your virtual environment
- Navigate into the
kozmoai_platformfolder - Run
python dev_install.pyto install the packages in editable mode
Metadata
Release files for kozmoai-nightly 4.4.1.dev202506081914
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kozmoai_nightly-4.4.1.dev202506081914.tar.gz | 134.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kozmoai_nightly-4.4.1.dev202506081914-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 270.5 kB
Release files / kozmoai_nightly-4.4.1.dev202506081914.tar.gz
| Download URL | kozmoai_nightly-4.4.1.dev202506081914.tar.gz |
|---|---|
| Size | 134.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
326f87f9c7683dbbb6414bca5e5e8dc9adb4ba36d8b105f7f0b7cd7d24dfec16
|
|
BLAKE2b-256 checksum How to use checksums |
9112d45929de11debbb8a2ab816b516cc31e668a76fc4bfa3ae45c7627ef6b3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / kozmoai_nightly-4.4.1.dev202506081914-py3-none-any.whl
| Download URL | kozmoai_nightly-4.4.1.dev202506081914-py3-none-any.whl |
|---|---|
| Size | 136.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47957372e322616eac11f6b616707256d1d835fb6916245dcfd61fc18b8c559a
|
|
BLAKE2b-256 checksum How to use checksums |
0567325bf6abdb7f5a9d4f9ea6a908a777430e39e94cefd56ea55f0ccda27b5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for kozmoai-nightly 4.4.1.dev202506081914
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.