{ "info": { "author": "Johannes Harms", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Office/Business :: Financial :: Accounting", "Topic :: Office/Business :: Financial :: Investment" ], "description": "smart_importer\n==============\n\nAugment\n`Beancount `__ importers\nwith machine learning functionality.\n\n\nStatus\n------\n\nWorking protoype, development status: alpha\n\n.. image:: https://travis-ci.org/beancount/smart_importer.svg?branch=master\n :target: https://travis-ci.org/beancount/smart_importer\n\n\nInstallation\n------------\n\nThe ``smart_importer`` package has not yet been published on PyPI\nand must therefore be installed from source:\n\n.. code:: bash\n\n git clone https://github.com/beancount/smart_importer.git\n pip install --editable smart_importer\n\n\nQuick Start\n-----------\n\nThis package provides import hooks that can modify the imported entries. When\nrunning the importer, the existing entries will be used as training data for a\nmachine learning model, which will then predict entry attributes.\n\nThe following example shows how to apply the ``PredictPostings`` hook to\nan existing CSV importer:\n\n.. code:: python\n\n from beancount.ingest.importers import csv\n from beancount.ingest.importers.csv import Col\n\n from smart_importer import apply_hooks, PredictPostings\n\n\n class MyBankImporter(csv.Importer):\n '''Conventional importer for MyBank'''\n\n def __init__(self, *, account):\n super().__init__(\n {Col.DATE: 'Date',\n Col.PAYEE: 'Transaction Details',\n Col.AMOUNT_DEBIT: 'Funds Out',\n Col.AMOUNT_CREDIT: 'Funds In'},\n account,\n 'EUR',\n [\n 'Filename: .*MyBank.*\\.csv',\n 'Contents:\\n.*Date, Transaction Details, Funds Out, Funds In'\n ]\n )\n\n\n CONFIG = [\n apply_hooks(MyBankImporter(account='Assets:MyBank:MyAccount'), [PredictPostings()])\n ]\n\n\nDocumentation\n-------------\n\nThis section explains in detail the relevant concepts and artifacts\nneeded for enhancing Beancount importers with machine learning.\n\n\nBeancount Importers\n~~~~~~~~~~~~~~~~~~~~\n\nLet's assume you have created an importer for \"MyBank\" called\n``MyBankImporter``:\n\n.. code:: python\n\n class MyBankImporter(importer.ImporterProtocol):\n \"\"\"My existing importer\"\"\"\n # the actual importer logic would be here...\n\nNote:\nThis documentation assumes you already know how to create Beancount importers.\nRelevant documentation can be found under `beancount ingest\n`__. Using beancount.ingest, users can\nwrite their own importers and use them to convert downloaded bank statements\ninto lists of Beancount entries.\nAn example is provided as part of beancount's source code under\n`beancount/ingest/office\n`__.\n\n\nApplying `smart_importer` hooks\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAny Beancount importer can be converted into a smart importer by applying one\nof the following hooks:\n\n* ``PredictPostings`` - predict the list of postings.\n* ``PredictPayees``- predict the payee of the transaction.\n* ``DuplicateDetector`` - detect duplicates\n\nFor example, to convert an existing ``MyBankImporter`` into a smart importer:\n\n.. code:: python\n\n from your_custom_importer import MyBankImporter\n from smart_importer import apply_hooks, PredictPayees, PredictPostings\n\n my_bank_importer = MyBankImporter('whatever', 'config', 'is', 'needed')\n apply_hooks(my_bank_importer, [PredictPostings(), PredictPayees()])\n\n CONFIG = [\n my_bank_importer,\n ]\n\nNote that the importer hooks need to be applied to an importer instance, as\nshown above.\n\n\nSpecifying Training Data\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe ``smart_importer`` hooks need training data, i.e. an existing list of\ntransactions in order to be effective. Training data can be specified by\ncalling bean-extract with an argument that references existing Beancount\ntransactions, e.g., ``bean-extract -f existing_transactions.beancount``. When\nusing the importer in Fava, the existing entries are used as training data\nautomatically.\n\n\nUsage with Fava\n~~~~~~~~~~~~~~~\n\nSmart importers play nice with `Fava `__.\nThis means you can use smart importers together with Fava in the exact same way\nas you would do with a conventional importer. See `Fava's help on importers\n`__ for more\ninformation.\n\n\nDevelopment\n-----------\n\nPull requests welcome!\n\n\nExecuting the Unit Tests\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nSimply run (requires tox):\n\n.. code:: bash\n\n make test\n\n\nConfiguring Logging\n~~~~~~~~~~~~~~~~~~~\n\nPython's `logging` module is used by the smart_importer module.\nThe according log level can be changed as follows:\n\n\n.. code:: python\n\n import logging\n logging.getLogger('smart_importer').setLevel(logging.DEBUG)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/beancount/smart_importer", "keywords": "fava beancount accounting machinelearning", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "smart-importer", "package_url": "https://pypi.org/project/smart-importer/", "platform": "", "project_url": "https://pypi.org/project/smart-importer/", "project_urls": { "Homepage": "https://github.com/beancount/smart_importer" }, "release_url": "https://pypi.org/project/smart-importer/0.1/", "requires_dist": [ "beancount (>=2.0.0)", "scikit-learn (>=0.19)", "numpy (>=1.8.2)", "scipy (>=0.13.3)" ], "requires_python": "", "summary": "Augment Beancount importers with machine learning functionality.", "version": "0.1" }, "last_serial": 4633046, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ea95d04c7f6547f0d09d28f4a269ae66", "sha256": "71d649197101ab54fcb7c0a1ac3e51fc66cdbdd46a6ff542c9c1c83d725cf24c" }, "downloads": -1, "filename": "smart_importer-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ea95d04c7f6547f0d09d28f4a269ae66", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10051, "upload_time": "2018-12-25T08:50:07", "url": "https://files.pythonhosted.org/packages/7d/f2/122dbbf45026124ac6e319fe7bc1b41338bf10b3bb95170e2a84b73466aa/smart_importer-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5615c1b0a996247027ddda106b7da3f6", "sha256": "10b65e3d50dcc6ef9a1dd4f78d2b1e5770ed5f92c233a42f80f7acc567b87129" }, "downloads": -1, "filename": "smart_importer-0.1.tar.gz", "has_sig": false, "md5_digest": "5615c1b0a996247027ddda106b7da3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41615, "upload_time": "2018-12-25T08:50:09", "url": "https://files.pythonhosted.org/packages/2d/77/0d73a4cca9f4a08d91c1a44669964f6c3bc8a9763a8f6051072e63da6794/smart_importer-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ea95d04c7f6547f0d09d28f4a269ae66", "sha256": "71d649197101ab54fcb7c0a1ac3e51fc66cdbdd46a6ff542c9c1c83d725cf24c" }, "downloads": -1, "filename": "smart_importer-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ea95d04c7f6547f0d09d28f4a269ae66", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10051, "upload_time": "2018-12-25T08:50:07", "url": "https://files.pythonhosted.org/packages/7d/f2/122dbbf45026124ac6e319fe7bc1b41338bf10b3bb95170e2a84b73466aa/smart_importer-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5615c1b0a996247027ddda106b7da3f6", "sha256": "10b65e3d50dcc6ef9a1dd4f78d2b1e5770ed5f92c233a42f80f7acc567b87129" }, "downloads": -1, "filename": "smart_importer-0.1.tar.gz", "has_sig": false, "md5_digest": "5615c1b0a996247027ddda106b7da3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41615, "upload_time": "2018-12-25T08:50:09", "url": "https://files.pythonhosted.org/packages/2d/77/0d73a4cca9f4a08d91c1a44669964f6c3bc8a9763a8f6051072e63da6794/smart_importer-0.1.tar.gz" } ] }