diff --git a/README.rst b/README.rst index bd78db6..266821f 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ Usage Here's an example parsing of a QIF file: ->>> from quiffen import Qif +>>> from quiffen import Qif, QifDataType >>> import decimal >>> qif = Qif.parse('test.qif', day_first=False) >>> qif.accounts @@ -54,7 +54,7 @@ Transaction: >>> print(bills.render_tree()) Bills (root) └─ Cell Phone ->>> df = qif.to_dataframe(data='transactions') +>>> df = qif.to_dataframe(data_type=QifDataType.TRANSACTIONS) >>> df.head() date amount payee ... memo cleared check_number 0 2020-02-14 67.5 T-Mobile ... NaN NaN NaN @@ -76,7 +76,7 @@ And here's an example of creating a QIF structure and exporting to a QIF file: >>> groceries.add_child(essentials) >>> qif.add_category(groceries) >>> tr = quiffen.Transaction(date=datetime.now(), amount=150.0) ->>> acc.add_transaction(tr, header='Bank') +>>> acc.add_transaction(tr, header=quiffen.AccountType.BANK) >>> qif.to_qif() # If a path is provided, this will save the file too! '!Type:Cat\nNGroceries\nETrue\nIFalse\n^\nNGroceries:Essentials\nETrue\nIFalse\n^\n!Account\nNPersonal Bank Account\nDMy personal bank account with Barclays.\n^\n!Type:Bank\nD02/07/2021\nT150.0\n^\n' diff --git a/quiffen/core/qif.py b/quiffen/core/qif.py index 394c2c2..85f81d1 100644 --- a/quiffen/core/qif.py +++ b/quiffen/core/qif.py @@ -511,7 +511,6 @@ def to_csv( def to_dataframe( self, data_type: QifDataType = QifDataType.TRANSACTIONS, - # date_format: str = '%Y-%m-%d', ignore: List[str] = None, ) -> pd.DataFrame: """Convert part of the Qif object to a Pandas DataFrame. The @@ -524,9 +523,6 @@ def to_dataframe( data_type : QifDataType, optional The type of data to convert to a DataFrame, by default QifDataType.TRANSACTIONS - date_format : str, optional - The date format to use when converting dates to strings, by - default '%Y-%m-%d' ignore : List[str], optional A list of fields to ignore when converting to a DataFrame, by default None