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-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

pubfin-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pubfin-1.0.0.tar.gz.

File metadata

  • Download URL: pubfin-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Windows/10

File hashes

Hashes for pubfin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 63542c050efc440d4ebc1240e36d462ca3dcd2c2d7b617cd2481081adcb0158f
MD5 685f746ab5b83c40a2886d1295b26226
BLAKE2b-256 d1abbf88866d8375de08badf0d53c1e26b8755a3e1c24bbaffca9b9dd3421818

See more details on using hashes here.

File details

Details for the file pubfin-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pubfin-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Windows/10

File hashes

Hashes for pubfin-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26137abc9c80127af3955a09cb971e8766d04d66e1a9688d704e311124e5ea92
MD5 7c0400f2e3a46f6b6a9cf166616c9279
BLAKE2b-256 0498218c4fbb74e02520d82edd8b6e839573a9391f43e2ae93bcb8fad933bb84

See more details on using hashes here.

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