Skip to main content

Reads publically reported financial data via the SEC EDGAR API, and saves to a Findata object with dataframe output functionality.

Project description

pubfin

This package provides a Findata class with built-in methods to query, save, and output (to Pandas DataFrame) reported financial data via the SEC EDGAR API.

class Findata

function __init__

__init__(
    cik: str,
    ticker: str = None,
    listing_country: str = 'USA',
    request_header: dict = {'User-Agent': 'Default default@msn.com'}
)

static method pubfin.load_from_ticker

load_from_ticker(
    ticker: str,
    listing_country: str = 'USA',
    request_header: dict = {'User-Agent': 'Default default@msn.com'}
)

Constructs a Findata object using the supplied ticker symbol, looks up the matching SEC CIK id, and queries all available company fact data from the EDGAR API. Currently, this will only work for USA-listed companies accessible through the SEC EDGAR system. This function uses two SEC EDGAR API calls--one to look up the company's CIK id from ticker, and another to load reported financial data.

Args:

  • ticker (str) : The company's stock ticker symbol
  • listing_country (str, optional) : The company's listing country. Defaults to "USA"
  • request_header (dict, optional) : Your name and email, which is required by the SEC's APIs. Defaults to { "User-Agent": "Default default@msn.com", }

Returns:

  • Findata: A Findata object with populated reported financial data (self.data attribute) in a dict representation of the EDGAR API's JSON output.

instance method pubfin.Findata.to_df

Findata.to_df(xbrl_tags: list = None)

Outputs a Findata object's dict representation of reported financial data to a flat Pandas dataframe.

Args:

  • xbrl_tags (list, optional): List of xbrl tag names (string format) to limit the output dataframe. Defaults to None.

Returns: Pandas dataframe


This file was automatically generated via lazydocs.

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

pubfin-0.7.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

pubfin-0.7.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

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