=======================
Date master is a python library which helps you to manage and display your entered date based on your project requirement. Just take a look into the use cases of date master.
1) Get the current date
2) Get the current day, month and year
3) Get the date 'n' days before and after from the current date
4) Get the date 'n' days before and after from the custom date
5) Change the order of date
Eg: dd/mm/yyyy to yyyy/mm/dd
6) Change the format of your date(integer to string or string to interger)
Eg: 31/8/2022 to 31/August/Two Thousand and Twenty Two
7) Change the split value
Eg: 31 / 8 / 2022 to 31 | 8 | 2022
8) Compare two dates(==, <, <=, >, >=)
9) Check wether the year is leapyear or not
**Parameters**
beautiful_date() parameters
1) date = Date that you have entered(value type = Integer)
2) order = Specifies the order of your date that you want to display(value type = String)
3) format = Specifies the format of your date that you want to display string(str) or integer(int)(value type = String)
4) split_by = Specifies the split value(value type = String)
get_date parameters and methods
1) today() = Get the current date
1.1) today(n) = Get the date 'n' days after from the current date
1.2) today(-n) = Get the date 'n' days before from the current date
2) day() = Get the current day
3) month() = Get the current month
4) year() = Get the current year
check_date parameters and methods
1) compare('date1','operator','date2') = Compare two dates
1.1) compare('date1', '==', 'date2') = Check wether the date1 and date2 are equal
1.2) compare('date1', '<', 'date2') = Check wether the date1 is less than date2
1.3) compare('date1', '<=', 'date2') = Check wether the date1 is less than or equal to date2
1.4) compare('date1', '>', 'date2') = Check wether the date1 greater than date2
1.5) compare('date1', '>=', 'date2') = Check wether the date1 is greater than or equal to date2
2) isleapyear(year) = check wether the year is leapyear or not
**Constraints**
beautiful_date() constraints
1) beautiful_date param must be a dict of values
2) 'date' is a mandatory param for all your request in dd,mm,yyyy format
get_date constraints
1) Get date have multiple methods they are today(), day(), month(), year()
2) today() is the only method have parameter. It will be a positive or negative number "represented by minus sign" or leave as empty
check_date constraints
1) check_date consist two methods they are compare() and isleapyear()
2) compare need 3 parameters and they are in the order date1, operator, date2
2.1) date1 and date2 is a custom date or current date. current date represented by the string 'today'
2.2) operators are equalto(==), less than(<), less than or equalto(<=), greater than(>), greater than or equalto(>=)
3) isleapyear(year) have only one parameter. It will be a positive integer value.
Installing
=======================
pip install date-master
Usage - beautiful_date()
=======================
from date_master.date import beautiful_date
date = ['today'] or # current date
['today',2] or # date after 2 days from the current date
['today',-10] # date before 10 days from the current date
[31, 8, 2022] or # Custom date
[[31, 8, 2022],2] or # date after 2 days from the custom date
[[31, 8, 2022],-10] or # date before 10 days from the custom date
order = ['DD','YYYY','MM']
format = ['int','str','str']
split_by = ['|']
params = {
'date':date,
'order':order,
'format':format,
'split_by':split_by
}
result = beautiful_date(params)
print(result)
Result
====================
>> 31| 'Two Thousand and Twenty Two'| 'August'
**Usecase 1** :- Get the current date
Constraints :
date contain a value that must be 'today'
date = ['today']
params = {
'date':date
}
result = beautiful_date(params)
print(result)
Result
====================
>> [31, 8, 2022]
**Usecase 2** :- Get date after 2 days from the current date
Constraints :
date contain 2 value that must be 'today' and the number of days from current date
date = ['today', 2]
params = {
'date':date
}
result = beautiful_date(params)
print(result)
Result
====================
>> [2, 9, 2022]
**Usecase 3** :- Get date before 10 days from the current date
Constraints :
date contain 2 value that must be 'today' and the number of days from current date. Second value must be negative integer
date = ['today', -10]
params = {
'date':date
}
result = beautiful_date(params)
print(result)
Result
====================
>> [21, 8, 2022]
**Usecase 4** :- Custom date
Constraints :
date contain a value that must be your date
date = [31, 8, 2022]
params = {
'date':date
}
result = beautiful_date(params)
print(result)
Result
====================
>> [31, 8, 2022]
**Usecase 5** :- Get date after 2 days from the custom date
Constraints :
date contain 2 value that must be your custom date and the number of days from that date
date = [[31, 8, 2022], 2]
params = {
'date':date
}
result = beautiful_date(params)
print(result)
Result
====================
>> [2, 9, 2022]
**Usecase 6** :- Get date before 10 days from the custom date
Constraints :
date contain 2 value that must be your custom date and the number of days from that date. Second value must be negative integer
date = [[31, 8, 2022], -10]
params = {
'date':date
}
result = beautiful_date(params)
print(result)
Result
====================
>> [21, 8, 2022]
**Usecase 7** :- Changing the 'order' of date
Constraints :
order list contain 3 values that must be 'dd','mm', and 'yyyy'
date = [31, 8, 2022]
order = ['YYYY','DD','MM']
params = {
'date':date,
'order':order
}
result = beautiful_date(params)
print(result)
Result
====================
>> [2022, 31, 8]
**Usecase 8** :- Changing the date 'format'
Constraints :
format contain 3 values that must be 'str' or 'int'
date = [31, 8, 2022]
format = ['int','str','str']
params = {
'date':date,
'format':format
}
result = beautiful_date(params)
print(result)
Result
====================
>> [31, 'August', 'Two Thousand and Twenty Two']
**Usecase 9** :- Changing the 'split_by' value of date
Constraints :
split_by contain a single value, it must be a string
date = [31, 8, 2022]
split_by = ['|']
params = {
'date':date,
'split_by':split_by
}
result = beautiful_date(params)
print(result)
Result
====================
>> [31| 8| 2022]
Usage - get_date
=======================
from date_master.date import get_date
result = get_date.method_name()
print(result)
Result
====================
>> [31, 8, 2022]
**Usecase 1** :- Get the current date
result = get_date.today()
print(result)
Result
====================
>> [31, 8, 2022]
**Usecase 2** :- Get the date 5 days after from the current date
result = get_date.today(5)
print(result)
Result
====================
>> [5, 9, 2022]
**Usecase 3** :- Get the date 5 days before from the current date
result = get_date.today(-5)
print(result)
Result
====================
>> [26, 8, 2022]
**Usecase 4** :- Get the current day
result = get_date.day()
print(result)
Result
====================
>> 31
**Usecase 5** :- Get the current month
result = get_date.month()
print(result)
Result
====================
>> 8
**Usecase 6** :- Get the current year
result = get_date.year()
print(result)
Result
====================
>> 2022
Usage - check_date
=======================
from date_master.date import check_date
result = check_date.method_name()
print(result)
Result
====================
>> True or False
**Usecase 1** :- Check wether both date are equal
result = check_date.compare('31/08/2022','==','31/08/2022')
print(result)
Result
====================
>> True
**Usecase 2** :- Check wether the date1 is less than date2
result = check_date.compare('31/08/2022','<','30/08/2022')
print(result)
Result
====================
>> False
**Usecase 3** :- Check wether the date1 is less than or equal to date2
result = check_date.compare('31/08/2022','<=','31/08/2022')
print(result)
Result
====================
>> True
**Usecase 4** :- Check wether the date1 is greater than date2
result = check_date.compare('31/08/2022','>','01/09/2022')
print(result)
Result
====================
>> False
**Usecase 5** :- Check wether the date1 is greater than or equal to date2
result = check_date.compare('01/09/2022','>=','01/09/2022')
print(result)
Result
====================
>> True
**Usecase 6** :- Check wether the year is leapyear or not
result = check_date.isleapyear(2000)
print(result)
Result
====================
>> True
Raw data
{
"_id": null,
"home_page": "https://github.com/programspeaker/date_master",
"name": "date-master",
"maintainer": "Sarath Chandran",
"docs_url": null,
"requires_python": "",
"maintainer_email": "sarath1plaza@gmail.com",
"keywords": "date_master",
"author": "Sarath Chandran",
"author_email": "programspeaker@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a7/21/433f3666dd0facca173403138f1d5a648c2ccc5c70d29b199d741c702a7d/date_master-2.0.2.tar.gz",
"platform": null,
"description": "=======================\n\nDate master is a python library which helps you to manage and display your entered date based on your project requirement. Just take a look into the use cases of date master. \n\n 1) Get the current date \n 2) Get the current day, month and year \n 3) Get the date 'n' days before and after from the current date \n 4) Get the date 'n' days before and after from the custom date \n 5) Change the order of date \n Eg: dd/mm/yyyy to yyyy/mm/dd\n 6) Change the format of your date(integer to string or string to interger)\n Eg: 31/8/2022 to 31/August/Two Thousand and Twenty Two\n 7) Change the split value\n Eg: 31 / 8 / 2022 to 31 | 8 | 2022\n 8) Compare two dates(==, <, <=, >, >=)\n 9) Check wether the year is leapyear or not\n\n\n\n**Parameters**\n\n\nbeautiful_date() parameters\n\n 1) date = Date that you have entered(value type = Integer)\n 2) order = Specifies the order of your date that you want to display(value type = String)\n 3) format = Specifies the format of your date that you want to display string(str) or integer(int)(value type = String)\n 4) split_by = Specifies the split value(value type = String)\n\n\nget_date parameters and methods\n\n 1) today() = Get the current date\n 1.1) today(n) = Get the date 'n' days after from the current date\n 1.2) today(-n) = Get the date 'n' days before from the current date\n 2) day() = Get the current day\n 3) month() = Get the current month\n 4) year() = Get the current year\n\n\ncheck_date parameters and methods\n\n 1) compare('date1','operator','date2') = Compare two dates\n 1.1) compare('date1', '==', 'date2') = Check wether the date1 and date2 are equal\n 1.2) compare('date1', '<', 'date2') = Check wether the date1 is less than date2\n 1.3) compare('date1', '<=', 'date2') = Check wether the date1 is less than or equal to date2\n 1.4) compare('date1', '>', 'date2') = Check wether the date1 greater than date2\n 1.5) compare('date1', '>=', 'date2') = Check wether the date1 is greater than or equal to date2\n 2) isleapyear(year) = check wether the year is leapyear or not\n\n\n**Constraints**\n\n\nbeautiful_date() constraints\n\n 1) beautiful_date param must be a dict of values\n 2) 'date' is a mandatory param for all your request in dd,mm,yyyy format\n\n\nget_date constraints\n\n 1) Get date have multiple methods they are today(), day(), month(), year()\n 2) today() is the only method have parameter. It will be a positive or negative number \"represented by minus sign\" or leave as empty\n\n\ncheck_date constraints\n\n 1) check_date consist two methods they are compare() and isleapyear()\n 2) compare need 3 parameters and they are in the order date1, operator, date2\n 2.1) date1 and date2 is a custom date or current date. current date represented by the string 'today'\n 2.2) operators are equalto(==), less than(<), less than or equalto(<=), greater than(>), greater than or equalto(>=)\n 3) isleapyear(year) have only one parameter. It will be a positive integer value.\n\n\n\nInstalling\n=======================\n \n pip install date-master\n\nUsage - beautiful_date()\n=======================\n\n from date_master.date import beautiful_date\n \n date = ['today'] or # current date\n ['today',2] or # date after 2 days from the current date\n ['today',-10] # date before 10 days from the current date\n\n [31, 8, 2022] or # Custom date\n [[31, 8, 2022],2] or # date after 2 days from the custom date\n [[31, 8, 2022],-10] or # date before 10 days from the custom date\n \n order = ['DD','YYYY','MM']\n format = ['int','str','str']\n split_by = ['|']\n\n\n params = {\n 'date':date,\n 'order':order,\n 'format':format,\n 'split_by':split_by\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> 31| 'Two Thousand and Twenty Two'| 'August'\n \n\n**Usecase 1** :- Get the current date\n\nConstraints : \n date contain a value that must be 'today'\n\n date = ['today']\n\n params = {\n 'date':date\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [31, 8, 2022]\n\n\n**Usecase 2** :- Get date after 2 days from the current date\n\nConstraints : \n date contain 2 value that must be 'today' and the number of days from current date\n\n date = ['today', 2]\n\n params = {\n 'date':date\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [2, 9, 2022]\n\n\n**Usecase 3** :- Get date before 10 days from the current date\n\nConstraints : \n date contain 2 value that must be 'today' and the number of days from current date. Second value must be negative integer\n\n date = ['today', -10]\n\n params = {\n 'date':date\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [21, 8, 2022]\n\n\n\n**Usecase 4** :- Custom date\n\nConstraints : \n date contain a value that must be your date\n\n date = [31, 8, 2022]\n\n params = {\n 'date':date\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [31, 8, 2022]\n\n\n**Usecase 5** :- Get date after 2 days from the custom date\n\nConstraints : \n date contain 2 value that must be your custom date and the number of days from that date\n\n date = [[31, 8, 2022], 2]\n\n params = {\n 'date':date\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [2, 9, 2022]\n\n\n**Usecase 6** :- Get date before 10 days from the custom date\n\nConstraints :\n date contain 2 value that must be your custom date and the number of days from that date. Second value must be negative integer\n\n date = [[31, 8, 2022], -10]\n\n params = {\n 'date':date\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [21, 8, 2022]\n\n\n**Usecase 7** :- Changing the 'order' of date\n\nConstraints : \n order list contain 3 values that must be 'dd','mm', and 'yyyy'\n\n date = [31, 8, 2022]\n order = ['YYYY','DD','MM']\n\n params = {\n 'date':date,\n 'order':order\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [2022, 31, 8]\n\n\n**Usecase 8** :- Changing the date 'format'\n\nConstraints : \n format contain 3 values that must be 'str' or 'int'\n\n date = [31, 8, 2022]\n format = ['int','str','str']\n\n params = {\n 'date':date,\n 'format':format\n }\n\n result = beautiful_date(params)\n print(result)\n\n Result\n ====================\n >> [31, 'August', 'Two Thousand and Twenty Two']\n\n\n**Usecase 9** :- Changing the 'split_by' value of date\n\nConstraints : \n split_by contain a single value, it must be a string\n\n date = [31, 8, 2022]\n split_by = ['|']\n\n params = {\n 'date':date,\n 'split_by':split_by\n }\n\n result = beautiful_date(params)\n print(result)\n \n Result\n ====================\n >> [31| 8| 2022]\n\n\nUsage - get_date\n=======================\n \n from date_master.date import get_date\n\n result = get_date.method_name()\n print(result)\n \n Result\n ====================\n >> [31, 8, 2022]\n \n\n**Usecase 1** :- Get the current date \n\n result = get_date.today()\n print(result)\n \n Result\n ====================\n >> [31, 8, 2022]\n\n\n**Usecase 2** :- Get the date 5 days after from the current date \n\n result = get_date.today(5)\n print(result)\n \n Result\n ====================\n >> [5, 9, 2022]\n\n\n**Usecase 3** :- Get the date 5 days before from the current date \n\n result = get_date.today(-5)\n print(result)\n \n Result\n ====================\n >> [26, 8, 2022]\n\n**Usecase 4** :- Get the current day \n\n result = get_date.day()\n print(result)\n \n Result\n ====================\n >> 31\n\n**Usecase 5** :- Get the current month \n\n result = get_date.month()\n print(result)\n \n Result\n ====================\n >> 8\n\n**Usecase 6** :- Get the current year \n\n result = get_date.year()\n print(result)\n \n Result\n ====================\n >> 2022\n\n\nUsage - check_date\n=======================\n \n from date_master.date import check_date\n\n result = check_date.method_name()\n print(result)\n \n Result\n ====================\n >> True or False\n\n\n **Usecase 1** :- Check wether both date are equal \n\n result = check_date.compare('31/08/2022','==','31/08/2022')\n print(result)\n \n Result\n ====================\n >> True\n\n **Usecase 2** :- Check wether the date1 is less than date2 \n\n result = check_date.compare('31/08/2022','<','30/08/2022')\n print(result)\n \n Result\n ====================\n >> False\n\n **Usecase 3** :- Check wether the date1 is less than or equal to date2\n\n result = check_date.compare('31/08/2022','<=','31/08/2022')\n print(result)\n \n Result\n ====================\n >> True\n\n **Usecase 4** :- Check wether the date1 is greater than date2 \n\n result = check_date.compare('31/08/2022','>','01/09/2022')\n print(result)\n \n Result\n ====================\n >> False\n\n **Usecase 5** :- Check wether the date1 is greater than or equal to date2 \n\n result = check_date.compare('01/09/2022','>=','01/09/2022')\n print(result)\n \n Result\n ====================\n >> True\n\n **Usecase 6** :- Check wether the year is leapyear or not\n\n result = check_date.isleapyear(2000)\n print(result)\n \n Result\n ====================\n >> True\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Date Master - A complete date solution",
"version": "2.0.2",
"project_urls": {
"Homepage": "https://github.com/programspeaker/date_master"
},
"split_keywords": [
"date_master"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "618100740592eb56989831209326ec661aee35216beef72ae792854314426b5f",
"md5": "677268a9db98590a431fe45c749e105c",
"sha256": "b1c11c57a84dc2fa0076608d482eeb9c3c38fa689cbace89f950ba9f73cee881"
},
"downloads": -1,
"filename": "date_master-2.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "677268a9db98590a431fe45c749e105c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9580,
"upload_time": "2023-10-09T06:55:33",
"upload_time_iso_8601": "2023-10-09T06:55:33.406494Z",
"url": "https://files.pythonhosted.org/packages/61/81/00740592eb56989831209326ec661aee35216beef72ae792854314426b5f/date_master-2.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a721433f3666dd0facca173403138f1d5a648c2ccc5c70d29b199d741c702a7d",
"md5": "4d5ef5d214b92b69f6fb420610a23af5",
"sha256": "e8d9ffb24261c725b00eae349032b8ecdf11cc447fa46c982b044e0fc5b240a2"
},
"downloads": -1,
"filename": "date_master-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "4d5ef5d214b92b69f6fb420610a23af5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10145,
"upload_time": "2023-10-09T06:55:36",
"upload_time_iso_8601": "2023-10-09T06:55:36.418672Z",
"url": "https://files.pythonhosted.org/packages/a7/21/433f3666dd0facca173403138f1d5a648c2ccc5c70d29b199d741c702a7d/date_master-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-09 06:55:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "programspeaker",
"github_project": "date_master",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "date-master"
}