{ "info": { "author": "Daniel Gon\u00e7alves", "author_email": "daniel@base4.com.br", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Legal Industry", "License :: OSI Approved :: Apache Software License", "Natural Language :: Portuguese (Brazilian)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Office/Business :: Financial :: Point-Of-Sale", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "IBPT Web Services\n=================\n\n.. image:: https://img.shields.io/pypi/status/ibptws.svg\n :target: https://pypi.python.org/pypi/ibptws/\n :alt: Development status\n\n.. image:: https://img.shields.io/badge/python%20version-2.7%2C%203-blue.svg\n :target: https://pypi.python.org/pypi/ibptws/\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/l/ibptws.svg\n :target: https://pypi.python.org/pypi/ibptws/\n :alt: License\n\n.. image:: https://img.shields.io/pypi/v/ibptws.svg\n :target: https://pypi.python.org/pypi/ibptws/\n :alt: Latest version\n\n-------\n\n.. image:: https://drone.io/github.com/base4sistemas/ibptws/status.png\n :target: https://drone.io/github.com/base4sistemas/ibptws/latest\n :alt: Build status\n\nImplementa uma camada fina para acesso aos *web services* do `IBPT`_, para\nauxiliar no cumprimento \u00e0 `Lei 12.741/2012`_, popularmente conhecida como \"De\nOlho no Imposto\". O Instituto Brasileiro de Planejamento e Tributa\u00e7\u00e3o, IBPT,\ncalcula e fornece os valores aproximados dos tributos para produtos e servi\u00e7os\ncom base no c\u00f3digo `NCM`_ (Nomenclatura Comum do Mercosul, para produtos) e no\nc\u00f3digo `NBS`_ (Nomenclatura Brasileira de Servi\u00e7os).\n\nPara que o acesso aos *web services* seja poss\u00edvel, \u00e9 preciso cadastrar-se no\n`IBPT`_ para obter seu **token** de acesso.\n\n\nConfigura\u00e7\u00e3o e Consultas B\u00e1sicas\n--------------------------------\n\nExemplo b\u00e1sico de configura\u00e7\u00e3o e consulta de produto:\n\n.. sourcecode:: python\n\n >>> from ibptws import conf\n >>> from ibptws import get_produto\n\n >>> conf.token = 'ZyW9z...' # cadastre-se no IBPT para obter seu token\n >>> conf.cnpj = '08427847000169'\n >>> conf.estado = 'SP'\n\n >>> get_produto('02091021')\n Produto(codigo=u'2091021', uf=u'SP', ex=0, descricao=u'Gordura de porco,fresca,refrigerada ou congelada', nacional=4.2, estadual=12.0, importado=6.39)\n\nSimilarmente, para consultar um servi\u00e7o fa\u00e7a:\n\n.. sourcecode:: python\n\n >>> from ibptws import get_servico\n >>> get_servico('0101')\n Servico(codigo=u'101', uf=u'SP', descricao=u'An\\xe1lise e desenvolvimento de sistemas.', tipo=u'NBS', nacional=13.45, estadual=0.0, municipal=3.9, importado=15.45)\n\n\nCalculadora ``DeOlhoNoImposto``\n-------------------------------\n\nA calculadora **De Olho no Imposto** auxilia na computa\u00e7\u00e3o dos valores\naproximados dos tributos, tornando trivial a consulta por **n** produtos e/ou\nservicos e a obten\u00e7\u00e3o dos c\u00e1lculos parciais e totais dos tributos.\n\n.. sourcecode:: python\n\n >>> from decimal import Decimal\n >>> from ibptws.calculadoras import DeOlhoNoImposto\n \n >>> calc = DeOlhoNoImposto()\n >>> calc.produto('02091021', 0, Decimal('5.75'))\n >>> calc.servico('0101', Decimal('73.47'))\n\n >>> calc.carga_federal_nacional()\n Decimal('10.123215')\n\n >>> calc.carga_federal_importado()\n Decimal('11.718540')\n\n >>> calc.carga_estadual()\n Decimal('0.6900')\n\n >>> calc.carga_municipal()\n Decimal('2.86533')\n\n >>> calc.total_tributos()\n Decimal('25.397085')\n\n >>> calc.total()\n Decimal('79.22')\n\n >>> calc.percentual_sobre_total()\n Decimal('0.3205893082554910376167634436')\n\n\nProvisionamento de Dados\n------------------------\n\nA calculadora **De Olho no Imposto** recorre a um *proxy* para realizar as\nconsultas de produtos e servi\u00e7os, possibilitando que seja implementada uma\ncamada para provisionamento (*cache*) das consultas realizadas. Este projeto\ntraz uma implementa\u00e7\u00e3o de provisionamento baseada em `Redis`_:\n\n.. sourcecode:: python\n\n from ibptws.calculadoras import DeOlhoNoImposto\n from ibptws.provisoes import ProvisaoViaRedis\n \n calc = DeOlhoNoImposto(provisao=ProvisaoViaRedis(\n host='192.168.0.111', port=6379, db=0))\n \nNeste exemplo, as consultas a produtos e servi\u00e7os ser\u00e3o realizadas atrav\u00e9s\ndo *proxy* e, uma vez acessado o web services do IBPT, os dados ficar\u00e3o\nprovisionados at\u00e9 que expire (o padr\u00e3o \u00e9 expirar em 24h, mas voc\u00ea poder\u00e1 usar\nos seus pr\u00f3prios crit\u00e9rios).\n\n\nTestes\n------\n\nOs testes s\u00e3o baseados em `pytest`_ e n\u00e3o h\u00e1 acesso real aos servi\u00e7os do IBPT,\nportanto n\u00e3o h\u00e1 necessidade de configurar o token de acesso para executar os\ntestes unit\u00e1rios:\n\n.. sourcecode:: shell\n\n $ python setup.py test\n\n\nIsen\u00e7\u00e3o de Responsabilidade\n===========================\n\nOs autores deste projeto n\u00e3o tem qualquer rela\u00e7\u00e3o com o Instituto Brasileiro de\nPlanejamento e Tributa\u00e7\u00e3o (IBPT), e este, por sua vez, n\u00e3o avaliza o uso desta\nbiblioteca de c\u00f3digo. Utilize por sua conta e risco.\n\n\n.. _`IBPT`: https://deolhonoimposto.ibpt.org.br\n.. _`NCM`: http://www.mdic.gov.br//sitio/interna/interna.php?area=5&menu=1090\n.. _`NBS`: http://www.mdic.gov.br/sitio/interna/interna.php?area=4&menu=3412\n.. _`Lei 12.741/2012`: http://www.planalto.gov.br/ccivil_03/_ato2011-2014/2012/lei/l12741.htm\n.. _`pytest`: http://pytest.org/\n.. _`Redis`: http://redis.io/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/base4sistemas/ibptws/", "keywords": null, "license": "Apache Software License", "maintainer": null, "maintainer_email": null, "name": "ibptws", "package_url": "https://pypi.org/project/ibptws/", "platform": "any", "project_url": "https://pypi.org/project/ibptws/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/base4sistemas/ibptws/" }, "release_url": "https://pypi.org/project/ibptws/0.4/", "requires_dist": null, "requires_python": null, "summary": "Acesso aos web services do IBPT", "version": "0.4" }, "last_serial": 1869056, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d40e08a0ef987258c4c6934b129bd831", "sha256": "d30d0f3d906a28ce1f42439657d850a351dcb766db00581f2206256114c4402b" }, "downloads": -1, "filename": "ibptws-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d40e08a0ef987258c4c6934b129bd831", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 9760, "upload_time": "2015-09-15T21:13:34", "url": "https://files.pythonhosted.org/packages/56/72/60d9967d0528b91ac2b0cd66b29a4c585b1b6559c6d50fd08356d87c92b7/ibptws-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "deeb0c11cc01aec9b1368568306d8759", "sha256": "83eeb72fb77c6242b9b6f7e666ffe63084fd451fddd65a5e1af07882018c7eb8" }, "downloads": -1, "filename": "ibptws-0.1.tar.gz", "has_sig": false, "md5_digest": "deeb0c11cc01aec9b1368568306d8759", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5242, "upload_time": "2015-09-15T21:13:29", "url": "https://files.pythonhosted.org/packages/ce/5d/6482b6e36b89ce20cf91e46860f4c69659df1d3cd8c6c5c7f0d9d0f88006/ibptws-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "3cecd22c1bb7de3ffd6aec237fb1e0d9", "sha256": "e95d2c7905d7a0bff07b39c410729346211a024299abbb0d8d9f5bcd8d244842" }, "downloads": -1, "filename": "ibptws-0.2.tar.gz", "has_sig": false, "md5_digest": "3cecd22c1bb7de3ffd6aec237fb1e0d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5524, "upload_time": "2015-11-22T21:51:28", "url": "https://files.pythonhosted.org/packages/39/28/ef04b648e65998ad8259779ee75c6404f90b4b7eecd09386c5c5e2beb1de/ibptws-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "89a932ee05f0797df83f970029891765", "sha256": "4ea5f7166717775d3a9d45b2ff9edd84d27dbf9eda0fca487bd1c2a28279510d" }, "downloads": -1, "filename": "ibptws-0.3.tar.gz", "has_sig": false, "md5_digest": "89a932ee05f0797df83f970029891765", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11140, "upload_time": "2015-11-27T00:46:36", "url": "https://files.pythonhosted.org/packages/c1/b5/e959198565a8b97db65717270a9c93f91a6cbfdebd3de439f8a9154f3a6c/ibptws-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "e99419fb2c9b2613e46230582acca810", "sha256": "c29b336afb8fc690258c92bcf23f588f3533347cf4de9323e73fd445538ae249" }, "downloads": -1, "filename": "ibptws-0.4.tar.gz", "has_sig": false, "md5_digest": "e99419fb2c9b2613e46230582acca810", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13303, "upload_time": "2015-12-18T16:53:59", "url": "https://files.pythonhosted.org/packages/db/62/84c502d4ef125101508cd43307ca1d13e94e4bab556ea0c07cb206f31e71/ibptws-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e99419fb2c9b2613e46230582acca810", "sha256": "c29b336afb8fc690258c92bcf23f588f3533347cf4de9323e73fd445538ae249" }, "downloads": -1, "filename": "ibptws-0.4.tar.gz", "has_sig": false, "md5_digest": "e99419fb2c9b2613e46230582acca810", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13303, "upload_time": "2015-12-18T16:53:59", "url": "https://files.pythonhosted.org/packages/db/62/84c502d4ef125101508cd43307ca1d13e94e4bab556ea0c07cb206f31e71/ibptws-0.4.tar.gz" } ] }