Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattrichmo/screenbaby
A WIP of a node.js app to parse PDF screenplays into a JSON object using ScreenJSON Format.
https://github.com/mattrichmo/screenbaby
Last synced: about 9 hours ago
JSON representation
A WIP of a node.js app to parse PDF screenplays into a JSON object using ScreenJSON Format.
- Host: GitHub
- URL: https://github.com/mattrichmo/screenbaby
- Owner: mattrichmo
- License: other
- Created: 2023-08-10T23:14:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-25T15:43:10.000Z (over 1 year ago)
- Last Synced: 2023-08-25T20:20:39.864Z (over 1 year ago)
- Language: JavaScript
- Size: 21.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ScreenBaby
![](./img/banner2-01.jpg)
## Terrible Name. Great Product.
ScreenBaby is a node.js PDF Text Parser to parse Screenplays into JSON Objects
## Script Schema
The Script Schema for ScreenBaby is a JSON object that contains information about the script, including the script title, author, scenes, characters, locations, props, dialogue lines, and more. The schema is structured as follows:
```
|script:
|-scriptTitle:
|-scriptAuthor:
|-scenes:
|-|-{
|-| heading:
|-| sceneID:
|-| sceneIndex:
|-| sceneTitle:
|-| bodyRaw:
|-| body:
|-| animals:
|-| cast:
|-| |-{
|-| | characterName:
|-| | characterLines:
|-| | |-{
|-| | | // Empty object for character lines
|-| | |-}
|-| | characterLineCount:
|-| | charSceneLocations:
|-| | charLines:
|-| | |-{
|-| | | parentScene:
|-| | | |-{
|-| | | | parentSceneTitle:
|-| | | | parentSceneIndex:
|-| | | | parentSceneLines:
|-| | | | |-[]
|-| | | | |-}
|-| | | |-}
|-| | charAppearances:
|-| | |-{
|-| | | parentSceneTitle:
|-| | | parentSceneIndex:
|-| | | parentSceneLines:
|-| | |-}
|-| |-}
|-| locations:
|-| props:
|-| |-{
|-| | propItem:
|-| | propLineLocations:
|-| |-}
|-| lines:
|-| |-{
|-| | lineID:
|-| | lineText:
|-| | sceneHeaderLine:
|-| | importantLine:
|-| | lineNumber:
|-| | lineChars:
|-| | |-{
|-| | | text:
|-| | | charID:
|-| | | x:
|-| | | y:
|-| | | w:
|-| | | clr:
|-| | | sw:
|-| | |-}
|-| |-}
|-| linesCleaned:
|-| |-{
|-| | lineID:
|-| | lineText:
|-| | sceneHeaderLine:
|-| | importantLine:
|-| | lineNumber:
|-| | lineChars:
|-| | |-{
|-| | | text:
|-| | | charID:
|-| | | x:
|-| | | y:
|-| | | w:
|-| | | clr:
|-| | | sw:
|-| | |-}
|-| |-}
|-| elements:
|-| |-{
|-| | elementID:
|-| | parentScene:
|-| | |-{
|-| | | sceneID:
|-| | | sceneIndex:
|-| | | sceneTitle:
|-| | | sceneLineIndex:
|-| | |-}
|-| | groupType:
|-| | dual:
|-| | elementRawLines:
|-| | item:
|-| | |-{
|-| | | name:
|-| | | id:
|-| | | type:
|-| | | sceneLocation:
|-| | |-}
|-| |-}
|-| transitions:
|-| |-{
|-| | item:
|-| |-}
|-| dialogueLines:
|-| |-{
|-| | char:
|-| | lines:
|-| |-}
|-|-}
|-cast:
|-|-{
|-| charName:
|-| charSceneLocations:
|-| charLines:
|-| |-{
|-| | parentScene:
|-| | |-{
|-| | | parentSceneTitle:
|-| | | parentSceneIndex:
|-| | | parentSceneLines:
|-| | | |-[]
|-| | | |-}
|-| | |-}
|-| charAppearances:
|-| |-{
|-| | parentSceneTitle:
|-| | parentSceneIndex:
|-| | parentSceneLines:
|-| |-}
|-|-}
|-docMeta:
|-|-{
|-| numPages:
|-| numLines:
|-| numCharacters:
|-| numProps:
|-| numDialogueLines:
|-|}
```
## UseageUpload your PDF script into ./scripts/ and then provide the filename as an arg in the cli.
Example:
```node main.mjs breakingbadS05E02.pdf```or path to the file
```node main.mjs ./path/to/your/file.pdf ```
# WIP. SO THERE MIGHT BE BUGS.
## Current List of things not working
- elements arents 100% parsing
- some camera is tagged as props
- determine type for each element item in each element group for items with multiple key lements on the same line
## TODO
- parse authors 100%
-use nlp to determine the difference between a key prop and say, an action## License
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "ScreenBaby"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
In other words, do whatever the heck you want with ScreenBaby. We're not responsible for any damage it may cause, but we hope you have fun with it!