{ "info": { "author": "Antonis Christofides", "author_email": "antonis@antonischristofides.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=========================================================\nhtimeseries - Hydrological and meteorological time series\n=========================================================\n\n\n.. image:: https://img.shields.io/pypi/v/htimeseries.svg\n :target: https://pypi.python.org/pypi/htimeseries\n\n.. image:: https://img.shields.io/travis/openmeteo/htimeseries.svg\n :target: https://travis-ci.org/openmeteo/htimeseries\n\n.. image:: https://codecov.io/github/openmeteo/htimeseries/coverage.svg\n :target: https://codecov.io/gh/openmeteo/htimeseries\n :alt: Coverage\n\n.. image:: https://pyup.io/repos/github/openmeteo/htimeseries/shield.svg\n :target: https://pyup.io/repos/github/openmeteo/htimeseries/\n :alt: Updates\n\nThis module provides the HTimeseries class, which is a layer on top of\npandas, offering a little more functionality.\n\nIntroduction\n============\n\n::\n\n from htimeseries import HTimeseries\n\n ts = HTimeseries()\n\nThis creates a ``HTimeseries`` object, whose ``data`` attribute is a\npandas time series or dataframe with a datetime index. Besides ``data``,\nit can have other attributes which serve as the time series' metadata.\nThere are also several utility methods described below.\n\nHTimeseries objects\n===================\n\n**HTimeseries(data=None, format=None, start_date=None, end_date=None)**\n\nCreates a ``HTimeseries`` object. ``data`` can be a pandas time series\nor dataframe indexed by datetime or a file-like object. If it is a\npandas object, it becomes the value of the ``data`` attribute and the\nrest of the keyword arguments are ignored.\n\nThe ``data`` attribute should be a dataframe with two columns (besides\ndate): value and flags. However, in this version, ``HTimeseries`` does\nnot enforce that. A good idea is to create an empty ``HTimeseries``\nobject with ``HTimeseries()``, and then proceed to fill in its ``data``\nattribute. This ensures that the dataframe will have the right columns\nand dtypes.\n\nIf the ``data`` argument is a filelike object, the time series is read\nfrom it. There must be no newline translation in ``data`` (open it with\n``open(..., newline='\\n')``. If ``start_date`` and ``end_date`` are\nspecified, it skips rows outside the range.\n\nThe contents of the filelike object can be in text format or file format (see\n\"formats\" below). This usually auto-detected, but a specific format can\nbe specified with the ``format`` parameter. If reading in text format,\nthe returned object just has the ``data`` attribute set. If reading in\nfile format , the returned object also has attributes ``unit``,\n``title``, ``comment``, ``timezone``, ``time_step``,\n``timestamp_rounding``, ``timestamp_offset``, ``interval_type``,\n``variable``, ``precision`` and ``location``. For the meaning of these\nattributes, see section \"File format\" below.\n\nThese attributes are purely informational. In particular, ``time_step``\nand the other time-step-related attributes don't necessarily mean that\nthe pandas object will have a related time step (also called\n\"frequency\"). In fact, raw time series may be irregular but actually\nhave a time step. For example, a ten-minute time series might end in\n:10, :20, etc., but at some point there might be an irregularity and it\ncould continue with :31, :41, etc. Strictly speaking, such a time\nseries has an irregular step. However, when stored in a database,\nspecifying that its time step is ten minutes (because that's what it is,\nten minutes with irregularities) can help people who browse or search\nthe database contents.\n\nThe ``location`` attribute is a dictionary that has items ``abscissa``,\n``ordinate``, ``srid``, ``altitude``, and ``asrid``.\n\n**.write(f, format=HTimeseries.TEXT, version=4)**\n\nWrites the time series to filelike object ``f``. In accordance with the\nformats described below, time series are written\nusing the CR-LF sequence to terminate lines. Care should be taken that\n``f``, or any subsequent operations on ``f``, do not perform text\ntranslation; otherwise it may result in lines being terminated with\nCR-CR-LF. If ``f`` is a file, it should have been opened in binary mode.\n\n``version`` is ignored unless ``format=HTimeseries.FILE``.\n\nWhile writing, the value of the ``precision`` attribute is taken into\naccount.\n\nTzinfoFromString objects\n========================\n\n::\n\n from htimeseries imort TzinfoFromString\n\n atzinfo = TzinfoFromString(\"EET (UTC+0200)\")\n\n``TzinfoFromString`` is a utility that creates and returns a tzinfo_\nobject from a string formatted as \"+0000\" or as \"XXX (+0000)\" or as \"XXX\n(UTC+0000)\" (``TzinfoFromString`` is actually a tzinfo_ subclass). Its\npurpose is to read the contents of the ``timezone`` parameter of the\nfile format (described below).\n\n.. _tzinfo: https://docs.python.org/3/library/datetime.html#tzinfo-objects\n\nFormats\n=======\n\nThere are two formats: the *text format* is generic text format, without\nmetadata; the *file format* is like the text format, but additionally\ncontains headers with metadata.\n\n.. _textformat:\n\nText format\n-----------\n\nThe text format for a time series is us-ascii, one line per record,\nlike this:\n\n 2006-12-23 18:34,18.2,RANGE\n\nThe three fields are comma-separated and must always exist. In the date\nfield, the time may be missing. The character that separates the date\nfrom the time may be either a space or a lower case ``t``, or a capital\n``T`` (this module produces text format using a space as date separator,\nbut can read text format that uses ``t`` or ``T``). The second field\nalways uses a dot as the decimal separator and may be empty. The third\nfield is usually empty but may contain a list of space-separated flags.\nThe line separator should be the CR-LF sequence used in MS-DOS and\nWindows systems. Code that produces text format should always use CR-LF\nto end lines, but code that reads text format should be able to also\nread lines that end in LF only, as well as CR-CR-LF (for reasons\nexplained in the ``write()`` function above).\n\nIn order to improve performance in file writes, the maximum length of\neach time series record line is limited to 255 characters.\n\nFlags should be encoded in ASCII; there must be no characters with\ncode greater than 127.\n\n.. _fileformat:\n\nFile format\n-----------\n\nThe file format is like this::\n\n Version=2\n Title=My timeseries\n Unit=\u00b0C\n\n 2006-12-23 18:34,18.2,RANGE\n 2006-12-23 18:44,18.3,\n\nIn other words, the file format consists of a header that specifies\nparameters in the form ``Parameter=Value``, followed by a blank line,\nfollowed by the timeseries in text format. The same conventions for line\nterminators apply here as for the text format. The encoding of the\nheader section is UTF-8.\n\nClient and server software should recognize UTF-8 files with or without\nUTF-8 BOM (Byte Order Mark) in the begining of file. Writes may or may\nnot include the BOM, according OS. (Usually Windows software attaches\nthe BOM at the beginning of the file).\n\nParameter names are case insensitive. There may be white space on\neither side of the equal sign, which is ignored. Trailing white space on\nthe line is also ignored. A second equal sign is considered to be part\nof the value. The value cannot contain a newline, but there is a way to\nhave multi-lined parameters explained in the Comment parameter below.\nAll parameters except Version are optional: either the value can be\nblank or the entire ``Parameter=Value`` can be missing; the only\nexception is the Comment parameter.\n\nThe parameters available are:\n\n**Version**\n There are four versions:\n\n * Version 1 files are long obsolete. They did not have a header\n section.\n\n * Version 2 files must have ``Version=2`` as the first line of the\n file. All other parameters are optional. The file may not contain\n unrecognized parameters; software reading files with unrecognized\n parameters may raise an error.\n\n * Version 3 files do not have the *Version* parameter. At least one of\n the other parameters must be present. Unrecognized parameters are\n ignored when reading. The deprecated parameter names\n *Nominal_offset* and *Actual_offset* are used instead of the newer\n ones *Timestamp_rounding* and *Timestamp_offset*.\n\n * Version 4 files are the same as Version 3, except for the names of\n the parameters *Timestamp_rounding* and *Timestamp_offset*.\n\n**Unit**\n A symbol for the measurement unit, like ``\u00b0C`` or ``mm``.\n\n**Count**\n The number of records in the time series. If present, it need not be\n exact; it can be an estimate. Its primary purpose is to enable\n progress indicators in software that takes time to read large time\n series files. In order to determine the actual number of records,\n the records need to be counted.\n\n**Title**\n A title for the time series.\n\n**Comment**\n A multiline comment for the time series. Multiline comments are\n stored by specifying multiple adjacent Comment parameters, like\n this::\n\n Comment=This timeseries is extremely important\n Comment=because the comment that describes it\n Comment=spans five lines.\n Comment=\n Comment=These five lines form two paragraphs.\n\n The Comment parameter is the only parameter where a blank value is\n significant and indicates an empty line, as can be seen in the\n example above.\n\n**Timezone**\n The time zone of the timestamps, in the format ``{XXX}\n (UTC{+HHmm})``, where *XXX* is a time zone name and *+HHmm* is the\n offset from UTC. Examples are ``EET (UTC+0200)`` and ``VST\n (UTC-0430)``.\n\n The ``TzinfoFromString`` utility (described above) can be used to\n convert this string to a tzinfo_ object.\n\n**Time_step**\n A comma-separated pair of integers; the number of minutes and months\n in the time step (one of the two mut be zero). If missing, the time\n series is without time step.\n\n**Timestamp_rounding**\n A comma-separated pair of integers indicating the number of minutes\n and months that must be added to a round timestamp to get to the\n nominal timestamp. For example, if an hourly time series has\n timestamps that end in :13, such as 01:13, 02:13, etc., then its\n rounding is 13 minutes, 0 months, i.e., ``(13, 0)``. Monthly time\n series normally have a nominal timestamp of ``(0, 0)``, the\n timestamps usually being of the form 2008-02-01 00:00, meaning\n \"February 2008\" and usually rendered by application software as \"Feb\n 2008\" or \"2008-02\". Annual timestamps have a nominal timestamp which\n normally has 0 minutes, but may have nonzero months; for example, a\n common rounding in Greece is 9 months (0=January), which means that\n an annual timestamp is of the form 2008-10-01 00:00, normally\n rendered by application software as 2008-2009, and denoting the\n hydrological year 2008-2009.\n\n ``timestamp_rounding`` may be None, meaning that the timestamps can\n be irregular.\n\n *Timestamp_rounding* is named differently in older versions. See the\n *Version* parameter above for more information.\n\n**Timestamp_offset**\n A comma-separated pair of integers indicating the number of minutes\n and months that must be added to the nominal timestamp to get to the\n actual timestamp. The timestamp offset for small time steps, such as\n up to daily, is usually zero, except if the nominal timestamp is the\n beginning of an interval, in which case the timestamp offset is\n equal to the length of the time step, so that the actual timestamp\n is the end of the interval. For monthly and annual time steps, the\n timestamp offset is usually 1 and 12 months respectively. For a\n monthly time series, a timestamp offset of (-475, 1) means that\n 2003-11-01 00:00 (often rendered as 2003-11) denotes the interval\n 2003-10-31 18:05 to 2003-11-30 18:05.\n\n *Timestamp_offset* is named differently in older versions. See the\n *Version* parameter above for more information.\n\n**Interval_type**\n Has one of the values ``sum``, ``average``, ``maximum``,\n ``minimum``, and ``vector_average``. If absent it means that the\n time series values are instantaneous, they do not refer to\n intervals.\n\n**Variable**\n A textual description of the variable, such as ``Temperature`` or\n ``Precipitation``.\n\n**Precision**\n The precision of the time series values, in number of decimal digits\n after the decimal separator. It can be negative; for example, a\n precision of -2 indicates values accurate to the hundred, such as\n 100, 200, 300 etc.\n\n**Location**, **Altitude**\n (Versions 3 and later.) *Location* is three numbers,\n space-separated: abscissa, ordinate, and EPSG SRID. *Altitude* is\n one or two space-separated numbers: the altitude and the EPSG SRID\n for altitude. The altitude SRID may be omitted.\n\n\n=======\nHistory\n=======\n\n1.1.2 (2019-07-18)\n==================\n\n- Fixed some altitude-related bugs: 1) It would crash when trying to\n read a file that specified altitude but not location; 2) it wouldn't\n write altitude to the file it the altitude was zero.\n\n1.1.1 (2019-06-12)\n==================\n\n- Fixed crash when Timestamp_rounding=None or Timestamp_offset=None.\n\n1.1.0 (2019-06-08)\n==================\n\n- Added TzinfoFromString utility (moved in here from pthelma).\n\n1.0.1 (2019-06-06)\n==================\n\n- Fixed error in the README (which prevented 1.0.0 from being uploaded\n to PyPi).\n\n1.0.0 (2019-06-06)\n==================\n\n- API change: .read() is gone, now we use a single overloaded\n constructor; either HTimeseries() or HTimeseries(dataframe) or \n HTimeseries(filelike).\n- The columns and dtypes of .data are now standardized and properly\n created even for empty objects (created with HTimeseries()).\n\n0.2.0 (2019-04-09) \n==================\n\n- Auto detect format when reading a file\n\n0.1.0 (2019-01-14)\n==================\n\n- Initial release\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/openmeteo/htimeseries", "keywords": "", "license": "GNU General Public License v3", "maintainer": "", "maintainer_email": "", "name": "htimeseries", "package_url": "https://pypi.org/project/htimeseries/", "platform": "", "project_url": "https://pypi.org/project/htimeseries/", "project_urls": { "Homepage": "https://github.com/openmeteo/htimeseries" }, "release_url": "https://pypi.org/project/htimeseries/1.1.2/", "requires_dist": [ "pandas (>=0.20)", "iso8601", "textbisect" ], "requires_python": "", "summary": "Hydrological and meteorological timeseries", "version": "1.1.2" }, "last_serial": 5550765, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "989f7856f705305717dba54cc966b288", "sha256": "52a6564c3c42b0e05d3bf35ee31f82586782cff15a6302d1627a180606ba33a5" }, "downloads": -1, "filename": "htimeseries-0.1.0.tar.gz", "has_sig": false, "md5_digest": "989f7856f705305717dba54cc966b288", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17337, "upload_time": "2019-01-14T13:30:44", "url": "https://files.pythonhosted.org/packages/4b/fd/cd66a9290b460d6530d695a709249841e8069dd64663912f6444119fbf14/htimeseries-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "89cebebc7cd77afced5085cbf3fe8e03", "sha256": "6cc1503e8d34cde9df6369cb60f6fd1a35a8f82658b16eea013058e17a92882a" }, "downloads": -1, "filename": "htimeseries-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "89cebebc7cd77afced5085cbf3fe8e03", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10512, "upload_time": "2019-04-09T09:32:16", "url": "https://files.pythonhosted.org/packages/8f/09/10dae25e40009fca9fb44af092ea4c1a2fae4669819d0be9098f81bdb312/htimeseries-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "088f533a60ca0c97f30007f05c68df23", "sha256": "71ba22cc4f6bb73b872ca984208878c8f9fbd3493d7f1aa4cf14df8b2a5be5fa" }, "downloads": -1, "filename": "htimeseries-0.2.0.tar.gz", "has_sig": false, "md5_digest": "088f533a60ca0c97f30007f05c68df23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17761, "upload_time": "2019-04-09T09:32:18", "url": "https://files.pythonhosted.org/packages/a4/d5/d3486a82c81ca99ae9fa6ad0f9696248b49d31aae36d22ea1a2a300917bb/htimeseries-0.2.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "d24c6091ae91c073068c6df3db809c79", "sha256": "5074f07bdf0f02f74f553d6e1b0476c074595cf1adb49be36c61247821b5c1cb" }, "downloads": -1, "filename": "htimeseries-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d24c6091ae91c073068c6df3db809c79", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10743, "upload_time": "2019-06-06T10:26:38", "url": "https://files.pythonhosted.org/packages/84/c3/f508d4b9ece9ed31d31037afa2d6b18dfb8152f19b0de768bcf067ee6a69/htimeseries-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edb817c82ebddccb33771bd3fbfbe0cb", "sha256": "cba8ce4d85567694aa473ebcda0c53638cd15602159ab7033a21e7be5a079745" }, "downloads": -1, "filename": "htimeseries-1.0.1.tar.gz", "has_sig": false, "md5_digest": "edb817c82ebddccb33771bd3fbfbe0cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18453, "upload_time": "2019-06-06T10:26:40", "url": "https://files.pythonhosted.org/packages/e6/5a/0518801ddbf41704dd28860c34dccca8ee860b03aaadc4db44259d641a1d/htimeseries-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "467b3039eccdd58302cbd12abfa2f853", "sha256": "757e2a667402c666341d60e8425b1f3054d22571007c11da36c5dfa4a94466b1" }, "downloads": -1, "filename": "htimeseries-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "467b3039eccdd58302cbd12abfa2f853", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11746, "upload_time": "2019-06-08T09:23:10", "url": "https://files.pythonhosted.org/packages/5b/99/f60f38d36cc974a11d9e76733717f428d27a493b4775d35a6e4f7d64c959/htimeseries-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9404918dedf78869b280b9bf01b3515", "sha256": "12815954de0b5916a20f838773ac1af9599f85576978bdcad03ddd8e1371bf1c" }, "downloads": -1, "filename": "htimeseries-1.1.0.tar.gz", "has_sig": false, "md5_digest": "f9404918dedf78869b280b9bf01b3515", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19786, "upload_time": "2019-06-08T09:23:12", "url": "https://files.pythonhosted.org/packages/9c/16/5d711bb57836db98a48d3a36e1ed1f4c86a5870f47ebaf9a8724aa0eb959/htimeseries-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "7ae30d256a7dfd9218520bb02bc70734", "sha256": "c453beeddbd9ac09c15b548788e99f31e7232a16949fc373fa1779d97f9a31bd" }, "downloads": -1, "filename": "htimeseries-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7ae30d256a7dfd9218520bb02bc70734", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11785, "upload_time": "2019-06-12T11:44:47", "url": "https://files.pythonhosted.org/packages/16/28/08dbc98380486a9fc8d698902d6f3441ce575e691c44863c66ca1c306b54/htimeseries-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aab710d7b085a70dfb3f4fd2f28b9bc1", "sha256": "2878f24a5e0e613b5d58b9a119a5ec32db44296ee51d4ee958dbd2a66b427d7c" }, "downloads": -1, "filename": "htimeseries-1.1.1.tar.gz", "has_sig": false, "md5_digest": "aab710d7b085a70dfb3f4fd2f28b9bc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19930, "upload_time": "2019-06-12T11:44:49", "url": "https://files.pythonhosted.org/packages/58/cc/3e3e9a2177c41c859467abb61fd140ec6c1ee6823c97a42f219a0b9acc4e/htimeseries-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "1c1761cf2fa24862196f639478ebf76e", "sha256": "241e9b6541a34aaffa2286daa2ef3489e16e5912ff92f1b2820839681330c7ff" }, "downloads": -1, "filename": "htimeseries-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1c1761cf2fa24862196f639478ebf76e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12358, "upload_time": "2019-07-18T12:07:38", "url": "https://files.pythonhosted.org/packages/8b/f3/9e2a2edda788e2d93effdd1f8ff0605d77266c68e0f3db4dd635064b0e70/htimeseries-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5004a99b51354e4a20176331c4febbdc", "sha256": "b32f59b29b4244aae9ca41a8e1c220314e6a07ffe907069f49b0063335880231" }, "downloads": -1, "filename": "htimeseries-1.1.2.tar.gz", "has_sig": false, "md5_digest": "5004a99b51354e4a20176331c4febbdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24073, "upload_time": "2019-07-18T12:07:40", "url": "https://files.pythonhosted.org/packages/6d/ec/03c5a9672d684f1f7f4defbfc61e5dadea713d7e57e748e7a9c4de359523/htimeseries-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1c1761cf2fa24862196f639478ebf76e", "sha256": "241e9b6541a34aaffa2286daa2ef3489e16e5912ff92f1b2820839681330c7ff" }, "downloads": -1, "filename": "htimeseries-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1c1761cf2fa24862196f639478ebf76e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12358, "upload_time": "2019-07-18T12:07:38", "url": "https://files.pythonhosted.org/packages/8b/f3/9e2a2edda788e2d93effdd1f8ff0605d77266c68e0f3db4dd635064b0e70/htimeseries-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5004a99b51354e4a20176331c4febbdc", "sha256": "b32f59b29b4244aae9ca41a8e1c220314e6a07ffe907069f49b0063335880231" }, "downloads": -1, "filename": "htimeseries-1.1.2.tar.gz", "has_sig": false, "md5_digest": "5004a99b51354e4a20176331c4febbdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24073, "upload_time": "2019-07-18T12:07:40", "url": "https://files.pythonhosted.org/packages/6d/ec/03c5a9672d684f1f7f4defbfc61e5dadea713d7e57e748e7a9c4de359523/htimeseries-1.1.2.tar.gz" } ] }