narrative
A small Python package for splitting text into dialogue and 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
Keywords from Contributors
Repository
A small Python package for splitting text into dialogue and narrative.
Basic Info
Statistics
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 10
Topics
Metadata Files
README.md
narrative
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
- Website: https://www.prosegrinder.com
- Repositories: 10
- Profile: https://github.com/prosegrinder
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
Top Committers
| Name | 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
Pull Request Labels
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.
- Homepage: https://github.com/prosegrinder/python-narrative
- Documentation: https://narrative.readthedocs.io/
- License: GPLv3
-
Latest release: 1.2.1
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- 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
- importlib-metadata ^5.1.0
- python ^3.7.2