
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Simple quarter support for python datetime.date
pip install datetime-quarter
)git clone "https://github.com/BetaS/datetime-quarter"
)from datequarter import DateQuarter
sample = DateQuarter(2019, 4)
print(sample) # 2019 4Q
item = DateQuarter(2019, 4) # 2019 4Q
item = DateQuarter(2018, 8) # 2019 4Q
for convinienceitem = DateQuarter.from_date(datetime.date(2019, 12, 31)) # 2019 4Q
DateQuarter(2019, 4)+1 # 2020 1Q
DateQuarter(2019, 4)-4 # 2018 4Q
DateQuarter(2019, 4) - DateQuarter(2019, 1) # 3Q
DateQuarter(2019, 1) - DateQuarter(2019, 4) # -3Q
DateQuarter
DateQuarter(2019, 1) > DateQuarter(2019, 4) # False
DateQuarter(2019, 1) < DateQuarter(2019, 4) # True
DateQuarter(2019, 1) == DateQuarter(2019, 4) # False
DateQuarter(2019, 1) != DateQuarter(2019, 4) # True
>=
and <=
datetime.date
datetime.date(2019, 12, 31) in DateQuarter(2019, 1) # False
datetime.date(2019, 12, 31) in DateQuarter(2019, 4) # True
>
, >=
and vice versaDateQuarter(2019, 1).start_date() # datetime.date(2019, 1, 1)
DateQuarter(2019, 1).end_date() # datetime.date(2019, 3, 31)
quarter = DateQuarter(2019, 1)
for day in quarter.days():
print(day) # [datetime.date(2019, 1, 1), ..., datetime.date(2019, 3, 31)]
DateQuarter
start = DateQuarter(2019, 1)
end = DateQuarter(2019, 4)
for quarter in DateQuarter.between(start, end):
print(quarter) # [DateQuarter(2019, 1), DateQuarter(2019, 2) , DateQuarter(2019,3)]
FAQs
Simple and lightweight quarter support for python datetime
We found that datetime-quarter 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 researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.