# pointofview
[](https://pypi.python.org/pypi/pointofview)
[](https://github.com/prosegrinder/python-pointofview/actions/workflows/python-ci.yml)
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/python-pointofview",
"name": "pointofview",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "point of view, text analysis, natural language processing",
"author": "David L. Day",
"author_email": "david@davidlday.com",
"download_url": "https://files.pythonhosted.org/packages/ab/c0/3e7d51576bc568b8000c667d20ec464cff1d1b444739b3d0b3dd3710c343/pointofview-1.1.1.tar.gz",
"platform": null,
"description": "# pointofview\n\n[](https://pypi.python.org/pypi/pointofview)\n[](https://github.com/prosegrinder/python-pointofview/actions/workflows/python-ci.yml)\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": "GPL-3.0-or-later",
"summary": "A Python package for determining a piece of text's point of view (first, second, third, or unknown).",
"version": "1.1.1",
"project_urls": {
"Homepage": "https://github.com/prosegrinder/python-pointofview",
"Repository": "https://github.com/prosegrinder/python-pointofview"
},
"split_keywords": [
"point of view",
" text analysis",
" natural language processing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d1d4e815fe83a65f244e0069cc482942cb1b6b0bd8d8cd9175124b3d40192897",
"md5": "cf1db84d38a9844b984ead061caaca22",
"sha256": "6347c0c5de90a6209ca39a7a7aef88140c138670792ae8d7e44d476d0a0fab4a"
},
"downloads": -1,
"filename": "pointofview-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cf1db84d38a9844b984ead061caaca22",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 15921,
"upload_time": "2025-07-20T22:15:59",
"upload_time_iso_8601": "2025-07-20T22:15:59.986337Z",
"url": "https://files.pythonhosted.org/packages/d1/d4/e815fe83a65f244e0069cc482942cb1b6b0bd8d8cd9175124b3d40192897/pointofview-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "abc03e7d51576bc568b8000c667d20ec464cff1d1b444739b3d0b3dd3710c343",
"md5": "da69b8c68cb15da0f0b8ec38abcf7b00",
"sha256": "5f4dca4cbc29228827def6ae854586761c4d9cbd58622d96c3dd3b41fe58d781"
},
"downloads": -1,
"filename": "pointofview-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "da69b8c68cb15da0f0b8ec38abcf7b00",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 15312,
"upload_time": "2025-07-20T22:16:01",
"upload_time_iso_8601": "2025-07-20T22:16:01.131923Z",
"url": "https://files.pythonhosted.org/packages/ab/c0/3e7d51576bc568b8000c667d20ec464cff1d1b444739b3d0b3dd3710c343/pointofview-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-20 22:16:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "prosegrinder",
"github_project": "python-pointofview",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pointofview"
}