Code Monkey home page Code Monkey logo

esaj's Introduction

esaj

Made In Brazil Travis-CI Build Status AppVeyor Build Status

Overview

The esaj R package is a simple interface that allows you to download multiple kinds of files from Brazil's e-SAJ (Electronic Justice Automation System) portals. With this package you can save and parse lawsuits, queries, and decisions with very simple, tidyverse compliant functions.

To install esaj, run the code below:

# install.packages("devtools")
devtools::install_github("courtsbr/esaj")

Usage

Lawsuits

Before esaj if you wanted to gather information about lawsuits being processed by Brazil's state-level Judiciary, you would have to go to each state's e-SAJ portal, manually input each lawsuit's ID, break a capthca, and only then download an HTML with the information you wanted; now you can simply run download_cpopg() or download_cposg(), and spend your valuable time analysing the data.

# Download first degree lawsuits from multiple states
ids <- c(
  "0123479-07.2012.8.26.0100",
  "0552486-62.2015.8.05.0001",
  "0303349-44.2014.8.24.0020")
esaj::download_cpopg(ids, "~/Desktop/")
#> [1] "/Users/ctlente/Desktop/01234790720128260100.html"
#> [2] "/Users/ctlente/Desktop/05524866220158050001.html"
#> [3] "/Users/ctlente/Desktop/03033494420148240020.html"

# Download second degree lawsuits from São Paulo
ids <- c(
  "1001869-51.2017.8.26.0562",
  "1001214-07.2016.8.26.0565")
esaj::download_cposg(ids, "~/Desktop/")
#> [1] "/Users/ctlente/Desktop/10018695120178260562.html"
#> [2] "/Users/ctlente/Desktop/10012140720168260565.html"

For more information on how to use these functions and which TJs are implemented, please see Downloading Lawsuits.

Queries

Besides downloading lawsuits (see the Downloading Lawsuits article), esaj also allows the user to download the results of a query on lawsuits. This kind of query is very useful for finding out what lawsuits contain certain words, were filed in a given period, were filed in a given court, etc.

# Download results of a simple first degree query
esaj::download_cjpg("recurso", "~/Desktop/")
#> [1] "/Users/ctlente/Desktop/search.html"
#> [2] "/Users/ctlente/Desktop/page1.html"

# Download results of a slightly more complex second degree query
esaj::download_cjsg("recurso", "~/Desktop/", classes = c("1231", "1232"))
#> [1] "/Users/ctlente/Desktop/search.html"
#> [2] "/Users/ctlente/Desktop/page1.html"

For more information on how to use these functions and all their auxiliary methods (like peek_cj*g() and cj*g_table()), please see Downloading Queries.

Decisions

Of all functions in the esaj package, download_decision() is probably the simplest: it downloads the PDF belonging to a decision and that's it.

# Download one decision
esaj::download_decision("10000034", "~/Desktop/")
#> [1] "/Users/ctlente/Desktop/10000034.pdf"

# Download more than one decision
esaj::download_decision(c("10800758", "10000034"), "~/Desktop/")
#> [1] "/Users/ctlente/Desktop/10800758.pdf"
#> [2] "/Users/ctlente/Desktop/10000034.pdf"

For more information on how to use this function, please see Downloading Decisions.

esaj's People

Contributors

clente avatar jtrecenti avatar azeloc avatar mifarhat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.