Scraper for the jurisprudence searches of the Tribunal de Justica de Mato Grosso do Sul, second-instance (CJSG) and first-instance (CJPG), and for the PDFs of the decisions they return.
cjsg
Yes
cjpg
Yes
baixar_acordao / baixar_acordaos
Yes
baixar_sentenca / baixar_sentencas
Yes
cpopg
No
cposg
No
Basic search
import juscraper as jus
tjms = jus.scraper('tjms' )
df = tjms.cjsg('dano moral' , paginas= range (1 , 3 ))
print (df.shape)
df.head(3 )
Baixando CJSG TJMS: 50%|█████ | 1/2 [00:00<?, ?it/s]Baixando CJSG TJMS: 100%|██████████| 2/2 [00:01<00:00, 1.74s/it]Baixando CJSG TJMS: 100%|██████████| 2/2 [00:01<00:00, 1.74s/it]
Processando documentos: 0%| | 0/2 [00:00<?, ?it/s]Processando documentos: 50%|█████ | 1/2 [00:00<00:00, 8.83it/s]Processando documentos: 100%|██████████| 2/2 [00:00<00:00, 10.62it/s]
0
0804883-12.2021.8.12.0001
1988615
0
Agravo Interno Cível / PASEP
Vice-Presidente
Campo Grande
Vice-Presidência
13/11/2026
16/11/2026
DIREITO PROCESSUAL CIVIL. AGRAVO INTERNO. RECU...
1
0804350-61.2023.8.12.0008
1988640
0
Agravo Interno Cível / Obrigação de Fazer / Nã...
Vice-Presidente
Corumbá
Vice-Presidência
13/11/2026
16/11/2026
DIREITO PROCESSUAL CIVIL, CONSTITUCIONAL E ADM...
2
0020390-61.2012.8.12.0001
1988655
0
Apelação Cível / Acidente de Trânsito
Des. Luiz Tadeu Barbosa Silva
Campo Grande
4ª Câmara Cível
13/11/2026
16/11/2026
APELAÇÕES CÍVEIS – AÇÃO DE CONHECIMENTO – PRES...
Available columns
['processo',
'cd_acordao',
'cd_foro',
'classe_assunto',
'relator',
'comarca',
'orgao_julgador',
'data_julgamento',
'data_publicacao',
'ementa']
Preview ementa
print (df['ementa' ].iloc[0 ][:300 ])
DIREITO PROCESSUAL CIVIL. AGRAVO INTERNO. RECURSO ESPECIAL. CONTA VINCULADA AO PASEP. DISTRIBUIÇÃO DO ÔNUS DA PROVA. TEMA REPETITIVO 1.300 DO STJ. LANÇAMENTOS REGISTRADOS SOB A RUBRICA FOPAG. PRETENSÃO DE REEXAME DA NATUREZA DAS MOVIMENTAÇÕES. IMPOSSIBILIDADE DE REEXAME FÁTICO-PROBATÓRIO. CONFORMIDA
Using filters
You can filter by judgment date, publication date, decision type, and other fields.
df_filtered = tjms.cjsg(
'direito' ,
data_julgamento_inicio= '01/01/2024' ,
data_julgamento_fim= '30/06/2024' ,
paginas= 1 ,
)
print (df_filtered.shape)
df_filtered.head(3 )
Processando documentos: 0%| | 0/1 [00:00<?, ?it/s]Processando documentos: 100%|██████████| 1/1 [00:00<00:00, 15.07it/s]
0
0801606-23.2019.8.12.0012
1692937
0
Embargos de Declaração Cível / Fornecimento de...
Juiz Vitor Luis de Oliveira Guibo
Ivinhema
2ª Câmara Cível
31/01/2024
13/03/2025
EMBARGOS DE DECLARAÇÃO – APELAÇÃO CÍVEL – AÇÃO...
1
1407238-41.2024.8.12.0000
1580279
0
Agravo de Instrumento / Efeito Suspensivo / Im...
Des. Marcelo Câmara Rasslan
Camapuã
1ª Câmara Cível
18/06/2024
04/07/2024
AGRAVO DE INSTRUMENTO – CUMPRIMENTO DE SENTENÇ...
2
0047680-51.2012.8.12.0001
1578759
0
Embargos de Declaração Cível / Prestação de Se...
Des. Odemilson Roberto Castro Fassa
Campo Grande
3ª Câmara Cível
28/06/2024
02/07/2024
E M E N T A - EMBARGOS de DECLARAÇÃO DE USINA ...
Download and parse separately
You can also download the raw HTML files and parse them in a separate step.
import tempfile, os
tmp = tempfile.mkdtemp()
pasta = tjms.cjsg_download('direito' , paginas= 1 , diretorio= tmp)
print ('Downloaded to:' , pasta)
print ('Files:' , os.listdir(pasta))
Downloaded to: /var/folders/rv/jfmtd5hx5kv11464k5s9yjg80000gn/T/tmpwusew_y1/cjsg/20261115215445
Files: ['cjsg_00001.html']
df_parsed = tjms.cjsg_parse(pasta)
print (df_parsed.shape)
df_parsed.head(3 )
Processando documentos: 0%| | 0/1 [00:00<?, ?it/s]Processando documentos: 100%|██████████| 1/1 [00:00<00:00, 13.88it/s]
0
1413282-28.2014.8.12.0000
1988517
0
Agravo Interno Cível / Férias
Vice-Presidente
Não informada
Vice-Presidência
13/11/2026
16/11/2026
AGRAVO INTERNO. IMPUGNAÇÃO AO CUMPRIMENTO DE S...
1
1413282-28.2014.8.12.0000
1988518
0
Agravo Interno Cível / Férias
Vice-Presidente
Não informada
Vice-Presidência
13/11/2026
16/11/2026
em>DIREITO PROCESSUAL CIVIL. AGRAVO INTERNO. C...
2
1413282-28.2014.8.12.0000
1988519
0
Agravo Interno Cível / Férias
Vice-Presidente
Não informada
Vice-Presidência
13/11/2026
16/11/2026
AGRAVO INTERNO. IMPUGNAÇÃO AO CUMPRIMENTO DE S...
First-instance decisions (cjpg)
cjpg() searches the first-instance decisions (sentenças) of TJMS. Unlike cjsg, pesquisa may be empty, to search by filters only (e.g. classe, vara, data_julgamento_inicio). Each row brings the text of the decision in decisao and the codes baixar_sentencas uses to download its PDF.
sentencas = tjms.cjpg('dano moral' , paginas= 1 )
print (sentencas.shape)
sentencas.head(3 )
Baixando documentos: 100%|██████████| 1/1 [00:00<?, ?it/s]Baixando documentos: 100%|██████████| 1/1 [00:00<?, ?it/s]
Processando documentos: 0%| | 0/1 [00:00<?, ?it/s]Processando documentos: 100%|██████████| 1/1 [00:00<00:00, 53.33it/s]
0
0I0008KCG0000
18
PG5MS
158709214
0802668-36.2026.8.12.0018
Procedimento Comum Cível
Repetição do Indébito
Nária Cassiana Silva Barros
Paranaíba
Paranaíba
1ª Vara Cível
15/11/2026
Processo nº 0802668-36.2026.8.12.0018\nClasse:...
1
0I0008IMN0000
18
PG5MS
158901409
0801258-40.2026.8.12.0018
Procedimento Comum Cível
Descontos dos benefícios
Nária Cassiana Silva Barros
Paranaíba
Paranaíba
1ª Vara Cível
15/11/2026
Processo nº 0801258-40.2026.8.12.0018\nClasse:...
2
0I0008KKB0000
18
PG5MS
158715425
0802879-72.2026.8.12.0018
Procedimento Comum Cível
Práticas Abusivas
Nária Cassiana Silva Barros
Paranaíba
Paranaíba
1ª Vara Cível
15/11/2026
Processo nº 0802879-72.2026.8.12.0018\nClasse:...
Sentence PDFs (baixar_sentencas)
baixar_sentencas() downloads the PDF of the sentence in each cjpg row, without login or captcha, and adds caminho_sentenca (None when the download failed) and motivo_falha. baixar_sentenca() downloads a single one.
pdfs = tjms.baixar_sentencas(sentencas.head(3 ), diretorio= tmp)
pdfs[['id_processo' , 'caminho_sentenca' , 'motivo_falha' ]]
0
0802668-36.2026.8.12.0018
/var/folders/rv/jfmtd5hx5kv11464k5s9yjg80000gn...
None
1
0801258-40.2026.8.12.0018
/var/folders/rv/jfmtd5hx5kv11464k5s9yjg80000gn...
None
2
0802879-72.2026.8.12.0018
/var/folders/rv/jfmtd5hx5kv11464k5s9yjg80000gn...
None