Ruby-based fundamental analysis for listed companies.
Project details
Fundamentalista simplifies financial analysis of listed companies using Ruby, transforming stock tickers into comprehensive financial statements, ratios, and valuations. Leveraging SEC EDGAR data and Financial Modeling Prep API, it offers seamless access to real-time financial insights, making it an essential tool for analysts and developers alike.
Fundamentalista is a Ruby gem designed for conducting detailed fundamental analysis of publicly listed companies. It consolidates data from multiple data sources into a single, convenient API, streamlining the process of accessing financial statements, ratios, and valuation metrics. Users can retrieve data from the SEC's EDGAR XBRL API, which is free and does not require an API key, alongside Financial Modeling Prep for access to live quotes and analyst estimates.
Retrieve company data:
company = Fundamentalista.company("AAPL")
year = company.financials.latest
year.income.revenue # => 0.416161e12
year.ratios.roe # => 0.1714e1
year.piotroski.score # => 8
The gem accommodates various ways of accessing company information, whether by ticker or CIK. For example:
apple = Fundamentalista.company("AAPL")
exxon = Fundamentalista.company(34088) # using CIK directly
Users can access and analyze financial trends easily with built-in methods:
financials = apple.financials(limit: 5) # Get the last 5 annual reports
financials.latest.growth(:revenue) # Calculate revenue growth
Fundamentalista is tailored to accommodate various sectors, including banks and insurers. Company-specific adjustments ensure relevant financial ratios are accurately calculated regardless of the industry specifics:
jpm = Fundamentalista.company("JPM").financials.latest
jpm.bank? # => true
Easily compare multiple companies side by side:
peers = Fundamentalista.compare("AAPL", "MSFT", "KO", prices: { "AAPL" => 320, "MSFT" => 500, "KO" => 70 })
peers.table(:roe, :net_margin, :pe, :piotroski, :altman_z)
Each financial figure obtained through Fundamentalista maintains traceability, allowing users to understand the source and derivation of data. This feature enhances the reliability of financial assessments made using the gem:
year.source(:revenue)
# => #<Fundamentalista::Source concept: "RevenueFromContractWithCustomerExcludingAssessedTax",
# form: "10-K", filed: 2025-10-31, derivation: :reported>
Fundamentalista empowers analysts, investors, and developers by providing a comprehensive toolkit for evaluating the financial health and valuation of companies using intuitive Ruby methods.
For more information, refer to the GitHub repository.
Comments
0Start the conversation
Share the first comment.