{ "info": { "author": "Niklas Rosenstein", "author_email": "rosensteinniklas@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# nr.date\n\nThis package provides a fast parser for fixed format date strings with \nsupport for timezone offsets. The goal of this package is to\n\n1. bring support for timezone offsets to Python 2.7\n2. be faster than `dateutil.parser.parse()`\n\nYou can control the regex backend with the `PYTHON_NR_DATE_REGEX_BACKEND`\nenvironment variable. The default is `re`. You can use this variable to\nmake it use the `regex` module instead.\n\nCurrently supported format options are:\n\n- `%Y` – 4 digit year\n- `%m` – 2 digit month\n- `%d` – 2 digit day\n- `%H` – 2 digit hour\n- `%M` – 2 digit minute\n- `%S` – 2 digit second\n- `%f` – arbitrary precision milliseconds\n- `%z` – timezone offset (`[+-]\\d\\d:?\\d\\d` offset or `Z` for UTC)\n\nThe date formats are extensible by using the `register_format_option()`\nfunction or creating a new `FormatOptionSet`.\n\n## API\n\n### `BaseFormatOption()`\n\nBase class for format options.\n\n### `FormatOption(char, dest, regex, parser, render)`\n\nUseful class for creating a new format options.\n\n### `TimezoneFormatOption()`\n\nSpecial format option implementation for matching timezone offset.\n\n### `FormatOptionSet()`\n\nRepresents a set of `BaseFormatOption` objects. Use the `create_date_format()`\nmethod to create a `DateFormat` object from this set and a format string.\n\n### `DateFormat(string, option_set=None)`\n\nCreates a new parser and formatter for dates from a template string. It is\nrecommendable to use `FormatOptionSet.create_date_format()` instead to make\nuse of caching.\n\n### `DateFormatSet(name, formats)`\n\nA collection of `DateFormat` objects that can be parsed successively until a\nfirst match is found. The `format()` method will use the first format in the\nset.\n\n### `root_option_set`\n\nA global `FormatOptionSet`.\n\n### `register_format_option()`\n\nAdd a new format option to the `root_option_set`. This is the same as calling\n`root_option_set.add()`.\n\n### `parse_date(string, fmt)`\n\nParses the date *string* using the specified *fmt* into a `datetime.datetime`\nobject.\n\n### `format_date(date, fmt)`\n\nFormats the *date* using the specified *fmt* into a string.\n\n### `create_format_set(name, formats)`\n\nCreates a new `DateFormatSet` with the specified *formats*.\n\n### `ISO_8601`\n\n### `JAVA_OFFSET_DATETIME`\n\n## Benchmarks\n\nTODO\n\n## Future\n\n* Vendor `dateutil.tz` module?\n\n## Changelog\n\n### v1.1.0 (2019-04-16)\n\n* Fix microsecond (`%f`) formatting\n* Fix parsing of timezone offset with colon (`%z`)\n* Use `pkgutil` instead of `pkg_resources` namespace packages\n\n### v1.0.0 (2019-04-06)\n\n* Initial release", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NiklasRosenstein/python-nr.date", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nr.date", "package_url": "https://pypi.org/project/nr.date/", "platform": "", "project_url": "https://pypi.org/project/nr.date/", "project_urls": { "Homepage": "https://github.com/NiklasRosenstein/python-nr.date" }, "release_url": "https://pypi.org/project/nr.date/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Fast date parsing with timezone offset support.", "version": "1.1.0" }, "last_serial": 5151323, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1c6534b9f53e3696631e428a0e7df236", "sha256": "9329b87eee39c5017ceb86f28cd4b2859032552fe1d3b93a8f0c46c631f36ca0" }, "downloads": -1, "filename": "nr.date-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1c6534b9f53e3696631e428a0e7df236", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5294, "upload_time": "2019-04-06T01:18:07", "url": "https://files.pythonhosted.org/packages/17/4c/cdfb9af568bc02a70fa46df72af3d302ca38b07d6ef93b4fc3ff71727b5d/nr.date-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "9c09c6b0562944f6f53d1a5a418dce08", "sha256": "af94e350c9b3a5b45717533a4b513bd8380d662505f6c05e8a02181e56581ea2" }, "downloads": -1, "filename": "nr.date-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9c09c6b0562944f6f53d1a5a418dce08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5589, "upload_time": "2019-04-16T18:04:56", "url": "https://files.pythonhosted.org/packages/b0/e9/501a285c227f674f1c7aa424fbd6b039dd7afd3310ce0cd840c37d34b645/nr.date-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c09c6b0562944f6f53d1a5a418dce08", "sha256": "af94e350c9b3a5b45717533a4b513bd8380d662505f6c05e8a02181e56581ea2" }, "downloads": -1, "filename": "nr.date-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9c09c6b0562944f6f53d1a5a418dce08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5589, "upload_time": "2019-04-16T18:04:56", "url": "https://files.pythonhosted.org/packages/b0/e9/501a285c227f674f1c7aa424fbd6b039dd7afd3310ce0cd840c37d34b645/nr.date-1.1.0.tar.gz" } ] }