Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
datehelper-now-youre-unemployed
Advanced tools
An exercise to create a Python package, build it, test it, distribute it, and use it. See instructions for details.
A Python utility package for date manipulation
datehelper
is a Python package to help with simple date manipulation tasks. The functions included can help calculate date differences, check for weekends, and help find the date of the next requested weekday. This package can streamline date-related logic in Python projects.
pip
:
pip install datehelper
from datehelper import days_between, add_days, is_weekend, next_weekday
next_weekday(given_date: date, weekday: int) -> date
print(next_weekday(date(2024, 11, 4), 3))
days_between(date1: date, date2: date) -> int
print(days_between(date(2023, 1, 1), date(2023, 1, 10)))
add_days(start_date: date, days: int) -> date
print(add_days(date(2023, 1, 1), 10))
is_weekend(check_date: datetime) -> bool
Checks if a given date falls on a weekend (Saturday or Sunday).
print(is_weekend(datetime(2024, 11, 3)))
For a complete example, see example_date.py
.
First, clone the repository to your local machine:
git clone datehelper repository
cd local/path/to/datehelper
pip install pipenv
pipenv shell
pipenv install --dev
python -m build
rm -rf dist src/*.egg-info
pipenv run pytest
FAQs
A simple date helper library.
We found that datehelper-now-youre-unemployed 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.