Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Python package for determining a piece of text's point of view (first, second, third, or unknown).
A Python package for determining a piece of text's point of view (first, second, third, or unknown).
pointofview
is available on PyPI. Simply install it with pip
:
pip install pointofview
You can also install it from source:
$ git clone https://github.com/prosegrinder/python-pointofview.git
Cloning into 'python-pointofview'...
...
$ cd python-pointofview
$ python setup.py install
...
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):
>>> 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:
>>> 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:
>>> 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': []}
FAQs
A Python package for determining a piece of text's point of view (first, second, third, or unknown).
We found that pointofview demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.