portfolio_toolkit.transaction package

Submodules

portfolio_toolkit.transaction.get_ticker module

portfolio_toolkit.transaction.get_ticker.get_transaction_ticker(transaction, portfolio_currency)[source]

Returns the ticker for a transaction. If the transaction does not have a ticker, it returns the synthetic cash ticker based on the portfolio currency.

Parameters:
  • transaction (dict) – The transaction to process.

  • portfolio_currency (str) – The currency of the portfolio.

Returns:

The ticker for the transaction.

Return type:

str

portfolio_toolkit.transaction.validate module

portfolio_toolkit.transaction.validate.validate_transaction(transaction)[source]

Validates that a transaction contains the required fields: date, type, and quantity.

Parameters:

transaction (dict) – The transaction to validate.

Raises:

ValueError – If the transaction does not contain the required fields.

Module contents