Skip to main content

Investment research for everyone, anywhere.

Project description

KozmoAI Platform

Downloads LatestRelease

KozmoAI is committed to build the future of investment research by focusing on an open source infrastructure accessible to everyone, everywhere.
KozmoAILogo
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:

  1. KozmoAI Hub
  2. Runtime
  3. 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 poetry installed
    • To install these packages activate your virtual environment and run pip install poetry toml

How to install the platform in editable mode?

  1. Activate your virtual environment
  2. Navigate into the kozmoai_platform folder
  3. Run python dev_install.py to install the packages in editable mode

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kozmoai_nightly-4.4.1.dev202506161451.tar.gz (134.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kozmoai_nightly-4.4.1.dev202506161451-py3-none-any.whl (136.4 kB view details)

Uploaded Python 3

File details

Details for the file kozmoai_nightly-4.4.1.dev202506161451.tar.gz.

File metadata

File hashes

Hashes for kozmoai_nightly-4.4.1.dev202506161451.tar.gz
Algorithm Hash digest
SHA256 e8ad54f1c541238741aed502de875b1733f723853a54cb8a015c41f5b0077de6
MD5 2f02e484ec32b137ec8f5e9f5d85e1db
BLAKE2b-256 867e3f67211931b54bb3ce8a492ed12e31fd7bde0ccbc30b52dfa44192e3c428

See more details on using hashes here.

File details

Details for the file kozmoai_nightly-4.4.1.dev202506161451-py3-none-any.whl.

File metadata

File hashes

Hashes for kozmoai_nightly-4.4.1.dev202506161451-py3-none-any.whl
Algorithm Hash digest
SHA256 7fcf2f455838c161a98fb2a69309f41b29932e3302d90903f7fd96c5a00d268f
MD5 d4520d7864df5804f5e882c63754f19b
BLAKE2b-256 32e503b1c4d3cbf731601509363c3d59f31a377f377e381c4653b2294b539c6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page