Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cityssm/node-docket-parser
Parses Ontario Provincial Offences docket print data into JavaScript objects.
https://github.com/cityssm/node-docket-parser
court docket dockets government ontario poa provincial-offences
Last synced: 27 days ago
JSON representation
Parses Ontario Provincial Offences docket print data into JavaScript objects.
- Host: GitHub
- URL: https://github.com/cityssm/node-docket-parser
- Owner: cityssm
- License: mit
- Created: 2024-01-18T15:45:12.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-21T18:14:26.000Z (7 months ago)
- Last Synced: 2024-11-20T02:12:48.878Z (about 1 month ago)
- Topics: court, docket, dockets, government, ontario, poa, provincial-offences
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@cityssm/docket-parser
- Size: 157 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# node-docket-parser
[![npm (scoped)](https://img.shields.io/npm/v/%40cityssm/docket-parser)](https://www.npmjs.com/package/@cityssm/docket-parser)
[![DeepSource](https://app.deepsource.com/gh/cityssm/node-docket-parser.svg/?label=active+issues&show_trend=true&token=muETDEKU2ZUoWkSe81VYZ-B5)](https://app.deepsource.com/gh/cityssm/node-docket-parser/)
[![Maintainability](https://api.codeclimate.com/v1/badges/80854a0809d920b041fa/maintainability)](https://codeclimate.com/github/cityssm/node-docket-parser/maintainability)
[![codecov](https://codecov.io/gh/cityssm/node-docket-parser/graph/badge.svg?token=TK0MPXJYP5)](https://codecov.io/gh/cityssm/node-docket-parser)Parses Ontario Provincial Offences docket print data into JavaScript objects.
## Installation
```sh
npm install @cityssm/docket-parser
```## Usage
```javascript
import { parseDockets } from '@cityssm/docket-parser'const docketFileText = fs.readFileSync('test/dockets/whovilleDocket.txt').toString()
const docket = parseDockets(docketFileText)
console.log(docket)
/*
{
"docketDescription": "POA - ALL",
"pageNumber": 1,
"court": "1234",
"room": "POA",
"prosecutor": "MAYWHO, A",
"courtDate": "2024/01/10",
"courtTime": "09:30",
"justiceOfThePeace": "WHOVIER, M",
"clerk": "WHO, C",
"docketItems": [
{
"lineNumber": 1,
"informationNumber": "999 XX XXX -00",
"defendantBirthDate": "1970/01/01",
"counts": 1,
"appTypeNumber": "FA 0",
"appTypeDescription": "First Appearance",
"compBadgeNumber": "XXXXX 0000",
"offenceDate": "2023/12/24",
"defendantName": "GRINCH, THE",
"offenceDescription": "STEALING CHRISTMAS",
"action": "WD",
"actionDescription": "Withdrawn",
"crEl": "",
"plea": "",
"find": "",
"comment": "WITHDRAWN"
}
]
}
*/
```