narrative

A small Python package for splitting text into dialogue and narrative.

https://github.com/prosegrinder/python-narrative

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.2%) to scientific vocabulary

Keywords

dialogue narrative python

Keywords from Contributors

annotation yolov5 optim serializer sequences xunit-test data-structures distribution packaging xunit-framework
Last synced: 6 months ago · JSON representation

Repository

A small Python package for splitting text into dialogue and narrative.

Basic Info
  • Host: GitHub
  • Owner: prosegrinder
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 137 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 10
Topics
dialogue narrative python
Created almost 8 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.md

narrative

Latest PyPI version Python Poetry CI

A small Python package for splitting text into dialogue and narrative.

Installation

narrative is available on PyPI. Simply install it with pip:

bash pip install narrative

Usage

narrative splits a piece of prose into narrative and dialogue components. The main function split() will return a dict containing both narrative and dialogue components:

```python

import narrative text = '"Hello," he said. "How are you today?"' narrative.split(text) {'dialogue': ['"Hello,"', '"How are you today?"'], 'narrative': ['', ' he said. ', '']} ```

There are two other helper functions as well.

get_dialogue() returns only the dialogue components:

```python

narrative.get_dialogue(text) ['"Hello,"', '"How are you today?"'] ```

get_narrative() returns only the narrative components:

```python

narrative.get_narrative(text) ['', ' he said. ', ''] ```

Note: The empty strings are a feature of Python's split() function. See Why are empty strings returned in split() results? for an explanation.

British Style

Each function accepts a second parameter of a regular expression used to parse out the dialogue. This defaults to narrative.DIALOGUE_RE, which follows the American standard of using double quotes for initial quotes. narrative now includes a second regular expression, narrative.BRITISH_DIALOGUE_RE, which follows the British style of using single quotes for initial quotes. Simply use it as the second parameter for any function:

```python

import narrative narrative.split(text, narrative.BRITISHDIALOGUERE) … narrative.getdialogue(text, narrative.BRITISHDIALOGUERE) … narrative.getnarrative(text, narrative.BRITISHDIALOGUERE) … ```

Owner

  • Name: ProseGrinder
  • Login: prosegrinder
  • Kind: organization

GitHub Events

Total
  • Release event: 2
  • Watch event: 1
  • Delete event: 7
  • Issue comment event: 6
  • Push event: 15
  • Pull request review event: 12
  • Pull request event: 18
  • Create event: 9
Last Year
  • Release event: 2
  • Watch event: 1
  • Delete event: 7
  • Issue comment event: 6
  • Push event: 15
  • Pull request review event: 12
  • Pull request event: 18
  • Create event: 9

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 47
  • Total Committers: 6
  • Avg Commits per committer: 7.833
  • Development Distribution Score (DDS): 0.362
Past Year
  • Commits: 22
  • Committers: 5
  • Avg Commits per committer: 4.4
  • Development Distribution Score (DDS): 0.591
Top Committers
Name Email Commits
David L. Day d****6@g****m 30
David L. Day 1****y 10
dependabot[bot] 4****] 4
github-actions[bot] g****] 1
davidlday d****d@d****m 1
dependabot-preview[bot] 2****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 52
  • Average time to close issues: 14 days
  • Average time to close pull requests: 16 days
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.75
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 32
Past Year
  • Issues: 0
  • Pull requests: 12
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.5
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 10
Top Authors
Issue Authors
  • davidlday (1)
  • ceruulean (1)
Pull Request Authors
  • dependabot[bot] (31)
  • davidlday (20)
  • dependabot-preview[bot] (1)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels
dependencies (32) python (22) dependabot-batched (11) github_actions (9) enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,095 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 3
  • Total versions: 9
  • Total maintainers: 1
pypi.org: narrative

A small Python package for splitting text into dialogue and narrative.

  • Versions: 9
  • Dependent Packages: 1
  • Dependent Repositories: 3
  • Downloads: 1,095 Last month
Rankings
Dependent packages count: 4.6%
Dependent repos count: 9.1%
Downloads: 18.3%
Average: 18.8%
Forks count: 29.9%
Stargazers count: 32.0%
Maintainers (1)
Last synced: 7 months ago

Dependencies

poetry.lock pypi
  • astroid 2.12.13 develop
  • attrs 22.1.0 develop
  • black 22.12.0 develop
  • click 8.1.3 develop
  • colorama 0.4.6 develop
  • dill 0.3.6 develop
  • exceptiongroup 1.0.4 develop
  • iniconfig 1.1.1 develop
  • isort 5.10.1 develop
  • lazy-object-proxy 1.8.0 develop
  • mccabe 0.7.0 develop
  • mypy-extensions 0.4.3 develop
  • packaging 22.0 develop
  • pathspec 0.10.3 develop
  • platformdirs 2.6.0 develop
  • pluggy 1.0.0 develop
  • pylint 2.15.8 develop
  • pytest 7.2.0 develop
  • tomli 2.0.1 develop
  • tomlkit 0.11.6 develop
  • typed-ast 1.5.4 develop
  • wrapt 1.14.1 develop
  • importlib-metadata 5.1.0
  • typing-extensions 4.4.0
  • zipp 3.11.0
pyproject.toml pypi
  • importlib-metadata ^5.1.0
  • python ^3.7.2