seigov 0.1.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.
- seigov-0.1.0/.gitignore +24 -0
- seigov-0.1.0/LICENSE +14 -0
- seigov-0.1.0/PKG-INFO +89 -0
- seigov-0.1.0/README.md +65 -0
- seigov-0.1.0/pyproject.toml +54 -0
- seigov-0.1.0/src/seigov/__init__.py +40 -0
- seigov-0.1.0/src/seigov/client.py +577 -0
- seigov-0.1.0/src/seigov/config.py +75 -0
- seigov-0.1.0/src/seigov/exceptions.py +24 -0
- seigov-0.1.0/src/seigov/parse.py +39 -0
- seigov-0.1.0/src/seigov/sip.py +99 -0
- seigov-0.1.0/src/seigov/wsdl/sei.wsdl +2847 -0
- seigov-0.1.0/src/seigov/wsdl/sip.wsdl +665 -0
- seigov-0.1.0/src/seigov/wsdl.py +22 -0
- seigov-0.1.0/tests/test_client.py +96 -0
- seigov-0.1.0/tests/test_config.py +31 -0
- seigov-0.1.0/tests/test_parse.py +29 -0
seigov-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
.pytest_cache/
|
|
7
|
+
.ruff_cache/
|
|
8
|
+
.mypy_cache/
|
|
9
|
+
|
|
10
|
+
# venv / build
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
build/
|
|
14
|
+
dist/
|
|
15
|
+
*.whl
|
|
16
|
+
*.tar.gz
|
|
17
|
+
|
|
18
|
+
# Claude Code / planning (não versionar)
|
|
19
|
+
PLAN.md
|
|
20
|
+
CLAUDE.md
|
|
21
|
+
.claude/
|
|
22
|
+
|
|
23
|
+
# OS
|
|
24
|
+
.DS_Store
|
seigov-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
seigov — cliente Python para os Web Services do SEI/SIP
|
|
2
|
+
Copyright (C) 2026 Andre Leite e colaboradores
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
11
|
+
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
12
|
+
|
|
13
|
+
You should have received a copy of the GNU General Public License along with
|
|
14
|
+
this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
|
seigov-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: seigov
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Cliente Python para os Web Services SOAP do SEI (Sistema Eletronico de Informacoes) e do SIP
|
|
5
|
+
Project-URL: Homepage, https://github.com/StrategicProjects/seigov
|
|
6
|
+
Project-URL: Issues, https://github.com/StrategicProjects/seigov/issues
|
|
7
|
+
Author-email: Andre Leite <leite@castlab.org>, Marcos Wasilew <marcos.wasilew@gmail.com>, Hugo Vasconcelos <hugo.vasconcelos@ufpe.br>, Carlos Amorin <carlos.agaf@ufpe.br>, Diogo Bezerra <diogo.bezerra@ufpe.br>, Julia Nascimento Barreto <juliabarreto@gd.seplag.pe.gov.br>
|
|
8
|
+
License-Expression: GPL-3.0-or-later
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: govbr,processo-eletronico,sei,sip,soap,zeep
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Office/Business
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Requires-Dist: pandas>=1.5
|
|
17
|
+
Requires-Dist: zeep>=4.2
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: build; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest-mock>=3; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
22
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# seigov
|
|
26
|
+
|
|
27
|
+
Cliente Python para os **Web Services SOAP do SEI** (Sistema Eletrônico de
|
|
28
|
+
Informações) e do **SIP** (Sistema de Permissões). Construído sobre
|
|
29
|
+
[`zeep`](https://docs.python-zeep.org/), devolve os resultados como
|
|
30
|
+
`pandas.DataFrame`. É a porta Python do pacote R
|
|
31
|
+
[`rsei`](https://github.com/StrategicProjects/rsei).
|
|
32
|
+
|
|
33
|
+
> **⚠️ Acesso restrito por IP.** Os Web Services do SEI só respondem a
|
|
34
|
+
> requisições vindas de IPs/servidores previamente autorizados no cadastro do
|
|
35
|
+
> serviço. As funções só retornam dados a partir de um host autorizado.
|
|
36
|
+
|
|
37
|
+
> **Genérico.** O pacote não é amarrado a nenhum órgão: informe o endpoint do
|
|
38
|
+
> Web Service do **seu** SEI em `SeiClient(url=...)`.
|
|
39
|
+
|
|
40
|
+
## Instalação
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install seigov # (após publicação no PyPI)
|
|
44
|
+
# ou, do código-fonte:
|
|
45
|
+
pip install -e ".[dev]"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Uso
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from seigov import SeiClient
|
|
52
|
+
|
|
53
|
+
sei = SeiClient(
|
|
54
|
+
url="https://sei.<seu-orgao>.gov.br/sei/ws/SeiWS.php",
|
|
55
|
+
sigla_sistema="MEU_SISTEMA",
|
|
56
|
+
identificacao_servico="minha-chave", # chave de acesso
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
# Consultar um processo (retorna um DataFrame)
|
|
60
|
+
df = sei.consultar_procedimento("12.1.000000077-4")
|
|
61
|
+
|
|
62
|
+
# Vários de uma vez (empilha; coluna 'erro' isola falhas por linha)
|
|
63
|
+
lote = sei.consultar_procedimentos(["12.1.000000077-4", "12.1.000000078-2"])
|
|
64
|
+
|
|
65
|
+
# Listagens
|
|
66
|
+
unidades = sei.listar_unidades()
|
|
67
|
+
series = sei.listar_series()
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Configuração também por variáveis de ambiente: `SEIGOV_URL`,
|
|
71
|
+
`SEIGOV_SIGLA_SISTEMA`, `SEIGOV_IDENTIFICACAO_SERVICO`, `SEIGOV_ID_UNIDADE`.
|
|
72
|
+
|
|
73
|
+
SIP (permissões):
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from seigov import SipClient
|
|
77
|
+
sip = SipClient(url="https://sei.<seu-orgao>.gov.br/sip/controlador_ws.php?servico=sip",
|
|
78
|
+
chave_acesso="...", id_sistema="...")
|
|
79
|
+
perms = sip.listar_permissao(id_unidade="110000001")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Estado
|
|
83
|
+
|
|
84
|
+
Em desenvolvimento (Fase 0/1: core + consultas/listagens iniciais). Veja
|
|
85
|
+
`PLAN.md` para o roteiro completo (escrita, SIP, helpers em lote/por-processo).
|
|
86
|
+
|
|
87
|
+
## Licença
|
|
88
|
+
|
|
89
|
+
GPL-3.0-or-later.
|
seigov-0.1.0/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# seigov
|
|
2
|
+
|
|
3
|
+
Cliente Python para os **Web Services SOAP do SEI** (Sistema Eletrônico de
|
|
4
|
+
Informações) e do **SIP** (Sistema de Permissões). Construído sobre
|
|
5
|
+
[`zeep`](https://docs.python-zeep.org/), devolve os resultados como
|
|
6
|
+
`pandas.DataFrame`. É a porta Python do pacote R
|
|
7
|
+
[`rsei`](https://github.com/StrategicProjects/rsei).
|
|
8
|
+
|
|
9
|
+
> **⚠️ Acesso restrito por IP.** Os Web Services do SEI só respondem a
|
|
10
|
+
> requisições vindas de IPs/servidores previamente autorizados no cadastro do
|
|
11
|
+
> serviço. As funções só retornam dados a partir de um host autorizado.
|
|
12
|
+
|
|
13
|
+
> **Genérico.** O pacote não é amarrado a nenhum órgão: informe o endpoint do
|
|
14
|
+
> Web Service do **seu** SEI em `SeiClient(url=...)`.
|
|
15
|
+
|
|
16
|
+
## Instalação
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install seigov # (após publicação no PyPI)
|
|
20
|
+
# ou, do código-fonte:
|
|
21
|
+
pip install -e ".[dev]"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Uso
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from seigov import SeiClient
|
|
28
|
+
|
|
29
|
+
sei = SeiClient(
|
|
30
|
+
url="https://sei.<seu-orgao>.gov.br/sei/ws/SeiWS.php",
|
|
31
|
+
sigla_sistema="MEU_SISTEMA",
|
|
32
|
+
identificacao_servico="minha-chave", # chave de acesso
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# Consultar um processo (retorna um DataFrame)
|
|
36
|
+
df = sei.consultar_procedimento("12.1.000000077-4")
|
|
37
|
+
|
|
38
|
+
# Vários de uma vez (empilha; coluna 'erro' isola falhas por linha)
|
|
39
|
+
lote = sei.consultar_procedimentos(["12.1.000000077-4", "12.1.000000078-2"])
|
|
40
|
+
|
|
41
|
+
# Listagens
|
|
42
|
+
unidades = sei.listar_unidades()
|
|
43
|
+
series = sei.listar_series()
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Configuração também por variáveis de ambiente: `SEIGOV_URL`,
|
|
47
|
+
`SEIGOV_SIGLA_SISTEMA`, `SEIGOV_IDENTIFICACAO_SERVICO`, `SEIGOV_ID_UNIDADE`.
|
|
48
|
+
|
|
49
|
+
SIP (permissões):
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from seigov import SipClient
|
|
53
|
+
sip = SipClient(url="https://sei.<seu-orgao>.gov.br/sip/controlador_ws.php?servico=sip",
|
|
54
|
+
chave_acesso="...", id_sistema="...")
|
|
55
|
+
perms = sip.listar_permissao(id_unidade="110000001")
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Estado
|
|
59
|
+
|
|
60
|
+
Em desenvolvimento (Fase 0/1: core + consultas/listagens iniciais). Veja
|
|
61
|
+
`PLAN.md` para o roteiro completo (escrita, SIP, helpers em lote/por-processo).
|
|
62
|
+
|
|
63
|
+
## Licença
|
|
64
|
+
|
|
65
|
+
GPL-3.0-or-later.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "seigov"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Cliente Python para os Web Services SOAP do SEI (Sistema Eletronico de Informacoes) e do SIP"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "GPL-3.0-or-later"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Andre Leite", email = "leite@castlab.org" },
|
|
14
|
+
{ name = "Marcos Wasilew", email = "marcos.wasilew@gmail.com" },
|
|
15
|
+
{ name = "Hugo Vasconcelos", email = "hugo.vasconcelos@ufpe.br" },
|
|
16
|
+
{ name = "Carlos Amorin", email = "carlos.agaf@ufpe.br" },
|
|
17
|
+
{ name = "Diogo Bezerra", email = "diogo.bezerra@ufpe.br" },
|
|
18
|
+
{ name = "Julia Nascimento Barreto", email = "juliabarreto@gd.seplag.pe.gov.br" },
|
|
19
|
+
]
|
|
20
|
+
keywords = ["sei", "sip", "soap", "zeep", "govbr", "processo-eletronico"]
|
|
21
|
+
classifiers = [
|
|
22
|
+
"Development Status :: 3 - Alpha",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Topic :: Office/Business",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"zeep>=4.2",
|
|
29
|
+
"pandas>=1.5",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = ["pytest>=7", "pytest-mock>=3", "build", "ruff"]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/StrategicProjects/seigov"
|
|
37
|
+
Issues = "https://github.com/StrategicProjects/seigov/issues"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel]
|
|
40
|
+
packages = ["src/seigov"]
|
|
41
|
+
# Os arquivos .wsdl dentro de src/seigov/ são incluídos automaticamente.
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.sdist]
|
|
44
|
+
include = ["src/seigov", "tests", "README.md", "LICENSE", "pyproject.toml"]
|
|
45
|
+
|
|
46
|
+
[tool.pytest.ini_options]
|
|
47
|
+
testpaths = ["tests"]
|
|
48
|
+
|
|
49
|
+
[tool.ruff]
|
|
50
|
+
line-length = 100
|
|
51
|
+
|
|
52
|
+
[tool.ruff.lint]
|
|
53
|
+
select = ["E", "F", "W", "I"]
|
|
54
|
+
ignore = ["E731"] # permite lambdas atribuidas a nomes (helpers curtos)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""seigov — cliente Python para os Web Services SOAP do SEI e do SIP.
|
|
2
|
+
|
|
3
|
+
Genérico: funciona com qualquer instalação do SEI; informe o endpoint do seu
|
|
4
|
+
servidor em :class:`SeiConfig` (ou via ``SEIGOV_URL``).
|
|
5
|
+
|
|
6
|
+
Exemplo
|
|
7
|
+
-------
|
|
8
|
+
>>> from seigov import SeiClient
|
|
9
|
+
>>> sei = SeiClient(
|
|
10
|
+
... url="https://sei.<seu-orgao>.gov.br/sei/ws/SeiWS.php",
|
|
11
|
+
... sigla_sistema="MEU_SISTEMA",
|
|
12
|
+
... identificacao_servico="minha-chave",
|
|
13
|
+
... )
|
|
14
|
+
>>> df = sei.consultar_procedimento("12.1.000000077-4") # doctest: +SKIP
|
|
15
|
+
|
|
16
|
+
Aviso: os Web Services do SEI são restritos por IP — só respondem de hosts
|
|
17
|
+
autorizados.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from .client import SeiClient, encode_sin
|
|
23
|
+
from .config import SeiConfig, SipConfig
|
|
24
|
+
from .exceptions import SeiError, SeiFault
|
|
25
|
+
from .parse import to_dataframe
|
|
26
|
+
from .sip import SipClient
|
|
27
|
+
|
|
28
|
+
__version__ = "0.1.0"
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"SeiClient",
|
|
32
|
+
"SipClient",
|
|
33
|
+
"SeiConfig",
|
|
34
|
+
"SipConfig",
|
|
35
|
+
"SeiError",
|
|
36
|
+
"SeiFault",
|
|
37
|
+
"to_dataframe",
|
|
38
|
+
"encode_sin",
|
|
39
|
+
"__version__",
|
|
40
|
+
]
|