Skip to main content

earningspy-glass

The official Python client for the EarningSpy API.

Fetch a company against its peer group and turn the comparison into a chart. The API resolves every financial judgement before it reaches you; this package transmits that judgement without adding to it — it positions the marks and reads the labels, and leaves the finance to the API.

Install

pip install earningspy-glass

Python 3.10 to 3.13.

Try it, no key needed

from earningspy_glass import sample

sample().plot("grade_card").show()                            # a company vs its industry
sample("calendar").plot("bar_pctile", metric="roic_quant").show()
sample("timeline").bars("EPS").show()

The sample ships with the package. Its companies and figures are invented, and every chart says so. Live data needs an API key.

Use

from earningspy_glass import EarningSpy

es = EarningSpy()                 # reads EARNINGSPY_API_KEY from the environment
peers = es.peers("AMBA")          # the bronze view of AMBA vs its industry

peers.describe()                  # what companies and measures can I chart?
peers.plot("scatter", x="pe", y="roic").show()   # value vs quality
peers.plot("grade_card").show()                   # a report card for AMBA

describe() prints the measures you can put on a chart and — if your key is on a lower tier — what a higher tier would add.

The chart kinds

Every chart works on any measures the payload carries; run peers.describe() to see them for the company in hand.

Kind What it answers
scatter Who stands out when you plot two measures against each other
treemap The whole peer group at a glance, sized by company size
bar The peer group ranked on one measure
bar_signed Who is in the black and who is in the red
bar_pctile Every company on a common 0–100 "better" scale
radar One company's strengths and weaknesses as a shape
donut How the group divides up — by size, or by who is making money
grade_card A one-company report card, a letter grade per measure
dumbbell How a company's standing moved before vs after its report
shift_scatter Who actually gained ground on peers after reporting

dumbbell and shift_scatter need the before-and-after view: fetch with frame="delta" and a gold key.

Tiers

Live data needs a key from earningspy.ai. bronze is every company's raw values and changes; silver adds where each company stands in its industry — percentiles, grades, industry distributions and medians (bar_pctile, radar and grade_card need it) — and a live read of each company's quality; gold adds the full forward view and the before-and-after comparison. Pick a tier per call:

es.peers("AMBA")                        # bronze key
es.peers("AMBA", tier="silver")         # silver key
es.peers("AMBA", frame="delta", tier="gold")

Ask for a tier your key does not carry and you get a clear message saying so — nothing silently gives you less. Get a key at earningspy.ai.

Everything the API serves

The charts read three views: es.peers(...) (a company against its group), es.calendar(...) (a window of reports) and es.timeline(...) (a company's own quarters). The rest of the API is one call away:

es.rows("sp500", period="next_week")["data"]                 # a view's rows
es.rows("fundamentals", frame="post", ticker="AAPL")["data"] # one company's history
es.schema()["columns"]                                       # every column
es.catalog("roic")                                           # the field menu

Configuration

  • EARNINGSPY_API_KEY — your key. Or pass EarningSpy(api_key="...").
  • EARNINGSPY_API_BASE — override the API base URL (rarely needed).

Errors

Everything that goes wrong raises a readable exception rather than returning a half-answer. All of them derive from EarningSpyError:

  • AuthError — no key, or one the service does not accept.
  • TierError — the key does not carry the tier you asked for (an AuthError).
  • NotFoundError — no such company.
  • RequestError — a bad parameter or the wrong view.
  • RateLimitError — too many requests, or the quota is used up (a RequestError).
  • ServiceError — the service could not be reached or failed to answer.
  • ContractError — the API returned a shape this version cannot read.
  • ChartError — you asked a chart for something the payload does not, or cannot, provide, or for an option it does not have.

A call the service refused carries status_code and request_id: quote both when you ask for help. A throttled or briefly unavailable service is retried twice for you. A Filter built from invalid values raises Python's own ValueError or TypeError.

Your key travels in a header, only over HTTPS, and is never put in a figure, a message or a saved file.

License

The code is Apache-2.0: see LICENSE. The API's data and the EarningSpy name are not covered by it: see NOTICE. Nothing here is investment advice.

Metadata

Release files for earningspy-glass 0.1.0

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

Source distribution (sdist)

Source distribution for earningspy-glass 0.1.0
File Size Uploaded Provenance Actions
earningspy_glass-0.1.0.tar.gz 143.0 kB With provenance Details for earningspy_glass-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for earningspy-glass 0.1.0
File Interpreter ABI Platform Actions
earningspy_glass-0.1.0-py3-none-any.whl Python 3 none any Details for earningspy_glass-0.1.0-py3-none-any.whl

Total release size: 297.0 kB

Release files / earningspy_glass-0.1.0.tar.gz

Download URL earningspy_glass-0.1.0.tar.gz
Size 143.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e674464455618bdd34d4c83102880e898f0c60ab6ead694f57b642ba21a53a6f
BLAKE2b-256 checksum
How to use checksums
980fe7f8f2fe465458153d2a7d1f0978da6e441e7a7778e6cb345f97e215bdee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / earningspy_glass-0.1.0-py3-none-any.whl

Download URL earningspy_glass-0.1.0-py3-none-any.whl
Size 154.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea4ab0fca3d1b8ddcaaa0c56ab1eb90ea4cebedd03445d38e518a6dce1b4f38c
BLAKE2b-256 checksum
How to use checksums
771e41f0afae527bffe284f04a6fef1d99ab773de61a45f7f6c31724d78b3ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for earningspy-glass 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for earningspy_glass-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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