courts.tjal.client.TJALScraper

courts.tjal.client.TJALScraper(
    verbose=0,
    download_path=None,
    sleep_time=1.0,
    **kwargs,
)

Scraper for the Tribunal de Justica de Alagoas (TJAL).

The TJAL uses the eSAJ platform (same as TJSP). Currently supports jurisprudence search (CJSG).

Methods

Name Description
cjsg Search TJAL jurisprudence (2nd degree).
cjsg_download Download raw CJSG HTML result pages.
cjsg_parse Parse downloaded CJSG HTML files.

cjsg

courts.tjal.client.TJALScraper.cjsg(
    pesquisa,
    paginas=None,
    ementa=None,
    numero_recurso=None,
    classe=None,
    assunto=None,
    comarca=None,
    orgao_julgador=None,
    data_julgamento_inicio=None,
    data_julgamento_fim=None,
    data_publicacao_inicio=None,
    data_publicacao_fim=None,
    origem='T',
    tipo_decisao='acordao',
    **kwargs,
)

Search TJAL jurisprudence (2nd degree).

Parameters

pesquisa : str Free-text search term. paginas : int, list, range, or None Pages to download (1-based). None downloads all. ementa : str, optional Filter by ementa text. numero_recurso : str, optional Appeal number filter. classe : str, optional Procedural class (tree selection value). assunto : str, optional Subject (tree selection value). comarca : str, optional District. orgao_julgador : str, optional Judging body (tree selection value). data_julgamento_inicio, data_julgamento_fim : str, optional Judgment date range (dd/mm/yyyy). Aliases: data_inicio/data_fim. data_publicacao_inicio, data_publicacao_fim : str, optional Publication date range (dd/mm/yyyy). origem : str "T" for 2nd degree (default), "R" for recursal courts. tipo_decisao : str "acordao" or "monocratica".

Returns

pd.DataFrame

cjsg_download

courts.tjal.client.TJALScraper.cjsg_download(
    pesquisa,
    paginas=None,
    ementa=None,
    numero_recurso=None,
    classe=None,
    assunto=None,
    comarca=None,
    orgao_julgador=None,
    data_julgamento_inicio=None,
    data_julgamento_fim=None,
    data_publicacao_inicio=None,
    data_publicacao_fim=None,
    origem='T',
    tipo_decisao='acordao',
    diretorio=None,
    **kwargs,
)

Download raw CJSG HTML result pages.

Parameters are the same as :meth:cjsg, plus:

str, optional

Directory to save files. Defaults to the scraper’s download_path.

Returns

str Path to the directory containing HTML files.

cjsg_parse

courts.tjal.client.TJALScraper.cjsg_parse(diretorio)

Parse downloaded CJSG HTML files.

Parameters

diretorio : str or Path Directory containing downloaded HTML files.

Returns

pd.DataFrame