# pointofview
[](https://pypi.python.org/pypi/pointofview)
[](https://github.com/prosegrinder/python-pointofview/actions?query=workflow%3A%22Python+CI%22+branch%3Amain)
A Python package for determining a piece of text's point of view (first, second,
third, or unknown).
## Installation
`pointofview` is available on PyPI. Simply install it with `pip`:
```bash
pip install pointofview
```
You can also install it from source:
```bash
$ git clone https://github.com/prosegrinder/python-pointofview.git
Cloning into 'python-pointofview'...
...
$ cd python-pointofview
$ python setup.py install
...
```
## Usage
`pointofview` guesses a text's point of view by counting point of view pronouns.
The main function `get_text_pov()` will return 'first', 'second', 'third', or
null (Python's `None` object):
```python
>>> import pointofview
>>> text = "I'm a piece of text written in first person! What are you?"
>>> pointofview.get_text_pov(text)
'first'
```
There are two other helper functions as well.
`get_word_pov()` returns the point of view of a single word:
```python
>>> pointofview.get_word_pov("I")
'first'
>>> pointofview.get_word_pov("nope")
None
```
`parse_pov_words()` returns a dict containing all first-, second-, and
third-person point-of-view words:
<!-- markdownlint-disable MD013 -->
```python
>>> text = """
... When I try to analyze my own cravings, motives, actions and so forth, I surrender to a sort of retrospective imagination which feeds the analytic faculty with boundless alternatives and which causes each visualized route to fork and re-fork without end in the maddeningly complex prospect of my past.
... """
>>> pointofview.parse_pov_words(text)
{'first': ['i', 'i'], 'second': [], 'third': []}
```
<!-- markdownlint-enable MD013 -->
Raw data
{
"_id": null,
"home_page": "https://github.com/prosegrinder/pointofview",
"name": "pointofview",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.2,<4.0.0",
"maintainer_email": "",
"keywords": "",
"author": "David L. Day",
"author_email": "david@davidlday.com",
"download_url": "https://files.pythonhosted.org/packages/b4/20/f682d86d052f34c31cd2508a441c3925c9a2568d30a3c89f3d03aac11d4e/pointofview-1.0.4.tar.gz",
"platform": null,
"description": "# pointofview\n\n[](https://pypi.python.org/pypi/pointofview)\n[](https://github.com/prosegrinder/python-pointofview/actions?query=workflow%3A%22Python+CI%22+branch%3Amain)\n\nA Python package for determining a piece of text's point of view (first, second,\nthird, or unknown).\n\n## Installation\n\n`pointofview` is available on PyPI. Simply install it with `pip`:\n\n```bash\npip install pointofview\n```\n\nYou can also install it from source:\n\n```bash\n$ git clone https://github.com/prosegrinder/python-pointofview.git\nCloning into 'python-pointofview'...\n...\n\n$ cd python-pointofview\n$ python setup.py install\n...\n```\n\n## Usage\n\n`pointofview` guesses a text's point of view by counting point of view pronouns.\nThe main function `get_text_pov()` will return 'first', 'second', 'third', or\nnull (Python's `None` object):\n\n```python\n>>> import pointofview\n>>> text = \"I'm a piece of text written in first person! What are you?\"\n>>> pointofview.get_text_pov(text)\n'first'\n```\n\nThere are two other helper functions as well.\n\n`get_word_pov()` returns the point of view of a single word:\n\n```python\n>>> pointofview.get_word_pov(\"I\")\n'first'\n>>> pointofview.get_word_pov(\"nope\")\nNone\n```\n\n`parse_pov_words()` returns a dict containing all first-, second-, and\nthird-person point-of-view words:\n\n<!-- markdownlint-disable MD013 -->\n\n```python\n>>> text = \"\"\"\n... When I try to analyze my own cravings, motives, actions and so forth, I surrender to a sort of retrospective imagination which feeds the analytic faculty with boundless alternatives and which causes each visualized route to fork and re-fork without end in the maddeningly complex prospect of my past.\n... \"\"\"\n>>> pointofview.parse_pov_words(text)\n{'first': ['i', 'i'], 'second': [], 'third': []}\n```\n\n<!-- markdownlint-enable MD013 -->\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "A Python package for determining a piece of text's point of view (first, second, third, or unknown).",
"version": "1.0.4",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "51468ae84e2f76570466be72421ca6f0",
"sha256": "cb57a9ce9422977763bdac9731423f22ef2710f03d1e32ed560c998c4e9e96d3"
},
"downloads": -1,
"filename": "pointofview-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "51468ae84e2f76570466be72421ca6f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.2,<4.0.0",
"size": 15689,
"upload_time": "2022-12-19T19:46:46",
"upload_time_iso_8601": "2022-12-19T19:46:46.691571Z",
"url": "https://files.pythonhosted.org/packages/17/5c/c2cec987ccb42b192a28f44d2295c68752a82a55cfdfc6ffade1bda6d20b/pointofview-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "39fc8096058d515a1bbd7bc71b798a88",
"sha256": "28ea310a9b19c79b0535423b059594ba125e54692acfa8d01fbffbb4b01eb07b"
},
"downloads": -1,
"filename": "pointofview-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "39fc8096058d515a1bbd7bc71b798a88",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.2,<4.0.0",
"size": 15802,
"upload_time": "2022-12-19T19:46:48",
"upload_time_iso_8601": "2022-12-19T19:46:48.037686Z",
"url": "https://files.pythonhosted.org/packages/b4/20/f682d86d052f34c31cd2508a441c3925c9a2568d30a3c89f3d03aac11d4e/pointofview-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-19 19:46:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "prosegrinder",
"github_project": "pointofview",
"lcname": "pointofview"
}