holiday-jp / holiday_jp-python Goto Github PK
View Code? Open in Web Editor NEWJapanese holiday for Python
License: MIT License
Japanese holiday for Python
License: MIT License
add the travis.yml file
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
from holiday_jp import HolidayJp
HolidayJp.year_holidays(2017) -> List of HolidayJp
HolidayJp.month_holidays(2017, 5) -> List of HolidayJp
Now:
if HolidayJp('1990-01-01').is_holiday:
print('True')
After
if HolidayJp('31/12/1990', 'DD/MM/YYYYY').is_holiday:
print('True')
As supported with php lib add between:
https://github.com/holiday-jp/holiday_jp-php
$holidays = HolidayJp::between(new DateTime('2010-09-14'), new DateTime('2010-09-21')) echo $holidays[0]['name'] // 敬老の日
Check if Calendar itermonthdates can replace the use of relativedelta in between call so we can remove the requirements.
https://docs.python.org/3.7/library/calendar.html#calendar.Calendar.itermonthdates
For old project still running with python 2.7 can add compatibility.
I didn't made test with Python 2.7.
As before the dataset file was in the source the generate script was reading the file to generate the dates...
Now the dataset is a link to the main project, so instead of reading a file "curl" the url from the raw content.
https://raw.githubusercontent.com/holiday-jp/holiday_jp/master/holidays_detailed.yml
Now we handle the case if the user want to replace the holidays datasets with his own, may be better to set a custom datasets that will be merged with the official one so the user can add and overwrite values. (He can already do it by overwrite the datasets that is a dict, but let's make it more clean).
CUSTOM_HOLIDAY_DATASETS
In case of removing a holiday, maybe need to create a NOT_HOLIDAY_DATASETS that will be set in init
May use this:
https://docs.python.org/3/library/functools.html#functools.lru_cache
and @cached_property
to be able to install it with pip install and put in requirements...
https://pypi.org
Send a list of day (string, date object)
result = HolidayJp.is_there_holiday(["2020-01-01", "2020-10-22", datetime.datetime.today()])
return True or False
result = HolidayJp.which_are_holiday(["2020-01-01", "2020-10-22", datetime.datetime.today()])
result can be
[HolidayJp<1>, ...]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.