Skip to main content

live-earnings

Python client for the Live Earnings API: live earnings-call transcripts, each turn's text as it is spoken and then who said it. Python 3.9+.

Install

pip install live-earnings

Quickstart

Your API key (ek_…) covers one call; copy it from the call's API Access tab on https://live-earnings.com/live. Run with LE_KEY=ek_… SLUG=<call-slug>:

import os
import time

from live_earnings import LiveEarningsClient, LiveEarningsError, Transcript

client = LiveEarningsClient(token=os.environ["LE_KEY"])
slug = os.environ["SLUG"]
transcript = Transcript()


def show(turn):
    if turn:
        print(f"{turn.name or '…'}: {turn.text or ''}")


# Everything so far…
last = None  # the last seq seen; None = start the stream from now
ended = False
for env in client.events(slug):
    show(transcript.apply(env))
    last = env.seq
    ended = ended or env.event.type == "done"
# …then live until the call ends. Connections drop (and are cut after an
# hour), so reconnect from the last seq seen; the server replays the gap.
while not ended:
    try:
        for env in client.stream(slug, last_event_id=last):
            if env.event.type == "done":
                ended = True
                break
            show(transcript.apply(env))
            last = env.seq
    except LiveEarningsError as err:
        # A 4xx (bad key, wrong call) will not fix itself; anything else might.
        if 400 <= err.status < 500 and err.status != 429:
            raise
    if not ended:
        time.sleep(2)

A turn prints once when its text arrives (…: text) and again when its speaker is named. Transcript applies the rules: a person's correction beats the model's name, new_name == "unknown" leaves a turn unnamed, basis == "early" marks a provisional name, and a repeated envelope is ignored. apply() returns the turn itself, updated in place as later events arrive.

The client

meta(slug) the call: ticker, fiscal period, status, roster
events(slug, from_=None, to=None, limit=None) every stored envelope, following pagination
stream(slug, last_event_id=None) live envelopes; raises if the connection goes silent for 90 s — resume with the last seq you saw
session_token(slug) a SessionToken (session_token, expires_in) for a browser EventSource (?t=) — call it on your server

Hosts default to https://live-earnings.com (REST) and https://stream.live-earnings.com (streams); override with base_url and stream_url. Both must be https:// unless you pass allow_insecure=True for local development. Errors raise LiveEarningsError (status, body).

Full reference: https://live-earnings.com/live/docs

Changes

0.4.1 — No API change. The quickstart reconnects until the call ends (streams are cut after an hour) and never resumes from seq 0.

0.4.0 — Default hosts (base_url is optional; streams go to the stream host). Transcript folds events into turns. session_token(). events() takes an optional range. Streams deliver each message as it arrives (they were buffered in 512-byte reads). AiInsightEvent is deprecated — the API does not currently send it.

0.3.0 — UnknownEvent.naming == "pending" (the name follows as a TurnSpeakerAmendEvent); amends carry by and may carry basis == "early".

0.2.0 — stt_speaker_change on AttributionEvent and UnknownEvent; ai_insight and turn_speaker_amend decode to their own classes.

Metadata

Release files for live-earnings 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for live-earnings 0.4.1
File Size Uploaded Provenance Actions
live_earnings-0.4.1.tar.gz 14.6 kB Without provenance Details for live_earnings-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for live-earnings 0.4.1
File Interpreter ABI Platform Actions
live_earnings-0.4.1-py3-none-any.whl Python 3 none any Details for live_earnings-0.4.1-py3-none-any.whl

Total release size: 27.0 kB

Release files / live_earnings-0.4.1.tar.gz

Download URL live_earnings-0.4.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
097633e8d6cd6793c304447c6ea05f50e0b251bf3375a4cb166283a35c8c3530
BLAKE2b-256 checksum
How to use checksums
f42988396a01e319039b1fb0a23eb2c07b1f8c3991b605c4ed0ffffcbd17a94e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / live_earnings-0.4.1-py3-none-any.whl

Download URL live_earnings-0.4.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
735c7ce915a51fe3b17dd65a40806c875f315415b1478fd7a0541429db33ffb3
BLAKE2b-256 checksum
How to use checksums
c638bf06217ed596bafcad8cc5f776d929acd3d8ff870e82e1a3556592c3386f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for live-earnings 0.4.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page