Skip to main content

Alacorder collects and processes Alacourt case detail PDFs into data tables suitable for research purposes.

Project description

    ___    __                          __         
   /   |  / /___ __________  _________/ /__  _____
  / /| | / / __ `/ ___/ __ \/ ___/ __  / _ \/ ___/
 / ___ |/ / /_/ / /__/ /_/ / /  / /_/ /  __/ /    
/_/  |_/_/\__,_/\___/\____/_/   \__,_/\___/_/     
                                                  

Alacorder

Alacorder collects and processes case detail PDFs into data tables suitable for research purposes.

GitHub | PyPI | Report an issue

Installation

If your device can run Python 3.9+, it supports Alacorder. Download a prebuilt executable from GitHub to use the graphical user interface, or use pip to install the command line interface, graphical interface, and Python module alac.

  • Install Anaconda Distribution to install the latest Python (not necessary for prebuilt executable).
  • Once your Anaconda environment is configured, open a terminal from Anaconda Navigator and enter pip install alacorder to install.
  • To start the graphical interface, enter python -m alacorder start.
  • Enter python -m alacorder to use the command line interface.
  • To use the alac module, use the import statement from alacorder import alac.

Getting Started with Alacorder

Alacorder can be used without writing any code, and exports to common formats like Excel (.xls, .xlsx), Apache Parquet (.parquet), CSV (.csv), and JSON (.json).

Utilize the command line interface

Create data tables with a row per case using the multi, cases, fees, charges, financial-history, settings, witnesses, attorneys, case-action-summary, and images tools. Or create a pair template and match names to AIS numbers to summarize voting rights status.

Usage: python -m alacorder [OPTIONS] COMMAND [ARGS]...

  ALACORDER collects and processes case detail PDFs into data tables suitable
  for research purposes.

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  append               Append one case text archive to another
  archive              Create full text archive from case PDFs
  attorneys            Create and export attorneys table
  case-action-summary  Create and export case action summaries
  cases                Create and export case information table
  charges              Create and export charges table
  crawl                Retrieve current inmates list from ADOC
  fees                 Create and export fees table
  fetch                Fetch cases from Alacourt.com
  financial-history    Create and export financial history table
  images               Create and export images table
  multi                Export all data tables to .xls/.xlsx
  pair                 Create blank AIS / unique pairing template
  rename               Rename cases in input directory to case numbers
  sentences            Create and export sentences table
  settings             Create and export settings table
  start                Launch graphical user interface
  vrr-pairs            Create voting rights summary from input cases and pairs
  witnesses            Create and export witnesses table

Fetch cases in bulk from Alacourt.com

Take a spreadsheet of names and/or other search parameters and download case PDFs from Alacourt in bulk. Download thousands of PDFs in just hours by leaving your computer unattended. (Google Chrome is required to use the fetch feature.)

Usage: python -m alacorder fetch [OPTIONS]

  Fetch cases from Alacourt.com

Options:
  -in, --input-path PATH      Path to query table/spreadsheet (.xls, .xlsx)
                              [required]
  -out, --output-path PATH    Desired PDF output directory  [required]
  -c, --customer-id TEXT      Customer ID on Alacourt.com  [required]
  -u, --user-id TEXT          User ID on Alacourt.com  [required]
  -p, --password TEXT         Password on Alacourt.com  [required]
  -criminal, --criminal-only  Only search criminal cases
  -n, --no-mark               Do not update query template after completion
  --debug                     Print detailed runtime information to console
  -h, --help                  Show this message and exit.

Work with case data in Python

Out of the box, Alacorder exports to .xlsx, .xls, .csv, .json, and .parquet. But you can use polars and other python libraries to create your own data collection workflows and customize Alacorder exports.

from alacorder import alac
import polars as pl

queue = alac.get_paths("/Users/crimson/Desktop/Tutwiler/") # -> [str]

rows = []

for i, path in enumerate(queue):
    text = alac.extract_text(path)
    cnum = alac.getCaseNumber(text)
    cty = alac.getCounty(text)
    tbal = alac.getTotalBalance(text)
    ptr = alac.getPaymentToRestore(text) # i.e. voting rights
    rows += [[cnum, cty, tbal, ptr]]

cases = pl.DataFrame(rows)

cases.write_excel("/Users/crimson/Desktop/Tutwiler/summary.xlsx")

Extend Alacorder with polars and other tools

Alacorder runs on polars, a dataframes library you can use to work with and analyze tabular data. polars can read from and write to all major data storage formats. It can connect to a wide variety of services to provide for easy import and export.

import polars as pl
contents = pl.read_json("/path/to/archive.json")

If you would like to visualize data without exporting to Excel or another format, create a jupyter notebook and install tools like matplotlib, tabulate, and itables to get started. Jupyter Notebook is a Python project you can use to create interactive notebooks for data analysis and other purposes. It can be installed using pip install jupyter or pip3 install jupyter and launched using jupyter notebook. Your device may already be equipped to view .ipynb notebooks.

Resources

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alacorder-80.8.0.tar.gz (130.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alacorder-80.8.0-py3-none-any.whl (130.8 kB view details)

Uploaded Python 3

File details

Details for the file alacorder-80.8.0.tar.gz.

File metadata

  • Download URL: alacorder-80.8.0.tar.gz
  • Upload date:
  • Size: 130.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.9 Darwin/22.4.0

File hashes

Hashes for alacorder-80.8.0.tar.gz
Algorithm Hash digest
SHA256 13f2c9ee7715d9c5e1a5d1f97244227195a090a44c20604600e02e3df61696a2
MD5 3adf1b9c3739dafb0c7f1366627027ce
BLAKE2b-256 121d98d9162c9f58f4e43d12fb40b1f4df3a42e10778d6b49927f14fb1dba0b6

See more details on using hashes here.

File details

Details for the file alacorder-80.8.0-py3-none-any.whl.

File metadata

  • Download URL: alacorder-80.8.0-py3-none-any.whl
  • Upload date:
  • Size: 130.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.9 Darwin/22.4.0

File hashes

Hashes for alacorder-80.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4318a2c11b0ec487b2bbe854911274bb14fc651d866323a0bb625a5fa72425aa
MD5 6fa5dd5acedba07ee9505a3f33845f55
BLAKE2b-256 d70af8db08ae0e761b3b960b7819ca8c4eed9a905a7217919263b0db4ff917d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page