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.
.. image:: https://travis-ci.org/GreatFruitOmsk/tailhead.svg?branch=master
Python tail is a simple implementation of GNU tail and head.
It provides 3 main functions that can be performed on any file-like object that supports seek()
and tell()
.
tail
- read lines from the end of a filehead
- read lines from the top of a filefollow
- read lines as a file growsIt also comes with pytail
, a command line version offering the same functionality as GNU tail. This can be particularly useful on Windows systems that have no tail equivalent.
tailhead on GitHub <tailhead>
_tailhead on Pypi <http://pypi.python.org/pypi/tailhead>
_Install with pip
or easy_install
.
::
pip install tailhead
::
import tailhead f = open('test.txt', 'w') for i in range(11): f.write('Line %d\n' % (i + 1)) f.close()
::
# Get the last 3 lines of the file
tailhead.tail(open('test.txt'), 3)
# ['Line 9', 'Line 10', 'Line 11']
::
# Get the first 3 lines of the file
tailhead.head(open('test.txt'), 3)
# ['Line 1', 'Line 2', 'Line 3']
::
# Follow the file as it grows
for line in tailhead.follow_path('test.txt'):
if line is not None:
print(line)
else:
# sleep
Tailer currently only has doctests.
Run tests with nose::
nosetests --with-doctest tailhead
Run tests with doctest::
python -m doctest -v tailhead/__init__.py
FAQs
tailhead is a simple implementation of GNU tail and head.
We found that tailhead 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.