{ "info": { "author": "Anti R\u00e4is", "author_email": "antirais@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "======\nestnin\n======\n\nPython library for working with Estonian national identity numbers.\n\nInstall\n=======\n\nUse ``pip`` to install::\n\n\tpip install estnin\n\nDocumentation\n=============\n\nFull documentation is at https://estnin.readthedocs.io/\n\nRunnig tests\n============\n::\n\n\tpython setup.py test\n\nUsage\n=====\n\nCreate a new ``estnin`` instance::\n\n\t>>> from estnin import estnin\n\t>>> person = estnin(37001011233)\n\t>>> print(person.sequence)\n\t>>> 123\n\t>>> print(estnin(estnin.MIN))\n\t>>> 10001010002\n\t>>> person = estnin.create(estnin.MALE, date(1970, 1, 1), 1)\n\t>>> print(person)\n\t>>> 37001010018\n\nstr()\n\"\"\"\"\"\n::\n\n\t>>> assert estnin(37001010018) == \"37001010018\"\n\nint()\n\"\"\"\"\"\n::\n\n\t>>> assert estnin(37001010018) == 37001010018\n\n<, ==, >\n\"\"\"\"\"\"\"\"\n::\n\n\t>>> assert estnin(37001011233) < estnin(estnin.MAX)\n\t>>> assert estnin(37001011233) > estnin(estnin.MIN)\n\t>>> assert estnin(37001011233) == estnin(37001011233)\n\nnegation\n\"\"\"\"\"\"\"\"\nNegation is defined as changing the sex from male to female or vice verca.\n\n::\n\n\t>>> assert -estnin(37001011233) == estnin(47001011234)\n\naddition and substraction\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nAdding an integer increments the sequence value by given amount. If the sum of the sequence and the number given is greater than 999, then the day is incremented and the remainder is set as the new sequence value. The day, month and year values are incremented in chronological order until the defined maximum value is reached. If the year crosses the century boundary, then the century digit is also properly set.\n\n::\n\n\t>>> assert estnin(37001011244) == estnin(37001011233)+1\n\t>>> assert estnin(37001011244) == estnin(37001011255)-1\n\t>>> # Create new person\n\t>>> person = estnin.create(estnin.MALE, date(1999, 12, 31), 999)\n\t>>> print(person)\n\t>>> 39912319997\n\t>>> assert estnin(50001010006) == person+1\n\niteration\n\"\"\"\"\"\"\"\"\"\nIterating over a given ``estnin`` instance creates new objects.\n\n::\n\n\t>>> people = [p for _, p in zip(range(3), estnin(37001011233))]\n\t>>> print(' '.join(map(str, people)))\n\t>>> 37001011233 37001011244 37001011255\n\nIterating in a reverse order can be done by using the method ``reversed()``::\n\n\t>>> people = [p for _, p in zip(range(3), reversed(estnin(37001011233)))]\n\t>>> print(' '.join(map(str, people)))\n\t>>> 37001011233 37001011222 37001011211\n\nproperties\n\"\"\"\"\"\"\"\"\"\"\n::\n\n\t>>> person = estnin.create(estnin.MALE, date(1970, 1, 2), 3)\n\t>>> person\n\t37001020036\n\t>>> person.century\n\t3\n\t>>> person.year\n\t1970\n\t>>> person.month\n\t1\n\t>>> person.day\n\t2\n\t>>> person.sequence\n\t3\n\t>>> person.checksum\n\t6\n\t>>> person.date\n\tdatetime.date(1970, 1, 2)\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/antirais/estnin", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "estnin", "package_url": "https://pypi.org/project/estnin/", "platform": "", "project_url": "https://pypi.org/project/estnin/", "project_urls": { "Homepage": "https://github.com/antirais/estnin" }, "release_url": "https://pypi.org/project/estnin/1.0.1/", "requires_dist": [ "coverage ; extra == 'test'", "pytest ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": "", "summary": "library for handling Estonian national identity numbers", "version": "1.0.1" }, "last_serial": 4744682, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "57b690bbd2ba1fc2c3d12a4c9ddf63be", "sha256": "2d728482014d5d786436e1162b977b93ad7db8606a9af3797f6729bce1af7a68" }, "downloads": -1, "filename": "estnin-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "57b690bbd2ba1fc2c3d12a4c9ddf63be", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6867, "upload_time": "2016-09-14T20:51:46", "url": "https://files.pythonhosted.org/packages/80/67/972d7e5095a482dc9e10a8e5b9f9e8c2304c038f75f69860b4ff9ad72ad4/estnin-1.0.0-py2.py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "677a7379437f260bf69053ad8c315d93", "sha256": "e9136519771adaf743b2dfa7b548d828cb33789a0e8276d37b2f86a49ad236d8" }, "downloads": -1, "filename": "estnin-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "677a7379437f260bf69053ad8c315d93", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5840, "upload_time": "2019-01-26T22:08:03", "url": "https://files.pythonhosted.org/packages/62/c7/7d7594cb3edc55fd5f22aec379e469cd02fab3cdd42cceb6ddc22af6d9fd/estnin-1.0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "677a7379437f260bf69053ad8c315d93", "sha256": "e9136519771adaf743b2dfa7b548d828cb33789a0e8276d37b2f86a49ad236d8" }, "downloads": -1, "filename": "estnin-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "677a7379437f260bf69053ad8c315d93", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5840, "upload_time": "2019-01-26T22:08:03", "url": "https://files.pythonhosted.org/packages/62/c7/7d7594cb3edc55fd5f22aec379e469cd02fab3cdd42cceb6ddc22af6d9fd/estnin-1.0.1-py3-none-any.whl" } ] }