financial-metrics 0.0.1
Financial Metrics Calculation Package
Requires Python: >=3.8

# Financial Metrics
**Financial Metrics Package provides a range of tools for calculating and analyzing various financial ratios from annual reports. This package includes modules for liquidity ratios, profitability ratios, efficiency ratios, market value ratios, leverage ratios, and cash flow ratios.**

## Installation

### Prerequisites

- Python 3.8 or higher
- `pip` 

### Steps

1. **Clone the repository**:

    ```bash
    git clone https://github.com/martinthetechie/financial-metrics
    ```

2. **Navigate to the project directory**:

    ```bash
    cd financial-metrics
    ```

3. **Install dependencies**:

    If using `pip`:

    ```bash
    pip install -r requirements.txt
    ```

    If using `poetry`:

    ```bash
    poetry install
    ```

### Usage

1. **Import the Functions**
    ```python
    from financial_metrics.liquidity_ratios import cash_ratio,current_ratio,quick_ratio
    from financial_metrics.profitability_ratios import gross_profit_margin, net_profit_margin, return_on_assets, return_on_equity
    from financial_metrics.efficiency_ratios import inventory_turnover, receivables_turnover, asset_turnover_ratio, accounts_payable_turnover, days_sales_outstanding
    from financial_metrics.market_value_ratios import price_to_book, price_to_earnings, price_to_earnings_growth, dividend_yield
    from financial_metrics.leverage_ratios import debt_ratio, debt_to_equity_ratio, interest_coverage_ratio
    from financial_metrics.cash_flow_ratios import free_cash_flow, operating_cash_flow_ratio
    ```
    
2. **Pass in Parameters**
   ```python
    from financial_metrics.liquidity_ratios import current_ratio

    # Example data
    current_assets = 500000
    current_liabilities = 300000
    
    # Calculate the Current Ratio
    current_ratio_value = current_ratio(current_assets, current_liabilities)
    print(f"Current Ratio: {current_ratio_value}")

    ```
3. **Calculativng Individual Ratios**
  - Liquidity Ratios
    ```python
    current_ratio_value = current_ratio(current_assets,current_liabilities)
    quick_ratio_value = quick_ratio(current_assets,current_liabilities,inventory)
    cash_ratio_value = cash_ratio(cash,cash_equivalents,current_liabilities)
    ```
    
  - Profitability Ratios
    ```python
    gross_profit_margin_value = gross_profit_margin(gross_profit, revenue)
    net_profit_margin_value = net_profit_margin(net_income, revenue)
    return_on_assets_value = return_on_assets(net_income, total_assets)
    return_on_equity_value = return_on_equity(net_income, equity)
    ```
  - Efficiency Ratios
    ```python
    inventory_turnover_ratio_value = inventory_turnover(cogs, average_inventory)
    receivables_turnover_ratio_value = receivables_turnover(net_credit_sales, average_accounts_receivable)
    asset_turnover_ratio_value = asset_turnover_ratio(net_sales, average_total_assets)
    accounts_payable_turnover_ratio_value = accounts_payable_turnover(cogs, average_accounts_payable)
    days_sales_outstanding_value = days_sales_outstanding(average_accounts_receivable, net_credit_sales)
    ```
  - Market Value Ratios
    ```python
    price_to_book_value = price_to_book(price_per_share, book_value_per_share)
    price_to_earnings_value = price_to_earnings(price_per_share, earnings_per_share)
    price_to_earnings_growth_value = price_to_earnings_growth(price_per_share, earnings_per_share, price_to_earnings_growth_rate)
    dividend_yield_value = dividend_yield(dividends_per_share, price_per_share)
    ```
  - Leverage Ratios
    ```python
    debt_ratio_value = debt_ratio(total_debt, total_assets)
    debt_to_equity_ratio_value = debt_to_equity_ratio(total_debt, total_equity)
    interest_coverage_ratio_value = interest_coverage_ratio(earnings_before_interest_and_tax, interest_expense)
    ```
  - Cash Flow Ratios
    ```python
    free_cash_flow_value = free_cash_flow(operating_cash_flow, capital_expenditures)
    operating_cash_flow_ratio_value = operating_cash_flow_ratio(net_cash_flow_from_operations, current_liabilities)
    ```



## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contact

- **Author**: Martin Tan
- **Email**: martinthetechie@gmail.com
- **GitHub**: https://github.com/martinthetechie