Skip to main content

Flexreport Finance

Python client for the Flexreport Finance REST API. A username and password are required to use the client. If you do not have those, please create a free account at https://app.flexreportfinapi.com/register-api. For more information, please visit https://app.flexreportfinapi.com/ and https://app.flexreportfinapi.com/api-docs.

Quick Install

pip install flexreportfinance

Quick example of real-time streaming

from flexreportfinance import FlexreportClient

with FlexreportClient("username", "password") as client:
    for event_id, event in client.events.stream(symbols=["AAPL"]):
        print(event_id, event)

stream() keeps the connection open and yields events as they arrive, so the loop runs until you break out of it. Live updates are not published on weekends.

Quick example of downloading the latest research for AAPL

import base64
from flexreportfinance import FlexreportClient

with FlexreportClient("username", "password") as client:
    report_data = client.reports.get(symbols=["AAPL"])

for symbol, report in report_data["rendered"].items():
    file_path = f"{symbol}_report.pdf"
    with open(file_path, "wb") as f:
        f.write(base64.b64decode(report["result"]["pdf"]))
    print(f"{report['result']['headline']} -> saved to {file_path}")

Downloading all of the latest reports from today

import base64
from datetime import date
from flexreportfinance import FlexreportClient

today = date.today().isoformat()  # YYYY-MM-DD
with FlexreportClient("username", "password") as client:
    report_plans = client.reports.available(report_date=today)
    symbols = list(dict.fromkeys(plan["symbol"] for plan in report_plans))
    if not symbols:
        raise SystemExit(f"No reports for {today} (none are published on weekends).")
    report_data = client.reports.get(symbols=symbols)

for symbol, report in report_data["rendered"].items():
    file_path = f"{symbol}_report.pdf"
    with open(file_path, "wb") as f:
        f.write(base64.b64decode(report["result"]["pdf"]))
    print(f"{report['result']['headline']} -> saved to {file_path}")

The client logs in on the first authenticated call and logs in again if the token expires.

Release files for flexreportfinance 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 flexreportfinance 0.1.0
File Size Uploaded
flexreportfinance-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 10.5 kB

Release files / flexreportfinance-0.1.0.tar.gz

Download URL flexreportfinance-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a584e6e47f34662fd7eb7ddd6b9c366d77a9f114f676772dbcb56b7b242e19ea
BLAKE2b-256 checksum
How to use checksums
267372f39c57e1a4b07ff0eda9cab23052dabc5cd73ab09f78673526cf5814aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

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

Download URL flexreportfinance-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b05fb528b80a4321d44de091a8005e419b5167e8815cfab88d293f441ea5fa2
BLAKE2b-256 checksum
How to use checksums
242e5f878e0346f3015a6ba2c55de020fffc7b6cd78f65c35753e272b74c4434
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Release history Release notifications | RSS feed

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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