{"id":37074580,"url":"https://github.com/yitistica/month","last_synced_at":"2026-01-14T08:47:17.897Z","repository":{"id":46083258,"uuid":"247508875","full_name":"yitistica/month","owner":"yitistica","description":"A util package that handles datetime at month level.","archived":false,"fork":false,"pushed_at":"2024-02-15T16:30:33.000Z","size":78,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-17T11:28:37.867Z","etag":null,"topics":["datetime","month","python3","utils"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yitistica.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-15T16:48:18.000Z","updated_at":"2022-10-09T16:34:06.000Z","dependencies_parsed_at":"2023-01-21T09:16:33.125Z","dependency_job_id":null,"html_url":"https://github.com/yitistica/month","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/yitistica/month","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yitistica%2Fmonth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yitistica%2Fmonth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yitistica%2Fmonth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yitistica%2Fmonth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yitistica","download_url":"https://codeload.github.com/yitistica/month/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yitistica%2Fmonth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datetime","month","python3","utils"],"created_at":"2026-01-14T08:47:15.213Z","updated_at":"2026-01-14T08:47:17.844Z","avatar_url":"https://github.com/yitistica.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=====\nmonth\n=====\n\n\n.. image:: https://img.shields.io/pypi/v/datetime-month.svg\n        :target: https://pypi.python.org/pypi/datetime-month\n\n..  image:: https://github.com/yitistica/month/actions/workflows/pre-release-test.yml/badge.svg\n        :target: https://github.com/yitistica/month/actions/workflows/pre-release-test.yml\n\n..  image:: https://readthedocs.org/projects/month/badge/?version=latest\n    :target: https://month.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n\nA package that handles calendar months and arithmetic operation of months.\n\nThe package comprises two modules: **month** and **x_month**.\n**month** module provides the base classes for manipulating month-level time.\n**x_month** module extends the base classes from the *month* module to include additional functionalities.\n\n\nInstallation\n------------\n\n.. code-block::\n\n  pip install datetime-month\n\n\nFeatures \u0026 Usage\n----------------\n\nTo construct a month object:\n\n.. code-block:: python\n\n   from month import Month\n   from month import XMonth  # extended month;\n\n   m = Month(2020, 4)\n   xm = XMonth(2020, 4)\n\nAdditional construction methods below can be used to translate a *tuple* (year, month), a *isoformat* string,\nan *ordinal* int and *month-format* string into a **Month** object.\n\n.. code-block:: python\n\n   # constructed from a (year, month) tuple:\n   m = Month.fromtuple((2019, 11))\n\n   # isoformat is defined as a str in \"year-month\" format:\n   m = Month.fromisoformat('2019-12')\n\n   # ordinal (as in date units):\n   m = Month.fromordinal(737390)\n\n   # using string format like datetime:\n   m = Month.strptime('2019/1', '%Y/%m')\n\nFor the representation of the difference between two months, we can use **Mdelta** (similar to *timedelta* in datetime modules). To construct:\n\n.. code-block:: python\n\n   from month import MDelta\n   delta = Mdelta(2)  # Mdelta(months), months: int;\n\n**Mdelta** supports comparisons using operators. It also supports some arithmetic operations (addition, subtraction, and multiplication)\namong Mdelta objects or with Month objects or int objects.\n\n.. code-block:: python\n\n   Mdelta(2) \u003c Mdelta(3)  # returns bool;\n   Mdelta(2) - Mdelta(3)  # returns Mdelta(-1);\n   Mdelta(2) * 2 # returns Mdelta(4);\n\nSome arithmetic operations and comparisons are also supported for **Month** objects.\n\n.. code-block:: python\n\n   Month(2019, 11).add(MDelta(2)) # returns Month(2020, 1);\n   Month(2020, 04) + Mdelta(2)  # returns Month(2020, 6);\n   Month(2020, 1) - 2  # returns Month(2019, 11);\n   Month(2020, 04) \u003c= Month(2020, 06)  # returns True;\n\n**XMonth** is an extended version of **Month** by including some convenient manipulation and sub-level operations.\n\n.. code-block:: python\n\n   xm = XMonth(2019, 11)\n\n   xm.days()  # returns total days in the month;\n\n   xm.first_date()  # returns date(2019,11,1)\n\n   # iterate dates within the month in increment by step days:\n   xm.dates(step=2)\n\n   # iterate months in a given range:\n   XMonth.range(starting_month, ending_month, step=1)\n\nLicense\n--------\n* Free software: MIT license\n\n\nCredits\n-------\nThe repo was initiated using `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyitistica%2Fmonth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyitistica%2Fmonth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyitistica%2Fmonth/lists"}