Code Monkey home page Code Monkey logo

djt's Introduction

djt

Travis-CI Build Status AppVeyor Build Status

Overview

The djt R package allows you to download and parse Brazilian DJTs (Diários da Justiça do Trabalho). Its functions are simple and well documented, supplying the user with a consistent and robust toolbox to explore these PDFs.

To install djt, run the code below:

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

Usage

Downloading DJTs is very simple. By using the download_djt() function with its arguments, you can select a TRT (Tribunal Regional do Trabalho), a booklet (caderno), and start and end dates to download all DJTs that fit the specified filters.

# Download all TRT02 booklets from 2017-10-19
download_djt(trt = 2, path = "~/Desktop/djt_files", booklet = "all",
             date_min = "2017-10-19", date_max = "2017-10-19")
#> # A tibble: 2 x 6
#>    page    id                                                           title       date
#>   <int> <int>                                                           <chr>     <date>
#> 1     1     0     Edição 2337/2017 - Caderno do TRT da 2ª Região - Judiciário 2017-10-19
#> 2     1     1 Edição 2337/2017 - Caderno do TRT da 2ª Região - Administrativo 2017-10-19
#> # ... with 2 more variables: file <chr>, result <chr>

After you have downloaded as many DJTs as you want, you can start parsing them. Functions like pdf_to_text(), find_all(), chop_at(), and pre_process() are your best tools for this step. If you want to find all lawsuits whose contents match a certain pattern, you can use match_lawsuits() with a DJT that has been converted to text:

# Get all lawsuits that contain "SANTANDER"
match_lawsuits(djt, "SANTANDER")
#> [1] "RTOrd-0001317-23.2015.5.02.0003"
#> [2] "RtSum-0001584-20.2006.5.02.0003"
#> [3] "ExFis-0000900-02.1993.5.02.0005"
#> [4] "RTOrd-0001064-63.2014.5.02.0005"
#> [5] "RTOrd-1000959-61.2017.5.02.0006"
#> ...

djt's People

Contributors

jtrecenti avatar clente 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.