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.
Business day utilities for Polars.
First, you need to install Polars.
Then, you'll need to install polars-business
:
pip install polars-business
Then, if you can run
from datetime import date
import polars_business as plb
print(plb.date_range(date(2023, 1, 1), date(2023, 1, 10), eager=True))
it means installation all worked correctly!
Read the documentation for a little tutorial and API reference.
Say we start with
from datetime import date
import polars as pl
import polars_business as plb
df = pl.DataFrame(
{"date": [date(2023, 4, 3), date(2023, 9, 1), date(2024, 1, 4)]}
)
Let's shift Date
forwards by 5 days, excluding Saturday and Sunday:
result = df.with_columns(
date_shifted=plb.col("date").bdt.offset_by(
'5bd',
weekend=('Sat', 'Sun'),
)
)
print(result)
shape: (3, 2)
┌────────────┬──────────────┐
│ date ┆ date_shifted │
│ --- ┆ --- │
│ date ┆ date │
╞════════════╪══════════════╡
│ 2023-04-03 ┆ 2023-04-10 │
│ 2023-09-01 ┆ 2023-09-08 │
│ 2024-01-04 ┆ 2024-01-11 │
└────────────┴──────────────┘
You can also count the number of business days between two given dates, specify a custom calendar holiday, and create a date range excluding workdays.
Read the documentation for more examples!
Single-threaded performance is:
but note that Polars will take care of parallelisation for you, and that this plugin will fit in with Polars lazy execution and not require any data conversion.
FAQs
Business day utilities for Polars
We found that polars-business 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.