emitare 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
emitare-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: emitare
3
+ Version: 1.0.0
4
+ Summary: SDK Python para a API NFS-e Emitare — emita notas fiscais de serviço em todos os municípios do Brasil
5
+ Home-page: https://emitare.com.br/docs
6
+ Author: Emitare
7
+ Author-email: dev@emitare.com.br
8
+ Project-URL: Documentação, https://emitare.com.br/docs
9
+ Project-URL: Repositório, https://github.com/krgitti/emitare-nfs-api
10
+ Project-URL: Rastreador de bugs, https://github.com/krgitti/emitare-nfs-api/issues
11
+ Keywords: nfse nota-fiscal-servico api-nfse brasil prefeitura erp fiscal
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Office/Business :: Financial
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: project-url
33
+ Dynamic: requires-python
34
+ Dynamic: summary
35
+
36
+ # Emitare SDK para Python
37
+
38
+ SDK oficial Python para a [API NFS-e Emitare](https://emitare.com.br) — emita Notas Fiscais de Serviço Eletrônicas em todos os 5.570 municípios do Brasil.
39
+
40
+ ## Instalação
41
+
42
+ ```bash
43
+ pip install emitare
44
+ ```
45
+
46
+ ## Uso rápido
47
+
48
+ ```python
49
+ from emitare import Emitare
50
+
51
+ client = Emitare("sua-api-key")
52
+
53
+ # Emitir NFS-e
54
+ nfse = client.nfse.emitir(
55
+ empresa_id="uuid-da-empresa",
56
+ tomador={
57
+ "cpfCnpj": "12345678000195",
58
+ "razaoSocial": "Empresa Tomadora Ltda",
59
+ "email": "financeiro@tomadora.com.br"
60
+ },
61
+ servico={
62
+ "codigoMunicipio": 3550308, # São Paulo
63
+ "descricao": "Desenvolvimento de software",
64
+ "valorTotal": 1500.00,
65
+ "aliquotaIss": 2.0
66
+ }
67
+ )
68
+
69
+ print(f"NFS-e emitida: {nfse['numero']}")
70
+ ```
71
+
72
+ ## Funcionalidades
73
+
74
+ - ✅ Emissão de NFS-e em 5.570 municípios brasileiros
75
+ - ✅ Suporte a 10 provedores (GINFES, ISSNet, SIGISS, Betha, IPM, SimplISS, DSF, eGoverne, PRODAM, Padrão Nacional 2026)
76
+ - ✅ Padrão Nacional 2026 (LC 214/2025 — IBS/CBS)
77
+ - ✅ Consulta e cancelamento de NFS-e
78
+ - ✅ Emissão em lote
79
+ - ✅ Webhooks em tempo real
80
+
81
+ ## Documentação
82
+
83
+ Documentação completa em [emitare.com.br/docs](https://emitare.com.br/docs)
84
+
85
+ ## Licença
86
+
87
+ MIT
@@ -0,0 +1,52 @@
1
+ # Emitare SDK para Python
2
+
3
+ SDK oficial Python para a [API NFS-e Emitare](https://emitare.com.br) — emita Notas Fiscais de Serviço Eletrônicas em todos os 5.570 municípios do Brasil.
4
+
5
+ ## Instalação
6
+
7
+ ```bash
8
+ pip install emitare
9
+ ```
10
+
11
+ ## Uso rápido
12
+
13
+ ```python
14
+ from emitare import Emitare
15
+
16
+ client = Emitare("sua-api-key")
17
+
18
+ # Emitir NFS-e
19
+ nfse = client.nfse.emitir(
20
+ empresa_id="uuid-da-empresa",
21
+ tomador={
22
+ "cpfCnpj": "12345678000195",
23
+ "razaoSocial": "Empresa Tomadora Ltda",
24
+ "email": "financeiro@tomadora.com.br"
25
+ },
26
+ servico={
27
+ "codigoMunicipio": 3550308, # São Paulo
28
+ "descricao": "Desenvolvimento de software",
29
+ "valorTotal": 1500.00,
30
+ "aliquotaIss": 2.0
31
+ }
32
+ )
33
+
34
+ print(f"NFS-e emitida: {nfse['numero']}")
35
+ ```
36
+
37
+ ## Funcionalidades
38
+
39
+ - ✅ Emissão de NFS-e em 5.570 municípios brasileiros
40
+ - ✅ Suporte a 10 provedores (GINFES, ISSNet, SIGISS, Betha, IPM, SimplISS, DSF, eGoverne, PRODAM, Padrão Nacional 2026)
41
+ - ✅ Padrão Nacional 2026 (LC 214/2025 — IBS/CBS)
42
+ - ✅ Consulta e cancelamento de NFS-e
43
+ - ✅ Emissão em lote
44
+ - ✅ Webhooks em tempo real
45
+
46
+ ## Documentação
47
+
48
+ Documentação completa em [emitare.com.br/docs](https://emitare.com.br/docs)
49
+
50
+ ## Licença
51
+
52
+ MIT
@@ -0,0 +1,6 @@
1
+ """Emitare — SDK Python para API NFS-e."""
2
+
3
+ from .client import Emitare, EmitareError
4
+
5
+ __version__ = "1.0.0"
6
+ __all__ = ["Emitare", "EmitareError"]
@@ -0,0 +1,133 @@
1
+ """Cliente principal do SDK Emitare para Python."""
2
+
3
+ import json
4
+ import urllib.request
5
+ import urllib.error
6
+ from typing import Any, Dict, Optional
7
+
8
+
9
+ class EmitareError(Exception):
10
+ def __init__(self, message: str, status_code: int = 0, body: Any = None):
11
+ super().__init__(message)
12
+ self.status_code = status_code
13
+ self.body = body
14
+
15
+
16
+ class _Resource:
17
+ def __init__(self, client: "Emitare"):
18
+ self._c = client
19
+
20
+
21
+ class NfseResource(_Resource):
22
+ def emitir(self, dados: Dict) -> Dict:
23
+ return self._c._request("POST", "/api/v1/nfse/emitir", dados)
24
+
25
+ def consultar(self, nfse_id: str) -> Dict:
26
+ return self._c._request("GET", f"/api/v1/nfse/{nfse_id}")
27
+
28
+ def cancelar(self, nfse_id: str, motivo: str) -> Dict:
29
+ return self._c._request("POST", f"/api/v1/nfse/{nfse_id}/cancelar", {"motivo": motivo})
30
+
31
+ def listar(self, empresa_id: str, **params) -> Dict:
32
+ qs = "&".join(f"{k}={v}" for k, v in params.items())
33
+ path = f"/api/v1/nfse?empresaId={empresa_id}" + (f"&{qs}" if qs else "")
34
+ return self._c._request("GET", path)
35
+
36
+ def xml(self, nfse_id: str) -> Dict:
37
+ return self._c._request("GET", f"/api/v1/nfse/{nfse_id}/xml")
38
+
39
+ def pdf(self, nfse_id: str) -> Dict:
40
+ return self._c._request("GET", f"/api/v1/nfse/{nfse_id}/pdf")
41
+
42
+
43
+ class CompaniesResource(_Resource):
44
+ def listar(self) -> Dict:
45
+ return self._c._request("GET", "/api/v1/companies")
46
+
47
+ def criar(self, dados: Dict) -> Dict:
48
+ return self._c._request("POST", "/api/v1/companies", dados)
49
+
50
+ def buscar(self, empresa_id: str) -> Dict:
51
+ return self._c._request("GET", f"/api/v1/companies/{empresa_id}")
52
+
53
+ def atualizar(self, empresa_id: str, dados: Dict) -> Dict:
54
+ return self._c._request("PATCH", f"/api/v1/companies/{empresa_id}", dados)
55
+
56
+ def remover(self, empresa_id: str) -> Dict:
57
+ return self._c._request("DELETE", f"/api/v1/companies/{empresa_id}")
58
+
59
+ def upload_certificado(self, empresa_id: str, pfx_base64: str, senha: str) -> Dict:
60
+ return self._c._request("POST", f"/api/v1/companies/{empresa_id}/certificate", {
61
+ "pfxBase64": pfx_base64,
62
+ "senha": senha
63
+ })
64
+
65
+
66
+ class MunicipiosResource(_Resource):
67
+ def buscar_por_ibge(self, ibge: int) -> Dict:
68
+ return self._c._request("GET", f"/api/v1/municipios/{ibge}")
69
+
70
+ def buscar_por_nome(self, nome: str) -> Dict:
71
+ import urllib.parse
72
+ return self._c._request("GET", f"/api/v1/municipios?nome={urllib.parse.quote(nome)}")
73
+
74
+
75
+ class Emitare:
76
+ """
77
+ Cliente da API NFS-e Emitare.
78
+
79
+ Uso:
80
+ from emitare import Emitare
81
+
82
+ client = Emitare("sua-api-key")
83
+ nota = client.nfse.emitir({ ... })
84
+ """
85
+
86
+ def __init__(
87
+ self,
88
+ api_key: str,
89
+ base_url: str = "https://emitare.com.br",
90
+ timeout: int = 30,
91
+ ):
92
+ if not api_key:
93
+ raise ValueError("api_key é obrigatório")
94
+ self.api_key = api_key
95
+ self.base_url = base_url.rstrip("/")
96
+ self.timeout = timeout
97
+
98
+ self.nfse = NfseResource(self)
99
+ self.companies = CompaniesResource(self)
100
+ self.municipios = MunicipiosResource(self)
101
+
102
+ def _request(self, method: str, path: str, body: Optional[Dict] = None) -> Any:
103
+ full_url = self.base_url + path
104
+ payload = json.dumps(body).encode() if body is not None else None
105
+
106
+ req = urllib.request.Request(
107
+ full_url,
108
+ data=payload,
109
+ method=method,
110
+ headers={
111
+ "x-api-key": self.api_key,
112
+ "Content-Type": "application/json",
113
+ "Accept": "application/json",
114
+ "User-Agent": "emitare-python/1.0.0",
115
+ }
116
+ )
117
+
118
+ try:
119
+ with urllib.request.urlopen(req, timeout=self.timeout) as resp:
120
+ return json.loads(resp.read().decode())
121
+ except urllib.error.HTTPError as e:
122
+ body = {}
123
+ try:
124
+ body = json.loads(e.read().decode())
125
+ except Exception:
126
+ pass
127
+ raise EmitareError(
128
+ body.get("message", f"HTTP {e.code}"),
129
+ e.code,
130
+ body
131
+ ) from e
132
+ except urllib.error.URLError as e:
133
+ raise EmitareError(str(e.reason), 0, None) from e
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: emitare
3
+ Version: 1.0.0
4
+ Summary: SDK Python para a API NFS-e Emitare — emita notas fiscais de serviço em todos os municípios do Brasil
5
+ Home-page: https://emitare.com.br/docs
6
+ Author: Emitare
7
+ Author-email: dev@emitare.com.br
8
+ Project-URL: Documentação, https://emitare.com.br/docs
9
+ Project-URL: Repositório, https://github.com/krgitti/emitare-nfs-api
10
+ Project-URL: Rastreador de bugs, https://github.com/krgitti/emitare-nfs-api/issues
11
+ Keywords: nfse nota-fiscal-servico api-nfse brasil prefeitura erp fiscal
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Office/Business :: Financial
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: project-url
33
+ Dynamic: requires-python
34
+ Dynamic: summary
35
+
36
+ # Emitare SDK para Python
37
+
38
+ SDK oficial Python para a [API NFS-e Emitare](https://emitare.com.br) — emita Notas Fiscais de Serviço Eletrônicas em todos os 5.570 municípios do Brasil.
39
+
40
+ ## Instalação
41
+
42
+ ```bash
43
+ pip install emitare
44
+ ```
45
+
46
+ ## Uso rápido
47
+
48
+ ```python
49
+ from emitare import Emitare
50
+
51
+ client = Emitare("sua-api-key")
52
+
53
+ # Emitir NFS-e
54
+ nfse = client.nfse.emitir(
55
+ empresa_id="uuid-da-empresa",
56
+ tomador={
57
+ "cpfCnpj": "12345678000195",
58
+ "razaoSocial": "Empresa Tomadora Ltda",
59
+ "email": "financeiro@tomadora.com.br"
60
+ },
61
+ servico={
62
+ "codigoMunicipio": 3550308, # São Paulo
63
+ "descricao": "Desenvolvimento de software",
64
+ "valorTotal": 1500.00,
65
+ "aliquotaIss": 2.0
66
+ }
67
+ )
68
+
69
+ print(f"NFS-e emitida: {nfse['numero']}")
70
+ ```
71
+
72
+ ## Funcionalidades
73
+
74
+ - ✅ Emissão de NFS-e em 5.570 municípios brasileiros
75
+ - ✅ Suporte a 10 provedores (GINFES, ISSNet, SIGISS, Betha, IPM, SimplISS, DSF, eGoverne, PRODAM, Padrão Nacional 2026)
76
+ - ✅ Padrão Nacional 2026 (LC 214/2025 — IBS/CBS)
77
+ - ✅ Consulta e cancelamento de NFS-e
78
+ - ✅ Emissão em lote
79
+ - ✅ Webhooks em tempo real
80
+
81
+ ## Documentação
82
+
83
+ Documentação completa em [emitare.com.br/docs](https://emitare.com.br/docs)
84
+
85
+ ## Licença
86
+
87
+ MIT
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ emitare/__init__.py
4
+ emitare/client.py
5
+ emitare.egg-info/PKG-INFO
6
+ emitare.egg-info/SOURCES.txt
7
+ emitare.egg-info/dependency_links.txt
8
+ emitare.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ emitare
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
emitare-1.0.0/setup.py ADDED
@@ -0,0 +1,34 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="emitare",
5
+ version="1.0.0",
6
+ description="SDK Python para a API NFS-e Emitare — emita notas fiscais de serviço em todos os municípios do Brasil",
7
+ long_description=open("README.md", encoding="utf-8").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="Emitare",
10
+ author_email="dev@emitare.com.br",
11
+ url="https://emitare.com.br/docs",
12
+ project_urls={
13
+ "Documentação": "https://emitare.com.br/docs",
14
+ "Repositório": "https://github.com/krgitti/emitare-nfs-api",
15
+ "Rastreador de bugs": "https://github.com/krgitti/emitare-nfs-api/issues",
16
+ },
17
+ packages=find_packages(),
18
+ python_requires=">=3.8",
19
+ install_requires=[],
20
+ classifiers=[
21
+ "Development Status :: 5 - Production/Stable",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.8",
26
+ "Programming Language :: Python :: 3.9",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Topic :: Office/Business :: Financial",
31
+ "Topic :: Software Development :: Libraries :: Python Modules",
32
+ ],
33
+ keywords="nfse nota-fiscal-servico api-nfse brasil prefeitura erp fiscal",
34
+ )