Skip to main content

A Python library for financial calculations and formulas of TVM, and asset valuation.

Project description

pynance

pynance is a Python library that provides a collection of financial formulas and calculations for quants, traders, analysts, and students. It offers functions for time value of money, bond pricing, stock valuation, option pricing, risk metrics, and more.

Features

  • Time Value of Money (TVM) Functions: Present Value, Future Value, Net Present Value (NPV), Internal Rate of Return (IRR).
  • Bond Pricing and Yield Calculations: Bond Price, Yield to Maturity (YTM).
  • Stock Valuation: Dividend Discount Model (DDM).
  • Option Pricing: Black-Scholes Model for option pricing.
  • Risk and Performance Metrics: Sharpe Ratio, Value at Risk (VaR).

Installation

You can install pynance via pip:

pip install pynance

Functions Available

  • Time Value of Money:

    present_value(future_value, rate, periods)
    
    future_value(present_value, rate, periods)
    
    npv(rate, cash_flows)
    
    internal_rate_of_return(cash_flows)
    
  • Bond Pricing and Yield Calculations:

    bond_price(face_value, coupon_rate, periods, discount_rate)
    
    yield_to_maturity(face_value, coupon_rate, periods, price)
    
  • Stock Valuation:

    dividend_discount_model(dividend, growth_rate, discount_rate)
    
  • Option Pricing:

    black_scholes_call(S, K, T, r, sigma)
    
  • Risk and Performance Metrics:

    sharpe_ratio(returns, risk_free_rate)
    
    value_at_risk(returns, confidence_level)
    

Contributing

Contributions are welcome! Please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

Fork the repository.

  • Create a new branch (git checkout -b feature-branch).
  • Make your changes.
  • Commit your changes (git commit -am 'Add new feature').
  • Push to the branch (git push origin feature-branch).
  • Create a new Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any questions or issues, please contact reddygari.rithvik@gmail.com

Acknowledgments

This library was inspired by my interest in finance and my coursework! Thanks to all who help in maintaining and adding new features!

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

pynance-tools-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynance_tools-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pynance-tools-0.1.0.tar.gz.

File metadata

  • Download URL: pynance-tools-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pynance-tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 62f97ac97f6f04ab940b387a306b61acdcca2b8711219f123e574fa7c9ebcefe
MD5 a661490bb84f1429a603527e60f65c80
BLAKE2b-256 dad2f6efb2463c47bcc7f0b27d3abe4cb54c0179db386399289c93a666db811f

See more details on using hashes here.

File details

Details for the file pynance_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pynance_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pynance_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03bbf02630cf23664927b534e2ec040cc7e6c97e70226427fbc1f18065897204
MD5 fdd5fe22899e70a2e6644fa7a011b3bc
BLAKE2b-256 c31e1404e9420e1cb1ba1137839b39f4fec8c2091b46cfbd3390a37bd9aca729

See more details on using hashes here.

Supported by

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