{"id":13817572,"url":"https://github.com/pylover/khayyam","last_synced_at":"2025-04-05T20:07:03.036Z","repository":{"id":6085268,"uuid":"7311943","full_name":"pylover/khayyam","owner":"pylover","description":"A Persian Date \u0026 Time (aka: Jalali Calendar) library with timezone, DST (daylight-saving), full formatting \u0026 parsing support for python 2.x \u0026 3.x.","archived":false,"fork":false,"pushed_at":"2024-03-14T13:03:22.000Z","size":7359,"stargazers_count":145,"open_issues_count":14,"forks_count":22,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T19:02:56.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://khayyam.dobisel.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pylover.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-12-24T22:22:23.000Z","updated_at":"2025-01-25T08:56:28.000Z","dependencies_parsed_at":"2024-01-13T15:37:42.467Z","dependency_job_id":"625943fb-9a63-441a-bf2d-b181e7b245ef","html_url":"https://github.com/pylover/khayyam","commit_stats":{"total_commits":255,"total_committers":8,"mean_commits":31.875,"dds":"0.29803921568627456","last_synced_commit":"9a2d3be9691ab642b333c05ac3879626444e1156"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fkhayyam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fkhayyam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fkhayyam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fkhayyam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pylover","download_url":"https://codeload.github.com/pylover/khayyam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393569,"owners_count":20931812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-04T06:00:51.106Z","updated_at":"2025-04-05T20:07:03.007Z","avatar_url":"https://github.com/pylover.png","language":"Python","funding_links":[],"categories":["پایتون Python","Python","📚 فهرست"],"sub_categories":["کتابخانه‌های ساخته شده توسط ایرانی‌ها"],"readme":"khayyam\n=======\n\n.. image:: http://img.shields.io/pypi/v/khayyam.svg\n     :target: https://pypi.python.org/pypi/khayyam\n\n.. image:: https://travis-ci.org/pylover/khayyam.svg?branch=master\n     :target: https://travis-ci.org/pylover/khayyam\n\n.. image:: https://coveralls.io/repos/github/pylover/khayyam/badge.svg?branch=master\n     :target: https://coveralls.io/github/pylover/khayyam?branch=master\n\n.. image:: https://img.shields.io/badge/license-GPLv3-brightgreen.svg\n     :target: https://github.com/pylover/khayyam/blob/master/LICENSE\n\n.. image:: https://pepy.tech/badge/khayyam\n     :target: https://pepy.tech/project/khayyam\n\n.. image:: https://pepy.tech/badge/khayyam/month\n     :target: https://pepy.tech/project/khayyam\n\n.. image:: https://pepy.tech/badge/khayyam/week\n     :target: https://pepy.tech/project/khayyam\n\nJump To:\n^^^^^^^^\n\n * `Documentation \u003chttp://khayyam.dobisel.com\u003e`_\n * `Python package index \u003chttps://pypi.python.org/pypi/khayyam\u003e`_\n * `Source on github \u003chttps://github.com/pylover/khayyam\u003e`_\n * `Downloads \u003chttps://pypi.python.org/pypi/Khayyam#downloads\u003e`_\n\n\nBasic Usage\n^^^^^^^^^^^\n\n    \u003e\u003e\u003e from khayyam import *\n    \u003e\u003e\u003e JalaliDate(1346, 12, 30)\n    khayyam.JalaliDate(1346, 12, 30, Chaharshanbeh)\n    \n    \u003e\u003e\u003e JalaliDatetime(989, 3, 25, 10, 43, 23, 345453)\n    khayyam.JalaliDatetime(989, 3, 25, 10, 43, 23, 345453, Seshanbeh)\n\nCurrent date and time\n^^^^^^^^^^^^^^^^^^^^^\n\n    \u003e\u003e\u003e print(JalaliDatetime.now())\n    khayyam.JalaliDatetime(1394, 5, 18, 16, 4, 48, 628383, Yekshanbeh)\n\n    \u003e\u003e\u003e print(JalaliDatetime.now(TehranTimezone()) - timedelta(days=6*30))\n    1393-11-02 20:01:11.663719+03:30\n  \n    \u003e\u003e\u003e print(JalaliDate.today())\n    1394-4-30\n  \n\nParsing \u0026 Formatting\n^^^^^^^^^^^^^^^^^^^^\n\n    \u003e\u003e\u003e print(JalaliDatetime.now().strftime('%C'))\n    شنبه ۳ مرداد ۱۳۹۴ ۰۲:۳۷:۵۲ ب.ظ\n    \n    \u003e\u003e\u003e JalaliDatetime.strptime(u'چهارشنبه ۳۱ تیر ۱۳۹۴ ۰۵:۴۵:۴۰ ب.ظ', '%C')\n    khayyam.JalaliDatetime(1394, 4, 31, 17, 45, 40, 0, Chaharshanbeh)\n\nConverting\n^^^^^^^^^^\n\n    \u003e\u003e\u003e from datetime import date, datetime\n    \u003e\u003e\u003e JalaliDate(1394, 4, 31).todate()\n    datetime.date(2015, 7, 22)\n  \n    \u003e\u003e\u003e now = JalaliDatetime(1394, 4, 31, 15, 38, 6, 37269)\n    \u003e\u003e\u003e now.todate()\n    datetime.date(2015, 7, 22)\n  \n    \u003e\u003e\u003e now.todatetime()\n    datetime.datetime(2015, 7, 22, 15, 38, 6, 37269)\n  \n    \u003e\u003e\u003e JalaliDatetime(datetime(2015, 7, 22, 14, 47, 9, 821830))\n    khayyam.JalaliDatetime(1394, 4, 31, 14, 47, 9, 821830, Chaharshanbeh)\n  \n    \u003e\u003e\u003e JalaliDatetime(datetime(2015, 7, 22, 14, 47, 9, 821830, TehranTimezone()))\n    khayyam.JalaliDatetime(1394, 4, 31, 14, 47, 9, 821830, tzinfo=+03:30 dst:60, Chaharshanbeh)\n  \n    \u003e\u003e\u003e JalaliDate(date(2015, 7, 22))\n    khayyam.JalaliDate(1394, 4, 31, Chaharshanbeh)\n\nArithmetics \u0026 Operators\n^^^^^^^^^^^^^^^^^^^^^^^\n\n    \u003e\u003e\u003e from datetime import timedelta\n    \u003e\u003e\u003e from khayyam import JalaliDate, JalaliDatetime\n    \u003e\u003e\u003e now = JalaliDatetime(1394, 4, 31, 16, 17, 31, 374398)\n    \u003e\u003e\u003e now + timedelta(days=1)\n    khayyam.JalaliDatetime(1394, 5, 1, 16, 17, 31, 374398, Panjshanbeh)\n  \n    \u003e\u003e\u003e now + timedelta(seconds=3600)\n    khayyam.JalaliDatetime(1394, 4, 31, 17, 17, 31, 374398, Chaharshanbeh)\n  \n    \u003e\u003e\u003e now - timedelta(seconds=3600)\n    khayyam.JalaliDatetime(1394, 4, 31, 15, 17, 31, 374398, Chaharshanbeh)\n  \n    \u003e\u003e\u003e yesterday = now - timedelta(1)\n    \u003e\u003e\u003e yesterday\n    khayyam.JalaliDatetime(1394, 4, 30, 16, 17, 31, 374398, Seshanbeh)\n  \n    \u003e\u003e\u003e now - yesterday\n    datetime.timedelta(1)\n  \n    \u003e\u003e\u003e JalaliDatetime.now() - now\n    datetime.timedelta(0, 478, 328833) # 478 seconds taken to writing this section\n\n\nComparison\n^^^^^^^^^^\n\n    \u003e\u003e\u003e now \u003e yesterday\n    True\n  \n    \u003e\u003e\u003e now != yesterday\n    True\n  \n    \u003e\u003e\u003e now.todate() == yesterday.todate()\n    False\n\n\nChange Log\n^^^^^^^^^^\n\n* 3.0.15:\n    * BUGFIX: Removing `from sphinx.util import inspect` from jalali_datetime.py.\n\n* 3.0.11\n    * Allmost the all API's are documented.\n\n* 3.0.10\n    * Imoprting JalaliDateFormatter \u0026 JalaliDatetimeFormatter in __init__.py\n    * Accept also callable in JalaliDatetime.__init__(tzinfo=...) for tzinfo argument.\n    * JalaliDatetime APIs, well documented.\n\n* 3.0.9\n    * Removing pypy from travis, due the travis bug: buffer overflow !\n\n\n* 3.0.0\n    * Raising TypeError instead of ValueError on overloaded operators, if the given type is mismatch.\n    * Fixing tests to pass on systems that configured as UTC.\n    * 100% Code coverage\n    * Moving all tests to khayyam/tests\n    * Removing some uncovered, obsolete code lines\n\n* 2.11.0\n    * Using pure C instead of cython. Now the C extension is as fast as possible.\n    * Including OSX in travis.yaml for python 2 \u0026 3\n    * Including pypy 2 \u0026 3 tests in travis.yaml\n\n* 2.10.0\n    * Add english weekday format directive\n\n* 2.9.8\n    * Registering on travis-ci.org\n    * Registering on coveralls.io\n    * Registering on requires.io\n\n* 2.9.7\n    * Fixing problem in setup.py in python3 #15\n\n* 2.9.3\n    * setup.py for windows\n\n* 2.9.1\n    * Release !\n\n* 2.9.1b2\n    * encoding all __repr__ functions\n\n* 2.9.1b1 (2015-07-30)\n    * Fixing setup.py bug\n\n* 2.9.1b0 (2015-07-30)\n    * Using any available C compiler if cython is not available.\n    * Using pure python if any error raised on installation with extension.\n\n* 2.9.0b0 (2015-07-30)\n    * All algorithms reimplemented using cython and static typing, so the calculation\n        with new C extension is very faster than python pure algorithm implementation.\n    * Fallback switch to pure python algorithm implementation, if compiled binaries not available.\n    * Test case(s) for algorithms(C \u0026 Python).\n\n* 2.8.0b1 (2015-07-28)\n    * `Jalalidate.timetuple` method implemented from scratch including unit test.\n    * Some methods with underscore renamed: `JalaliDate.*_ascii` to `JalaliDate.*ascii`\n\n* 2.7.0b2 (2015-07-26)\n    * README.rst\n\n\n* 2.7.0-beta (2015-07-25)\n    * some bug fixes.\n    * method `Jalalidate.fromdate` removed. use constructor instead: `JalaliDate(date)`\n    * method `Jalalidate.fromjulianday` removed. use constructor instead: `JalaliDate(julian_days=..)`\n    * method `Jalalidate.fromdatetime` removed. use constructor instead: `JalaliDatetime(datetime)`\n\n\n* 2.6.0-beta (2015-07-25)\n    * All possible formatting directives(a-z, A-Z) are supported, except: T\n    * All format directives are tested.\n    * Formatting and parsing test cases moved to `khayyam.formatting.tests` package.\n    * In project: docs/html\n    * `JalaliDate.from_julian_days` renamed to `JalaliDate.fromjuliandays`\n    * `JalaliDate.from_julian_days` renamed to `JalaliDate.fromjuliandays`\n    * `JalaliDate.days_in_month` renamed to `JalaliDate.daysinmonth`\n    * `JalaliDate.is_leap` renamed to `JalaliDate.isleap`\n    * `JalaliDatetime` Modern properties.\n    * README.md updated\n\n* 2.5.0-beta (2015-07-23)\n    * Doc: doctest\n    * Doc: formatting and parsing directives table.\n    * Doc: adding examples of new formatting directives in introduction: %D, %J, %R, %N, %n, %F, %h, %i, %r, %s, %o.\n    * local date \u0026 time formats are changed: digits -\u003e persian\n    * Formatting and parsing test cases has been separated\n\n* 2.4.0-beta (2015-07-22)\n    * Persian Numbers\n    * %D, %J, %R, %N, %n, %F, %h, %i, %r, %s, %o directives has been added.\n\n* 2.3.0-alpha (2015-07-22)\n    * Constants are moved to formatting packages except MINYEAR, MAXYEAR ans weekdays.\n    * Doc: Introduction -\u003e Formatting \u0026 parsing\n    * Doc: Introduction -\u003e Converting\n    * New methods `jalaliDate.todate`, `jalaliDate.fromdate`, `jalaliDatetime.todatetime` and `jalaliDatetime.fromdatetime`\n    * Removed methods `jalaliDate.to_date`, `jalaliDate.from_date`, `jalaliDatetime.to_datetime` and `jalaliDatetime.fromdate_time`\n\n\n* 2.2.1-alpha (2015-07-21)\n    * Doc: Reading package's version automatically from khayyam/__init__.py in `sphinx/conf.py`\n    * Doc: Installation: (PYPI, Development version)\n    * Doc: Testing\n    * Doc: Contribution\n\n* 2.2.0-alpha (2015-07-21)\n    * Generating API Documentation\n\n* 2.1.0-alpha (2015-07-20)\n    * Adding ascii weekdayname in `JalaliDatetime` and `JalaliDate` representation(__repr__).\n\n* 2.0.0-alpha (2015-07-19) Incompatible with \u003c 2.0.0\n    * JalaliDate: method `localformat` renamed to `localdateformat`.\n    * JalaliDatetime: method `localformat` renamed to `localdatetimeformat`.\n    * JalaliDatetime: method `localshortformat_ascii` renamed to `localshortformatascii`.\n    * JalaliDatetime: method `localdatetimeformat_ascii` renamed to `localdatetimeformatascii`.\n    * JalaliDatetime: method `ampm_ascii` renamed to `ampmascii`.\n    * JalaliDatetime: Migrating to New Formatter/Parser Engine\n    * TehTz: renamed to TehranTimezone\n    * Comparison and Timezones\n    * Comparison with `datetime.date` \u0026 `datetime.datetime`\n    * Fixing timezone bug\n\n* 1.1.0 (2015-07-17)\n    * JalaliDate: New Formatter/Parser \u0026 full unittests.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpylover%2Fkhayyam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpylover%2Fkhayyam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpylover%2Fkhayyam/lists"}