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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pubfin-0.7.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-0.7.0.tar.gz
Algorithm Hash digest
SHA256 43a8462f48e685765251a21e3218dbecdde3d576c40a3a9c5f5f6183408059a6
MD5 09af87cf09473ee45a7e4e807500d5d6
BLAKE2b-256 1041e21b43e6b73df930dc7bc5b397e6b597625adf136b4211f57dec9cffd6ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pubfin-0.7.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-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcd79f32dff95736fd9fec18661ef7823182b748d02f1f6d504d20a60c19716b
MD5 11efa0b26ac44be6486d1f4cc9676696
BLAKE2b-256 9b64507dc6fbafb89ac7895f84bda7e009b7174973468b17ded244c784e7771e

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