{ "info": { "author": "Ministry of Justice", "author_email": "dev@digital.justice.gov.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "bai2\n====\n\nPython module for parsing and writing `BAI2`_ files.\n\n**The library is not production ready at the moment** as we don't have enough data to test against, please help us improve it.\n\n\nRequirements\n------------\n\nOnly Python 2.7 and Python 3.3+ are supported.\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install bai2\n\n\nUsage\n-----\n\nTo use bai2 in a project\n\n.. code-block:: python\n\n >>> from bai2 import bai2\n\n >>> # parse from a file\n >>> with open() as f:\n >>> bai2_file = bai2.parse_from_file(f)\n\n >>> # parse from a string\n >>> bai2_file = bai2.parse_from_string()\n\n >>> # parse from lines\n >>> bai2_file = bai2.parse_from_lines()\n\n\nThe ``parse_from_*`` methods return a ``bai2.models.Bai2File`` object which can be used to inspect the parsed data.\n\nTo write a BAI2 file:\n\n.. code-block:: python\n\n >>> from bai2 import bai2\n >>> from bai2 import models\n\n >>> bai2_file = models.Bai2File()\n >>> bai2_file.header.sender_id = 'EGBANK'\n\n >>> bai2_file.children.append(models.Group())\n\n >>> transactions = [models.TransactionDetail(amount=100)]\n >>> bai2_file.children[0].children.append(models.Account(children=transactions))\n\n >>> # write to string\n >>> output = bai2.write(bai2_file)\n\n\nModels\n------\n\nModels structure::\n\n Bai2File\n Bai2FileHeader\n Group\n GroupHeader\n Account\n AccountIdentifier\n TransactionDetail\n AccountTrailer\n GroupTrailer\n Bai2FileTrailer\n\n\nSection models define a ``header``, a ``trailer`` and a list of ``children`` whilst single models define properties matching the bai2 fields.\n\nEach Model has a ``rows`` property with the original rows from the BAI2 file.\n\n\nExceptions\n----------\n\nThe ``parse`` method might raise 3 exceptions:\n\n1. ``ParsingException``: when the file contains an error and the library can't interpret the data\n2. ``NotSupportedYetException``: when the library doesn't support the feature yet\n3. ``IntegrityException``: when the control totals or the number of objects reported in the trailers don't match the ones in the file.\n\n\nIncongruences\n-------------\n\nWe've noticed that different banks implement the specs in slightly different ways and the parse method might therefore raise an ParsingException.\nIt is expected to work correctly with files produced by NatWest, RBS, and JP Morgan.\n\nWe don't know yet how to deal with these cases as we don't have access to many bai2 files so we can't test it as we would like.\n\nPlease let me know if this happens to you.\n\n\nDevelopment\n-----------\n\n.. image:: https://travis-ci.org/ministryofjustice/bai2.svg?branch=master\n :target: https://travis-ci.org/ministryofjustice/bai2\n\nPlease report bugs and open pull requests on `GitHub`_.\n\nUse ``python setup.py test`` or ``tox`` to run all tests.\n\nDistribute a new version to `PyPi`_ by updating the ``__version__`` string in ``bai2`` and run ``python setup.py sdist bdist_wheel upload``.\n\n\nCopyright\n---------\n\nCopyright (C) 2019 HM Government (Ministry of Justice Digital & Technology).\nSee LICENSE.txt for further details.\n\n.. _BAI2: http://www.bai.org/Libraries/Site-General-Downloads/Cash_Management_2005.sflb.ashx\n.. _GitHub: https://github.com/ministryofjustice/bai2\n.. _PyPi: https://pypi.org/project/bai2/\n\nHistory\n=======\n\n0.7.0 (2019-10-03)\n------------------\n\n* ``rows`` no longer required in BAI2 models (c.f. issue 12 and PR 13)\n\n0.6.0 (2019-09-18)\n------------------\n\n* Fix regular expression escaping\n* Add python 3.7 testing\n\n0.5.0 (2018-03-05)\n------------------\n\n* Updated packaging details and improved python version compatibility\n\n\n0.1.0 (2015-08-06)\n------------------\n\n* WIP", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ministryofjustice/bai2", "keywords": "bai2 bookkeeping cash management balance reporting", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bai2", "package_url": "https://pypi.org/project/bai2/", "platform": "", "project_url": "https://pypi.org/project/bai2/", "project_urls": { "Homepage": "https://github.com/ministryofjustice/bai2" }, "release_url": "https://pypi.org/project/bai2/0.7.0/", "requires_dist": null, "requires_python": "", "summary": "BAI2 Parser", "version": "0.7.0" }, "last_serial": 5924281, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "3275bd6b90e9f0c8d8cf06070a4f45a9", "sha256": "d492dabf96ec1096731d767f6767897d56aa84837ae66f2ca0ab5c12c5fd0203" }, "downloads": -1, "filename": "bai2-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3275bd6b90e9f0c8d8cf06070a4f45a9", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 21009, "upload_time": "2016-05-06T08:25:13", "url": "https://files.pythonhosted.org/packages/f0/b9/be698d44b7cbcedc0bb44bdaa3dfa03629381e49b5b116ab6f0b7fe80bf5/bai2-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8306a810ad4d9d8b42b10d0225a4477f", "sha256": "73bd7e23f1a523341ae687e1c93e438ecd007ca3d861a8aaf31385f28dc3714d" }, "downloads": -1, "filename": "bai2-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8306a810ad4d9d8b42b10d0225a4477f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33481, "upload_time": "2016-05-06T08:25:06", "url": "https://files.pythonhosted.org/packages/86/36/651c1ca7a8f3144e636bcca62e11e5b97e8b4685fbb699993c025e9060e2/bai2-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e300878a04f05beb3c0390b629085162", "sha256": "271ace092658987eddec94076502e43a66d43f4dba65a2aea4916f4f42c94dca" }, "downloads": -1, "filename": "bai2-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e300878a04f05beb3c0390b629085162", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 20994, "upload_time": "2016-05-06T09:30:17", "url": "https://files.pythonhosted.org/packages/c3/97/b15a6630b04300d155a78bb9cd972e1809e2a34dc71ce8279af52e84bad4/bai2-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2907f320149bbc1b3bf5e35684a21b68", "sha256": "2b3aed9398d03f94a9d7100002bac40a0118d20d9652e3e4cbbde0cfc7c237cb" }, "downloads": -1, "filename": "bai2-0.3.0.tar.gz", "has_sig": false, "md5_digest": "2907f320149bbc1b3bf5e35684a21b68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33534, "upload_time": "2016-05-06T09:29:58", "url": "https://files.pythonhosted.org/packages/ad/c1/61ca4f90d2164785285df7f85f774de9880f2a848123ba1d660c786f2da0/bai2-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "bb1911a82990e6713eeb941c813b0f0f", "sha256": "16160df204f37acc2f94031d21a664143def3c53c4f09c0429fd204b54e0fc3e" }, "downloads": -1, "filename": "bai2-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bb1911a82990e6713eeb941c813b0f0f", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 20986, "upload_time": "2016-08-09T12:07:07", "url": "https://files.pythonhosted.org/packages/d7/9b/603f15d139c4dd4dc352202bc243bce2110cbc737cac4fc86b68115ff911/bai2-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "429f54df2001ff34361bdc308e129a32", "sha256": "7bd691ad5350027e5f164580e3190ec0f17710e1e17f6d4e35bb1c65b6858764" }, "downloads": -1, "filename": "bai2-0.4.0.tar.gz", "has_sig": false, "md5_digest": "429f54df2001ff34361bdc308e129a32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33601, "upload_time": "2016-08-09T12:07:04", "url": "https://files.pythonhosted.org/packages/5e/a2/79adb9dd4b9d1c8af1f324af9577a9f479058f2d05603bbad6de554b083b/bai2-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "6739fadfe8c8ece93f7b00c0c9add6f4", "sha256": "c9750be6339b310ff7bf3bf86c752a027061b31aaddb651a0d15f764e99c14c1" }, "downloads": -1, "filename": "bai2-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6739fadfe8c8ece93f7b00c0c9add6f4", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 20999, "upload_time": "2016-09-06T09:32:33", "url": "https://files.pythonhosted.org/packages/fd/b1/0e30449af8c110acdc4de753587abc177ff937275bfdecaf85c8129a1d3f/bai2-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5d8385711c609e9bbce68bfb6782c3f", "sha256": "eace35f171f3a15df0fd0604dd01cbef9c3fe170680e03672506274f3bf89b05" }, "downloads": -1, "filename": "bai2-0.4.1.tar.gz", "has_sig": false, "md5_digest": "c5d8385711c609e9bbce68bfb6782c3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33636, "upload_time": "2016-09-06T09:32:30", "url": "https://files.pythonhosted.org/packages/29/f2/7de57f3f437590e862bf35207351a91f51a0b24fea0608c7739f54538d51/bai2-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "93adddfc38d35c51f0be6d97fc936629", "sha256": "6814c60a7564ffcb8a7e1522576c0299000024617762065ccf0110b03619b554" }, "downloads": -1, "filename": "bai2-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "93adddfc38d35c51f0be6d97fc936629", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 19745, "upload_time": "2018-03-05T15:33:04", "url": "https://files.pythonhosted.org/packages/4b/3a/d743693e93f8ab955c566a222c3d6276a11128bc3db2cc2e89fa2c10cdea/bai2-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6a3baf3ce0d59e2c12ecfef9dbe4b858", "sha256": "0420ae88b2af6b2c47aef5f797c732223cdc04043adc698b423b6a6ee952fc3d" }, "downloads": -1, "filename": "bai2-0.5.0.tar.gz", "has_sig": false, "md5_digest": "6a3baf3ce0d59e2c12ecfef9dbe4b858", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31930, "upload_time": "2018-03-05T15:33:00", "url": "https://files.pythonhosted.org/packages/98/1b/2482d7746aedaec641dacf977d1232cf6350f78769896576aea668c873d8/bai2-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "0d8cc515d88b70d3682dc4cf1769f960", "sha256": "9cea71318b7e66b86ba22b17f51ef7ae3bf4c8736449061164d7cae70aae3193" }, "downloads": -1, "filename": "bai2-0.6.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0d8cc515d88b70d3682dc4cf1769f960", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 18533, "upload_time": "2019-09-18T15:12:59", "url": "https://files.pythonhosted.org/packages/62/12/bd225faed0e0f3362e56a71ed4e749fe9f3ff1820c602eff2b0e283e9e49/bai2-0.6.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d78173ccc8e4344e3b277f4d5e5e780", "sha256": "66960a0660aa4544b6c59c1014e06af12489bae1be1fd5b31bf6e753e88bc14a" }, "downloads": -1, "filename": "bai2-0.6.0.tar.gz", "has_sig": false, "md5_digest": "6d78173ccc8e4344e3b277f4d5e5e780", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32091, "upload_time": "2019-09-18T15:12:56", "url": "https://files.pythonhosted.org/packages/73/0a/4ffa78b58bc135d51da09f297d979aebd1d232e7883a534c59cfb82ce9dc/bai2-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "69bbc943b631c04b50386e781cb2d11d", "sha256": "b04edebaf24cec56455e653a35dc6451a495f789456b124bb56eead50ca2bacc" }, "downloads": -1, "filename": "bai2-0.7.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69bbc943b631c04b50386e781cb2d11d", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 18578, "upload_time": "2019-10-03T16:28:16", "url": "https://files.pythonhosted.org/packages/70/3e/8f633588bd607f290a804e8859bc0db838a9584acc9202af8aab17932976/bai2-0.7.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "345c4e41266dfef172fab6b06d833a71", "sha256": "16c2b5551d5e69d60c5686287d530ed05a00baad46cb0d45ee9834127ebfb445" }, "downloads": -1, "filename": "bai2-0.7.0.tar.gz", "has_sig": false, "md5_digest": "345c4e41266dfef172fab6b06d833a71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32197, "upload_time": "2019-10-03T16:28:14", "url": "https://files.pythonhosted.org/packages/7d/99/2c1f32c9101f0d487a9bfc7b59552380d2957eb836a894e227cfc61f61ca/bai2-0.7.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "69bbc943b631c04b50386e781cb2d11d", "sha256": "b04edebaf24cec56455e653a35dc6451a495f789456b124bb56eead50ca2bacc" }, "downloads": -1, "filename": "bai2-0.7.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69bbc943b631c04b50386e781cb2d11d", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 18578, "upload_time": "2019-10-03T16:28:16", "url": "https://files.pythonhosted.org/packages/70/3e/8f633588bd607f290a804e8859bc0db838a9584acc9202af8aab17932976/bai2-0.7.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "345c4e41266dfef172fab6b06d833a71", "sha256": "16c2b5551d5e69d60c5686287d530ed05a00baad46cb0d45ee9834127ebfb445" }, "downloads": -1, "filename": "bai2-0.7.0.tar.gz", "has_sig": false, "md5_digest": "345c4e41266dfef172fab6b06d833a71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32197, "upload_time": "2019-10-03T16:28:14", "url": "https://files.pythonhosted.org/packages/7d/99/2c1f32c9101f0d487a9bfc7b59552380d2957eb836a894e227cfc61f61ca/bai2-0.7.0.tar.gz" } ] }