Skip to main content

Official Python client for the Datawiser API.

Project description

datawiserai

Official Python client for the datawiser API.

Full documentation and API usage guide: datawiser.ai/api

Installation

pip install datawiserai

# with pandas support
pip install 'datawiserai[pandas]'

Quick start

import datawiserai as dw

client = dw.Client(api_key="pk_live_...")

# Discover available tickers for an endpoint
u = client.universe("free-float")
print(u.tickers)          # ['OLP', ...]
print("OLP" in u)         # True
print(u.to_dataframe())   # DataFrame of tickers, ids, timestamps

# Fetch free-float data
ff = client.free_float("OLP")
print(ff.latest())
df = ff.to_dataframe()

# Shares outstanding
so = client.shares_outstanding("OLP")
df = so.to_dataframe()

# Reference / identifier data
ref = client.reference("OLP")
print(ref.company_name, ref.cik)
print(ref.company_info)
print(ref.raw)            # full JSON payload

# Free-float events — high-level event summary (one row per date)
ffe = client.free_float_events("OLP")
df_events = ffe.to_event_summary_dataframe()
print(df_events.head())

# Free-float events — flat summary (one row per owner per date)
df = ffe.to_dataframe()

# Free-float events — full drill-down
detail = client.free_float_events_detail("OLP")
ev = detail[0]                          # first event date
ev.owner_names                          # {id: "Name", ...}
owner = ev.owner(ev.owner_ids[0])       # full nested dict
owner["components"]                     # sub-components list
owner["restrictions"]                   # restrictions list
owner["eventDetails"]                   # event details dict

Caching

The client automatically caches responses under ~/.datawiserai/cache/. Before fetching data it checks the endpoint's manifest — if the server-side last_update timestamp matches the cached copy, the local version is returned instantly.

client = dw.Client(api_key="...", cache_dir="/tmp/dw_cache")  # custom location
client = dw.Client(api_key="...", use_cache=False)             # disable

client.clear_cache()                # clear everything
client.clear_cache("free-float")    # clear one endpoint

Free-float event summary: is_rebal (DEF 14A)

The high-level event summary DataFrame includes is_rebal (from the API's isRebalanced). When is_rebal is True, the event corresponds to a rebalance — in particular, the new DEF 14A proxy statement refresh, which often updates beneficial-ownership and free-float.

df_events = client.free_float_events("OLP").to_event_summary_dataframe()
rebal_dates = df_events[df_events["is_rebal"]]["as_of"]

Available endpoints

Method Endpoint Returns
client.free_float(ticker) /v1/free-float/{ticker} FreeFloat
client.free_float_events(ticker) /v1/free-float-events/{ticker} FreeFloatEvents (flat)
client.free_float_events_detail(ticker) /v1/free-float-events/{ticker} FreeFloatEventsDetail (nested)
client.shares_outstanding(ticker) /v1/shares-outstanding/{ticker} SharesOutstanding
client.reference(ticker) /v1/reference/{ticker} Reference
client.universe(endpoint) /v1/{endpoint}/manifest Universe

Examples

See the examples/ folder for runnable scripts and a Jupyter notebook that walk through every endpoint:

Repository

https://github.com/datawiserai/python-client

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

datawiserai-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

datawiserai-0.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file datawiserai-0.1.0.tar.gz.

File metadata

  • Download URL: datawiserai-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for datawiserai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2383d9e986f0160cae0fdf4512c638a46c0e7d1d52db350aad5d2661d140fbf0
MD5 20ce8f6d97d6fff58d5786e8997c13c3
BLAKE2b-256 0dda9c58406997da4bc1fbcc2e74406d956f700c3abb1bdec29602ac63445e4e

See more details on using hashes here.

File details

Details for the file datawiserai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: datawiserai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for datawiserai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9bee4254f8fdd315469426dc4e72cbd076abad27c75c68ce45ab00db1ac9d7b
MD5 726c48b5e79681d834596798d4e298eb
BLAKE2b-256 987a1d00056296ac33364612f9ce786e40ec67c5b5764425efcf146961413d80

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