# Tcalendar and Ttime
This project provides two classes, `Tcalendar` and `Ttime`, which allow for easy manipulation and handling of calendar dates and times in Python.
## Introduction
- `Tcalendar`: This class represents a date on the calendar. It allows for the representation and manipulation of dates, including addition and subtraction of days, comparison of dates, and conversion to and from string representation.
- `Ttime`: This class represents a specific time of day. It allows for the representation and manipulation of time, including addition and subtraction of seconds, comparison of times, and conversion to and from string representation.
## Features
- **Tcalendar**
- Creation of dates based on year, month, and day.
- Leap year detection.
- Getting the name of the month.
- Finding the maximum number of days in a month.
- Determining the day of the week.
- Generating calendar pages.
- Calculating the next and previous days.
- Getting today's date.
- Sorting dates.
- **Ttime**
- Creation of times based on hour, minute, and second.
- Switching between 12-hour and 24-hour formats.
- Getting the current time.
- Sorting times.
- **Tcalendar_time**
- Combines features of `Tcalendar` and `Ttime` classes.
- Creation of datetime objects with date and time components.
- Addition and subtraction of datetime objects.
- Comparison of datetime objects.
- Conversion to and from string representation.
## Usage
Here's how you can use these classes in your Python code:
```python
from tcalendar_ttime import Tcalendar, Ttime
# Create a Tcalendar instance
date = Tcalendar(2024, 5, 24)
# Print the date
print(date) # Output: 2024-05-24
# Create a Ttime instance
mytime = Ttime(13, 30, 0)
mytime.format12() # 12 hour formatting time
# Print the time
print(mytime) # Output: 01:30:00 PM
```
## Installation
You can install the package using pip:
```
pip install tcalendar-ttime
```
## Examples
```
# Example: Adding days to a date
date = Tcalendar(2024, "May", 24)
new_date = date + 7
# Example: Sorting a list of dates
dates = [date, new_date, Tcalendar.today()]
sorted_dates = Tcalendar.sort(dates)
# Create a Tcalendar_time instance
datetime = Tcalendar_time(2024, 5, 24, 1, 30, 0)
# Print the datetime
print(datetime) # Output: 2024-05-24 01:30:00 PM
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tousifanaam/tcalendar",
"name": "tacalendar-ttime",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "ttime, tcalendar, tcalendar_time, tc, tt",
"author": "Tousif Anaam",
"author_email": "tousifanaam@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/98/03/e2a8ede4bb72591f2072515ad117e4747a9a2118fde849f5c1730ea65a0a/tacalendar_ttime-0.2.tar.gz",
"platform": null,
"description": "# Tcalendar and Ttime\r\n\r\nThis project provides two classes, `Tcalendar` and `Ttime`, which allow for easy manipulation and handling of calendar dates and times in Python. \r\n\r\n## Introduction\r\n\r\n- `Tcalendar`: This class represents a date on the calendar. It allows for the representation and manipulation of dates, including addition and subtraction of days, comparison of dates, and conversion to and from string representation.\r\n \r\n- `Ttime`: This class represents a specific time of day. It allows for the representation and manipulation of time, including addition and subtraction of seconds, comparison of times, and conversion to and from string representation.\r\n\r\n## Features\r\n\r\n- **Tcalendar**\r\n - Creation of dates based on year, month, and day.\r\n - Leap year detection.\r\n - Getting the name of the month.\r\n - Finding the maximum number of days in a month.\r\n - Determining the day of the week.\r\n - Generating calendar pages.\r\n - Calculating the next and previous days.\r\n - Getting today's date.\r\n - Sorting dates.\r\n \r\n- **Ttime**\r\n - Creation of times based on hour, minute, and second.\r\n - Switching between 12-hour and 24-hour formats.\r\n - Getting the current time.\r\n - Sorting times.\r\n\r\n- **Tcalendar_time**\r\n - Combines features of `Tcalendar` and `Ttime` classes.\r\n - Creation of datetime objects with date and time components.\r\n - Addition and subtraction of datetime objects.\r\n - Comparison of datetime objects.\r\n - Conversion to and from string representation.\r\n\r\n## Usage\r\n\r\nHere's how you can use these classes in your Python code:\r\n\r\n```python\r\nfrom tcalendar_ttime import Tcalendar, Ttime\r\n\r\n# Create a Tcalendar instance\r\ndate = Tcalendar(2024, 5, 24)\r\n\r\n# Print the date\r\nprint(date) # Output: 2024-05-24\r\n\r\n# Create a Ttime instance\r\nmytime = Ttime(13, 30, 0)\r\nmytime.format12() # 12 hour formatting time\r\n\r\n# Print the time\r\nprint(mytime) # Output: 01:30:00 PM\r\n```\r\n\r\n## Installation\r\nYou can install the package using pip:\r\n\r\n```\r\npip install tcalendar-ttime\r\n```\r\n\r\n## Examples\r\n```\r\n# Example: Adding days to a date\r\ndate = Tcalendar(2024, \"May\", 24)\r\nnew_date = date + 7\r\n\r\n# Example: Sorting a list of dates\r\ndates = [date, new_date, Tcalendar.today()]\r\nsorted_dates = Tcalendar.sort(dates)\r\n\r\n# Create a Tcalendar_time instance\r\ndatetime = Tcalendar_time(2024, 5, 24, 1, 30, 0)\r\n\r\n# Print the datetime\r\nprint(datetime) # Output: 2024-05-24 01:30:00 PM\r\n```\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Handles date time manipulation with simplicity",
"version": "0.2",
"project_urls": {
"Homepage": "https://github.com/tousifanaam/tcalendar"
},
"split_keywords": [
"ttime",
" tcalendar",
" tcalendar_time",
" tc",
" tt"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9803e2a8ede4bb72591f2072515ad117e4747a9a2118fde849f5c1730ea65a0a",
"md5": "a693ee8c2656549d65f5c2dc0b27f7bd",
"sha256": "cbb4e96023d3ec24bbb40a43a18e899d3fd7e71594923e4c4990f62dbe1340ff"
},
"downloads": -1,
"filename": "tacalendar_ttime-0.2.tar.gz",
"has_sig": false,
"md5_digest": "a693ee8c2656549d65f5c2dc0b27f7bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7791,
"upload_time": "2024-05-24T15:32:32",
"upload_time_iso_8601": "2024-05-24T15:32:32.510007Z",
"url": "https://files.pythonhosted.org/packages/98/03/e2a8ede4bb72591f2072515ad117e4747a9a2118fde849f5c1730ea65a0a/tacalendar_ttime-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-24 15:32:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tousifanaam",
"github_project": "tcalendar",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tacalendar-ttime"
}