{ "info": { "author": "Antonis Christofides", "author_email": "antonis@antonischristofides.com", "bugtrack_url": null, "classifiers": [], "description": "===========================================================================\npd2hts - Read and write Pandas objects from/to Hydrognomon timeseries files\n===========================================================================\n\n.. image:: https://travis-ci.org/aptiko/pd2hts.svg?branch=master\n :alt: Build button\n :target: https://travis-ci.org/aptiko/pd2hts\n\nRequirements\n============\n\nPython 3, Pandas\n\nReference\n=========\n\n``pd2hts`` contains the following functions:\n\n* ``read(f, start_date=None, end_date=None)`` reads filelike object\n ``f`` that contains a time series in text format, and returns a pandas\n DataFrame with date index, value, and flags. There must be no newline\n translation in ``f`` (open it with ``open(..., newline='\\n')``. If\n ``start_date`` and/or ``end_date`` are specified, it skips rows\n outside the range.\n\n* ``read_file(f)`` reads filelike object ``f`` that contains a time\n series in file format, and returns a pandas DataFrame which also has\n attributes ``unit``, ``title``, ``comment``, ``time_zone``,\n ``time_step``, ``timestamp_rounding``, ``timestamp_offset``,\n ``interval_type``, ``variable``, ``precision`` and ``location``. For\n the meaning of these attributes, see section \"File format\" below. All\n these attributes are informational; they aren't otherwise taken into\n account in the pandas object.\n \n In particular, ``time_step`` and the other time-step-related\n attributes don't necessarily mean that the pandas object will have a\n related frequency. In fact, raw time series may be irregular but\n actually have a time step. For example, a ten-minute time series might\n end in :10, :20, etc., but at some point there might be an\n irregularity and it could continue with :31, :41, etc. Strictly\n speaking, such a time series has an irregular step. However, when\n stored in a database, specifying that its time step is ten minutes\n (because that's what it is, ten minutes with irregularities) can help\n people who browse or search the database contents.\n\n The ``location`` attribute is a dictionary that has items\n ``abscissa``, ``ordinate``, ``srid``, ``altitude``, and ``asrid``.\n\n* ``write(pd, f)`` writes pandas DataFrame ``pd``, which should be a\n time series with value and flags, to filelike object ``f``, in text\n format. In accordance with the :ref:`text format specification\n `, time series are written using the CR-LF sequence to\n terminate lines. In order to produce fully compliant files, care\n should be taken that ``f``, or any subsequent operations on ``f``, do\n not perform text translation; otherwise, it may result in lines being\n terminated with CR-CR-LF. If ``f`` is a file, it should have been\n opened in binary mode.\n\n* ``write_file(pd, f, version=4)`` is like ``write()`` but uses file\n format. If ``pd`` has any of the extra attributes mentioned in\n ``read_file()``, these are written to the file.\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 :samp:`{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**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\nLicense\n=======\n\nWritten by Antonis Christofides.\n\n| Copyright (C) 2015-2011 National Technical University of Athens\n| Copyright (C) 2013-2014 TEI of Epirus\n| Copyright (C) 2016 Antonis Christofides\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/openmeteo/pd2hts", "keywords": null, "license": "GPL3", "maintainer": null, "maintainer_email": null, "name": "pd2hts", "package_url": "https://pypi.org/project/pd2hts/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pd2hts/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/openmeteo/pd2hts" }, "release_url": "https://pypi.org/project/pd2hts/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Read and write Pandas objects from/to Hydrognomon timeseries files", "version": "0.2.0" }, "last_serial": 2205252, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "237a1e471bd06cd3b1fec04c36da8041", "sha256": "4b18c4bce5116a0ef5aa4a28dcfce977fc4d3566e4e23cb07ccae3657894e353" }, "downloads": -1, "filename": "pd2hts-0.1.0.tar.gz", "has_sig": false, "md5_digest": "237a1e471bd06cd3b1fec04c36da8041", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22184, "upload_time": "2016-06-19T16:10:41", "url": "https://files.pythonhosted.org/packages/ae/bb/71c01acc95f956b56eccc24496a0698216db179caacf37a3c9ae3d187641/pd2hts-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "04426bc3b5b0aecbaf19c8c260765afa", "sha256": "8320b99912ce5fb54e8aa344ba84cf22da20695e2986cdc756749651dec2bb29" }, "downloads": -1, "filename": "pd2hts-0.1.1.tar.gz", "has_sig": false, "md5_digest": "04426bc3b5b0aecbaf19c8c260765afa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22572, "upload_time": "2016-06-30T10:54:04", "url": "https://files.pythonhosted.org/packages/cc/de/6a7657c38558d9dc3d590487941063cada1e9cbdadb598b43672789874ad/pd2hts-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2b29fa2870df873871a02c045c0c3d69", "sha256": "db9f98efd76838e7f8a39f20cd2c577d93184c060cc30ed9db1b6883e5fd5b28" }, "downloads": -1, "filename": "pd2hts-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2b29fa2870df873871a02c045c0c3d69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22643, "upload_time": "2016-06-30T19:52:15", "url": "https://files.pythonhosted.org/packages/20/5e/49ca862649580c0d7f76b8f8c10625d374199c0b45be7598a9986c968767/pd2hts-0.1.2.tar.gz" } ], "0.1a1": [ { "comment_text": "", "digests": { "md5": "a2dfefbc11d2919327d4af7b23d17455", "sha256": "fa48c39a6bf47d372288bf91275f0fe5d86b2dfd52f95157f95c8635fd9a5fc5" }, "downloads": -1, "filename": "pd2hts-0.1a1.tar.gz", "has_sig": false, "md5_digest": "a2dfefbc11d2919327d4af7b23d17455", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22170, "upload_time": "2016-06-16T15:51:21", "url": "https://files.pythonhosted.org/packages/1b/00/3d1356b44f676a953221e0ef28e31d3de87855b20bd0afff20cea9936fcf/pd2hts-0.1a1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2da355dcb8a43c571e14f6b89f4cc3e1", "sha256": "da1906777a6058402e50364c252e9c35b10a4394faaf162af474c96877e12d5a" }, "downloads": -1, "filename": "pd2hts-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2da355dcb8a43c571e14f6b89f4cc3e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23868, "upload_time": "2016-07-06T09:39:52", "url": "https://files.pythonhosted.org/packages/d7/2d/f29396e0b3ffe779139ae044abdef5f6c4a630232a4c30c75ebdfc932c83/pd2hts-0.2.0.tar.gz" } ], "0.2.0a1": [ { "comment_text": "", "digests": { "md5": "ca30da09fc9e57da45cc709633cd6903", "sha256": "998ca6df7834fce759b8d6df6ec828d77c979d422038f031c069c8467732c991" }, "downloads": -1, "filename": "pd2hts-0.2.0a1.tar.gz", "has_sig": false, "md5_digest": "ca30da09fc9e57da45cc709633cd6903", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23843, "upload_time": "2016-07-06T08:29:47", "url": "https://files.pythonhosted.org/packages/a5/1e/036cca96be7c44b814a10a98029314f0d8404db595a57be6738776feca33/pd2hts-0.2.0a1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2da355dcb8a43c571e14f6b89f4cc3e1", "sha256": "da1906777a6058402e50364c252e9c35b10a4394faaf162af474c96877e12d5a" }, "downloads": -1, "filename": "pd2hts-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2da355dcb8a43c571e14f6b89f4cc3e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23868, "upload_time": "2016-07-06T09:39:52", "url": "https://files.pythonhosted.org/packages/d7/2d/f29396e0b3ffe779139ae044abdef5f6c4a630232a4c30c75ebdfc932c83/pd2hts-0.2.0.tar.gz" } ] }