|
PyHodl
0.2.7
Framework to download, update, analyze and plot your crypto-transactions. Completely off-line and security-oriented.
|
Public Member Functions | |
| def | __init__ (self, base_currency) |
| def | is_crypto (self) |
| def | add_transaction (self, transaction) |
| def | dates (self) |
| def | balance (self, currency=None, now=False) |
| def | convert_to (self, date_time, currency, amount=1.0) |
| def | get_price_on (self, dates, currency) |
| def | get_delta_by_transaction (self) |
| def | get_data_by_date (self, data, dates, currency=None) |
| def | get_balance_by_transaction (self) |
| def | get_balance_array_by_date (self, dates, currency=None) |
| def | fill_missing_transactions (self, data, dates, currency=None) |
Static Public Member Functions | |
| def | fill_missing_data (data, dates, all_dates) |
Public Attributes | |
| base_currency | |
| transactions | |
| is_sorted | |
A general wallet, tracking addition, deletions and fees
| def pyhodl.core.wallets.Wallet.__init__ | ( | self, | |
| base_currency | |||
| ) |
| def pyhodl.core.wallets.Wallet.add_transaction | ( | self, | |
| transaction | |||
| ) |
:param transaction: Transaction
Transaction
:return: void
Adds amount to balance
| def pyhodl.core.wallets.Wallet.balance | ( | self, | |
currency = None, |
|||
now = False |
|||
| ) |
:return: float
Balance up to date with last transaction
| def pyhodl.core.wallets.Wallet.convert_to | ( | self, | |
| date_time, | |||
| currency, | |||
amount = 1.0 |
|||
| ) |
:param date_time: datetime
Date and time of conversion
:param currency: str
Currency to convert to
:param amount: float
Amount to convert
:return: float
Amount of wallet base currency converted to currency
| def pyhodl.core.wallets.Wallet.dates | ( | self | ) |
:return: [] of datetime
List of all dates
|
static |
:param data: [] of summable (e.g float)
Data to be filled
:param dates: [] of datetime
Dates of data
:param all_dates: [] of datetime
Full dates
:return: [] of {}
Fill missing data: when date not in original data, we create a
new data point with value the last value
| def pyhodl.core.wallets.Wallet.fill_missing_transactions | ( | self, | |
| data, | |||
| dates, | |||
currency = None |
|||
| ) |
:param data: [] of {}
List of transactions
:param dates: [] of datetime
All dates
:param currency: str or None
Currency to convert balances to
:return: [] of {}
Fill missing data: when date not in original data, we create a
new data point with value the last value
| def pyhodl.core.wallets.Wallet.get_balance_array_by_date | ( | self, | |
| dates, | |||
currency = None |
|||
| ) |
:param dates: [] of datetime
List of dates
:param currency: str or None
Currency to convert balances to
:return: numpy array
Balance value by date
| def pyhodl.core.wallets.Wallet.get_balance_by_transaction | ( | self | ) |
:return: [] of {}
List of balance by transaction
| def pyhodl.core.wallets.Wallet.get_data_by_date | ( | self, | |
| data, | |||
| dates, | |||
currency = None |
|||
| ) |
:param data: str
Data to get. Must be in ["delta", "balance"]
:param dates: [] of datetime
List of dates
:param currency: str or None
Currency to convert deltas to
:return: [] of {}
List of delta amount by date
| def pyhodl.core.wallets.Wallet.get_delta_by_transaction | ( | self | ) |
:return: [] of {}
List of delta balance by transaction
| def pyhodl.core.wallets.Wallet.get_price_on | ( | self, | |
| dates, | |||
| currency | |||
| ) |
:param dates: [] of datetime
List of dates
:param currency: str
Currency to get price
:return: [] of float
List of price if coin converted to currency on those dates
| def pyhodl.core.wallets.Wallet.is_crypto | ( | self | ) |
:return: bool
True iff wallet base currency is crypto currency
| pyhodl.core.wallets.Wallet.base_currency |
| pyhodl.core.wallets.Wallet.is_sorted |
| pyhodl.core.wallets.Wallet.transactions |