quiffen


Namequiffen JSON
Version 2.0.10 PyPI version JSON
download
home_pagehttps://github.com/isaacharrisholt/quiffen
SummaryQuiffen
upload_time2023-11-12 12:31:19
maintainer
docs_urlNone
authorIsaac Harris-Holt
requires_python>=3.8,<4.0
licenseGPL-3.0-or-later
keywords qif finance data processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Quiffen
========

.. content

Quiffen is a Python package for parsing QIF (Quicken Interchange Format) files.

The package allows users to both read QIF files and interact with the contents, and also to create a QIF structure
and then output to either a QIF file, a CSV of transaction data or a pandas DataFrame.

QIF is an old file type, but has its merits because:

- It's standardised (apart from dates, but that can be dealt with)

  - Unlike CSVs, QIF files all follow the same format, so they don't require special attention when they come from
    different sources

- It's written in plain text

Features
--------

- Import QIF files and manipulate data
- Create QIF structures (support for Transactions, Investments, Accounts, Categories, Classes, Splits)
- Convert Qif objects to a number of different formats and export (pandas DataFrame, CSV, QIF file)

Usage
------

Here's an example parsing of a QIF file:

>>> from quiffen import Qif, QifDataType
>>> import decimal
>>> qif = Qif.parse('test.qif', day_first=False)
>>> qif.accounts
{'Quiffen Default Account': Account(name='Quiffen Default Account', desc='The default account created by Quiffen when no
other accounts were present')}
>>> acc = qif.accounts['Quiffen Default Account']
>>> acc.transactions
{'Bank': TransactionList(Transaction(date=datetime.datetime(2021, 2, 14, 0 , 0), amount=decimal.Decimal(150.0), ...), ...),
'Invst': TransactionList(...)}
>>> tr = acc.transactions['Bank'][0]
>>> print(tr)
Transaction:
    Date: 2020-02-14 00:00:00
    Amount: 67.5
    Payee: T-Mobile
    Category: Cell Phone
    Split Categories: ['Bills']
    Splits: 2 total split(s)
>>> qif.categories
{'Bills': Category(name='Bills), expense=True, hierarchy='Bills'}
>>> bills = qif.categories['Bills']
>>> print(bills.render_tree())
Bills (root)
└─ Cell Phone
>>> 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
1 2020-02-14    32.0  US Post Office  ...  money back for damaged parcel     NaN          NaN
2 2020-12-02   -10.0          Target  ...        two transactions, equal     NaN          NaN
3 2020-11-02   -25.0         Walmart  ...          non split transaction       X        123.0
4 2020-10-02  -100.0      Amazon.com  ...                   test order 1       *          NaN
...

And here's an example of creating a QIF structure and exporting to a QIF file:

>>> import quiffen
>>> from datetime import datetime
>>> qif = quiffen.Qif()
>>> acc = quiffen.Account(name='Personal Bank Account', desc='My personal bank account with Barclays.')
>>> qif.add_account(acc)
>>> groceries = quiffen.Category(name='Groceries')
>>> essentials = quiffen.Category(name='Essentials')
>>> groceries.add_child(essentials)
>>> qif.add_category(groceries)
>>> tr = quiffen.Transaction(date=datetime.now(), amount=150.0)
>>> 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'

Documentation
-------------

Documentation can be found at: https://quiffen.readthedocs.io/en/latest/

Installation
------------

Install Quiffen by running:

>>> pip install quiffen

Dependencies
------------

- `pandas <https://pypi.org/project/pandas/>`_ (optional) for exporting to DataFrames

  - The ``to_dataframe()`` method will not work without pandas installed.

To-Dos
------

- Add support for the ``MemorizedTransaction`` object present in QIF files.

Contribute
----------

GitHub pull requests welcome, though if you want to make a major change, please open an issue first for discussion.

- Issue Tracker: https://github.com/isaacharrisholt/quiffen/issues
- Source Code: https://github.com/isaacharrisholt/quiffen

Support
-------

If you are having issues, please let me know.

License
-------

The project is licensed under the GNU GPLv3 license.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/isaacharrisholt/quiffen",
    "name": "quiffen",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "qif,finance,data processing",
    "author": "Isaac Harris-Holt",
    "author_email": "isaac@harris-holt.com",
    "download_url": "https://files.pythonhosted.org/packages/8a/dc/7f0d460baddd0c1a2c7aaf4475b5ee604e2eab212bcf2eeef1e9ff2dc922/quiffen-2.0.10.tar.gz",
    "platform": null,
    "description": "Quiffen\n========\n\n.. content\n\nQuiffen is a Python package for parsing QIF (Quicken Interchange Format) files.\n\nThe package allows users to both read QIF files and interact with the contents, and also to create a QIF structure\nand then output to either a QIF file, a CSV of transaction data or a pandas DataFrame.\n\nQIF is an old file type, but has its merits because:\n\n- It's standardised (apart from dates, but that can be dealt with)\n\n  - Unlike CSVs, QIF files all follow the same format, so they don't require special attention when they come from\n    different sources\n\n- It's written in plain text\n\nFeatures\n--------\n\n- Import QIF files and manipulate data\n- Create QIF structures (support for Transactions, Investments, Accounts, Categories, Classes, Splits)\n- Convert Qif objects to a number of different formats and export (pandas DataFrame, CSV, QIF file)\n\nUsage\n------\n\nHere's an example parsing of a QIF file:\n\n>>> from quiffen import Qif, QifDataType\n>>> import decimal\n>>> qif = Qif.parse('test.qif', day_first=False)\n>>> qif.accounts\n{'Quiffen Default Account': Account(name='Quiffen Default Account', desc='The default account created by Quiffen when no\nother accounts were present')}\n>>> acc = qif.accounts['Quiffen Default Account']\n>>> acc.transactions\n{'Bank': TransactionList(Transaction(date=datetime.datetime(2021, 2, 14, 0 , 0), amount=decimal.Decimal(150.0), ...), ...),\n'Invst': TransactionList(...)}\n>>> tr = acc.transactions['Bank'][0]\n>>> print(tr)\nTransaction:\n    Date: 2020-02-14 00:00:00\n    Amount: 67.5\n    Payee: T-Mobile\n    Category: Cell Phone\n    Split Categories: ['Bills']\n    Splits: 2 total split(s)\n>>> qif.categories\n{'Bills': Category(name='Bills), expense=True, hierarchy='Bills'}\n>>> bills = qif.categories['Bills']\n>>> print(bills.render_tree())\nBills (root)\n\u2514\u2500 Cell Phone\n>>> df = qif.to_dataframe(data_type=QifDataType.TRANSACTIONS)\n>>> df.head()\n        date  amount           payee  ...                           memo cleared check_number\n0 2020-02-14    67.5        T-Mobile  ...                            NaN     NaN          NaN\n1 2020-02-14    32.0  US Post Office  ...  money back for damaged parcel     NaN          NaN\n2 2020-12-02   -10.0          Target  ...        two transactions, equal     NaN          NaN\n3 2020-11-02   -25.0         Walmart  ...          non split transaction       X        123.0\n4 2020-10-02  -100.0      Amazon.com  ...                   test order 1       *          NaN\n...\n\nAnd here's an example of creating a QIF structure and exporting to a QIF file:\n\n>>> import quiffen\n>>> from datetime import datetime\n>>> qif = quiffen.Qif()\n>>> acc = quiffen.Account(name='Personal Bank Account', desc='My personal bank account with Barclays.')\n>>> qif.add_account(acc)\n>>> groceries = quiffen.Category(name='Groceries')\n>>> essentials = quiffen.Category(name='Essentials')\n>>> groceries.add_child(essentials)\n>>> qif.add_category(groceries)\n>>> tr = quiffen.Transaction(date=datetime.now(), amount=150.0)\n>>> acc.add_transaction(tr, header=quiffen.AccountType.BANK)\n>>> qif.to_qif()  # If a path is provided, this will save the file too!\n'!Type:Cat\\nNGroceries\\nETrue\\nIFalse\\n^\\nNGroceries:Essentials\\nETrue\\nIFalse\\n^\\n!Account\\nNPersonal Bank Account\\nDMy\npersonal bank account with Barclays.\\n^\\n!Type:Bank\\nD02/07/2021\\nT150.0\\n^\\n'\n\nDocumentation\n-------------\n\nDocumentation can be found at: https://quiffen.readthedocs.io/en/latest/\n\nInstallation\n------------\n\nInstall Quiffen by running:\n\n>>> pip install quiffen\n\nDependencies\n------------\n\n- `pandas <https://pypi.org/project/pandas/>`_ (optional) for exporting to DataFrames\n\n  - The ``to_dataframe()`` method will not work without pandas installed.\n\nTo-Dos\n------\n\n- Add support for the ``MemorizedTransaction`` object present in QIF files.\n\nContribute\n----------\n\nGitHub pull requests welcome, though if you want to make a major change, please open an issue first for discussion.\n\n- Issue Tracker: https://github.com/isaacharrisholt/quiffen/issues\n- Source Code: https://github.com/isaacharrisholt/quiffen\n\nSupport\n-------\n\nIf you are having issues, please let me know.\n\nLicense\n-------\n\nThe project is licensed under the GNU GPLv3 license.\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Quiffen",
    "version": "2.0.10",
    "project_urls": {
        "Documentation": "https://quiffen.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/isaacharrisholt/quiffen",
        "Repository": "https://github.com/isaacharrisholt/quiffen"
    },
    "split_keywords": [
        "qif",
        "finance",
        "data processing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de0be8815858b59b341c01d1023eda85605e0e66cc80247df2059015f9c6fd9e",
                "md5": "ac39559bb9b2077df37d9b60908f4bb9",
                "sha256": "a1ef6b4c83f422c69f911ca32940858ee1c39a7776755b571cb5d4447d7b5769"
            },
            "downloads": -1,
            "filename": "quiffen-2.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ac39559bb9b2077df37d9b60908f4bb9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 30706,
            "upload_time": "2023-11-12T12:31:17",
            "upload_time_iso_8601": "2023-11-12T12:31:17.472947Z",
            "url": "https://files.pythonhosted.org/packages/de/0b/e8815858b59b341c01d1023eda85605e0e66cc80247df2059015f9c6fd9e/quiffen-2.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8adc7f0d460baddd0c1a2c7aaf4475b5ee604e2eab212bcf2eeef1e9ff2dc922",
                "md5": "6107b2a54d79e61a96e1ebb01bf1f3f6",
                "sha256": "c457fdc4cd083d9371b8fd98d1ea549fae6c1cf2d6b0aca0026c90ae2d94cfbd"
            },
            "downloads": -1,
            "filename": "quiffen-2.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "6107b2a54d79e61a96e1ebb01bf1f3f6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 24241,
            "upload_time": "2023-11-12T12:31:19",
            "upload_time_iso_8601": "2023-11-12T12:31:19.363779Z",
            "url": "https://files.pythonhosted.org/packages/8a/dc/7f0d460baddd0c1a2c7aaf4475b5ee604e2eab212bcf2eeef1e9ff2dc922/quiffen-2.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-12 12:31:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "isaacharrisholt",
    "github_project": "quiffen",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "quiffen"
}
        
Elapsed time: 0.14540s