{ "info": { "author": "Meteorological Service of Canada", "author_email": "thinesh.sornalingam@canada.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Atmospheric Science" ], "description": "[![Build Status](https://travis-ci.org/woudc/woudc-extcsv.png?branch=master)](https://travis-ci.org/woudc/woudc-extcsv) [![Build status](https://ci.appveyor.com/api/projects/status/02koln2pe4ap5kvd/branch/master?svg=true)](https://ci.appveyor.com/project/tomkralidis/woudc-extcsv)\n[![Downloads this month on PyPI](https://img.shields.io/pypi/dm/woudc-extcsv.svg)](http://pypi.python.org/pypi/woudc-extcsv)\n[![Latest release](https://img.shields.io/pypi/v/woudc-extcsv.svg)](http://pypi.python.org/pypi/woudc-extcsv)\n[![License](https://img.shields.io/github/license/woudc/woudc-extcsv.svg)](https://github.com/woudc/woudc-extcsv)\n\n# WOUDC Extended CSV library\n\nPython package providing read/write support of the\n[WOUDC](https://woudc.org) Extended CSV format.\n\n## Installation\n\n### Requirements\n\nwoudc-extcsv requires Python 2.7, [pywoudc](https://github.com/woudc/pywoudc), and unicodecsv.\n\n### Dependencies\n\nSee `requirements.txt`\n- unicodecsv\n- [pywoudc](https://github.com/woudc/pywoudc)\n\n### Installing the Package\n\n```bash\n# via pip\npip install woudc-extcsv\n# via easy_install\neasy_install woudc-extcsv\n```\n\n## Usage\n\n### Reader Objects\n\n```python\nfrom woudc_extcsv import Reader\n# read from file\nwith open('file.csv', 'rb') as ff:\n ecsv = Reader(ff.read(), encoding='utf-8')\n# read from string\necsv = Reader(my_ecsv_string)\n```\n\n### Writer Objects\n\n```python\nimport woudc_extcsv\n# create new writer object with common/metadata tables and fields available\necsv = woudc_extcsv.Writer(template=True)\n\n# Add file comments\necsv.add_comment('This is a file level comment.')\necsv.add_comment('This is another file level comment.')\n\n# Add metadata\necsv.add_data('CONTENT', \n 'WOUDC,Spectral,1.0,1')\necsv.add_data('DATA_GENERATION',\n '2002-05-29,JMA,1.0')\necsv.add_data('PLATFORM',\n 'STN,7,Kagoshima,JPN,47827')\necsv.add_data('INSTRUMENT',\n 'Brewer,MKII,059')\necsv.add_data('LOCATION',\n '31.63,130.6,283')\n\n# Add new table\necsv.add_table('TIMESTAMP')\n# Add fields\necsv.add_field('TIMESTAMP', 'UTCOffset,Date,Time')\n# Add data\necsv.add_data('TIMESTAMP', '+08:38:47', field='UTCOffset')\n# Add more data\necsv.add_data('TIMESTAMP', '1991-01-01', field='Date')\necsv.add_data('TIMESTAMP', '06:38:47', field='Time')\n\n# Add new table, fields, and data at the same time\necsv.add_data('GLOBAL_SUMMARY',\n '06:38:47,7.117E-04,8.980E-03,94.12,99.99,114.64,001000,999',\n field='Time,IntACGIH,IntCIE,ZenAngle,MuValue,AzimAngle,Flag,TempC')\necsv.add_data('GLOBAL',\n '290.0,0.000E+00',\n field='Wavelength,S-Irradiance,Time')\necsv.add_data('GLOBAL',\n '290.5,0.000E+00')\necsv.add_data('GLOBAL',\n '291.0,0.000E+00')\n# Add table for new groupings\necsv.add_data('TIMESTAMP',\n '+08:38:46,1991-01-01,07:38:46',\n field='UTCOffset,Date,Time',\n index=2)\n\necsv.add_data('GLOBAL_SUMMARY',\n '07:38:46,2.376E-02,3.984E-01,82.92,6.75,122.69,100000,999',\n field='Time,IntACGIH,IntCIE,ZenAngle,MuValue,AzimAngle,Flag,TempC',\n index=2, table_comment='This is a table level comment.')\n\n# Write to string\necsvs = woudc_extcsv.dumps(ecsv)\n\n# Write to file\n# validate (check if all common tables and their fields are present), if so dump to file\n# if not, print violations\nwoudc_extcsv.dump(ecsv, 'spectral-sample.csv')\n```\n\n### Convenience Functions\n\n```python\nimport woudc_extcsv\n# load from file into Reader object\necsv = woudc_extcsv.load('file.csv')\n# load from string into Reader object\necsv = woudc_extcsv.loads(my_ecsv_string)\n# dump to file from Writer object\necsv = woudc_extcsv.dump('file.csv')\n# dump to string from Writer object\necsv = woudc_extcsv.dumps(my_ecsv_string)\n```\n\n### Error Handling\n\n```pyhon\nfrom woudc_extcsv import loads, WOUDCExtCSVReaderError\n\ntry:\n loads('bad content!')\nexcept WOUDCExtCSVReaderError as err:\n print(err.message)\n for error in err.errors:\n print(error)\n```\n\n## Examples\n\nSee the `examples/` directory for sample scripts.\n\n## Development\n\nFor development environments, install\nin a Python [virtualenv](http://virtualenv.org):\n\n```bash\nvirtualenv foo\ncd foo\n. bin/activate\n# fork master\n# fork https://github.com/woudc/woudc-extcsv on GitHub\n# clone your fork to create a branch\ngit clone https://github.com/{your GitHub username}/woudc-extcsv.git\ncd woudc-extcsv\n# install dev packages\npip install -r requirements-dev.txt\n# create upstream remote\ngit remote add upstream https://github.com/woudc/woudc-extcsv.git\ngit pull upstream master\ngit branch my-cool-feature\ngit checkout my-cool-feature\n# start dev\ngit commit -m 'implement cool feature'\n# push to your fork\ngit push origin my-cool-feature\n# issue Pull Request on GitHub\ngit checkout master\n# cleanup/update once your branch is merged on GitHub\n# remove branch\ngit branch -D my-cool-feature\n# update your fork\ngit pull upstream master\ngit push origin master\n```\n\n### Running Tests\n\n```bash\n# via distutils\npython setup.py test\n# manually\npython run_tests.py\n# report test coverage\ncoverage run --source woudc_extcsv setup.py test\ncoverage report -m\n```\n\n### Code Conventions\n\nwoudc_extcsv code conventions are as per\n[PEP8](https://www.python.org/dev/peps/pep-0008).\n\n```bash\n# code should always pass the following\nfind -type f -name \"*.py\" | xargs flake8\n```\n\n## Issues\n\nAll bugs, enhancements and issues are managed on\n[GitHub](https://github.com/woudc/woudc-extcsv/issues).\n\n## History\n\nThe roots of woudc-extcsv originate within the WOUDC backend processing system\nin support of processing data submissions. woudc-extcsv was refactored\ninto a standalone library providing read/write support of the data centre's\ncore ingest format.\n\nIn 2015 woudc-extcsv was made publically available in support of the Treasury\nBoard [Policy on Acceptable Network and Device Use]\n(http://www.tbs-sct.gc.ca/pol/doc-eng.aspx?id=27122).\n\n## Contact\n\n* [Tom Kralidis](http://geds20-sage20.ssc-spc.gc.ca/en/GEDS20/?pgid=015&dn=CN%3Dtom.kralidis%40canada.ca%2COU%3DDAT-GES%2COU%3DMON-STR%2COU%3DMON-DIR%2COU%3DMSCB-DGSMC%2COU%3DDMO-CSM%2COU%3DEC-EC%2CO%3Dgc%2CC%3Dca)\n* [Thinesh Sornalingam](http://geds20-sage20.ssc-spc.gc.ca/en/GEDS20/?pgid=015&dn=CN%3Dthinesh.sornalingam%40canada.ca%2COU%3DDAT-GES%2COU%3DMON-STR%2COU%3DMON-DIR%2COU%3DMSCB-DGSMC%2COU%3DDMO-CSM%2COU%3DEC-EC%2CO%3DGC%2CC%3DCA)\n\n", "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/woudc/woudc-extcsv", "keywords": "woudc ozone uv ultra-violet WMO Extended CSV", "license": "MIT", "maintainer": "Meteorological Service of Canada", "maintainer_email": "thinesh.sornalingam@canada.ca", "name": "woudc-extcsv", "package_url": "https://pypi.org/project/woudc-extcsv/", "platform": "all", "project_url": "https://pypi.org/project/woudc-extcsv/", "project_urls": { "Homepage": "https://github.com/woudc/woudc-extcsv" }, "release_url": "https://pypi.org/project/woudc-extcsv/0.3.1/", "requires_dist": [ "pywoudc" ], "requires_python": "", "summary": "Python package providing read/write support of the WOUDC Extended CSV format.", "version": "0.3.1" }, "last_serial": 5412516, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3168af864b599d5f0d807209b85a6c33", "sha256": "ce05a0d3a8a6172e52ca56a771d586700216aba6f2330d524a56e75b35f0d9e2" }, "downloads": -1, "filename": "woudc-extcsv-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3168af864b599d5f0d807209b85a6c33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14901, "upload_time": "2015-12-03T02:38:13", "url": "https://files.pythonhosted.org/packages/7b/a4/b8a2a64a4663148740fbf81dbd87bc6bad8e0333dc9c49c5a2ad4fb61914/woudc-extcsv-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a11632bd410a8e4c482a31dbe6dd2c72", "sha256": "7d12b637d41339d6bdadf68055dfc2c910816dda0bad253ccbe5d6663b64233d" }, "downloads": -1, "filename": "woudc-extcsv-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a11632bd410a8e4c482a31dbe6dd2c72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14560, "upload_time": "2016-02-26T13:12:37", "url": "https://files.pythonhosted.org/packages/8d/23/11c74121793a5d9899ac76b71f284698c7d737a2180dd1d71d42df7fcdcc/woudc-extcsv-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "53ff2afced627e0e000a305c3e37e8a4", "sha256": "d45f2de6fd4dfeb59ec50baa49a5b06bbad26cc8b0d3470969db57f19d7900f7" }, "downloads": -1, "filename": "woudc-extcsv-0.1.3.tar.gz", "has_sig": false, "md5_digest": "53ff2afced627e0e000a305c3e37e8a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15403, "upload_time": "2017-03-29T14:42:29", "url": "https://files.pythonhosted.org/packages/e8/63/4f5a909f60fd8da3614374f9a43a52a75b22a800226fd398c9bd37964bed/woudc-extcsv-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "34915051c584c924affaf6fbda6ba162", "sha256": "2db32a0ed0c1de987ee3a6403c49fde4a01df8b7d98c5ca36c02c524cb47d59f" }, "downloads": -1, "filename": "woudc-extcsv-0.2.0.tar.gz", "has_sig": false, "md5_digest": "34915051c584c924affaf6fbda6ba162", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19849, "upload_time": "2017-12-07T15:18:40", "url": "https://files.pythonhosted.org/packages/37/58/860fed40c2bb30df8b0434f3ad837edd5a31cea4595de498fe9edb2c5289/woudc-extcsv-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "d51627619577b0b6755c0c2217337759", "sha256": "62a3044e6ff816d924059d6bb7265018354cd42d87dc43158ee3d325ead4f497" }, "downloads": -1, "filename": "woudc-extcsv-0.2.1.tar.gz", "has_sig": false, "md5_digest": "d51627619577b0b6755c0c2217337759", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19910, "upload_time": "2017-12-07T15:32:07", "url": "https://files.pythonhosted.org/packages/1a/03/fafeed6f2a3cf511adc95c1fabd01cff5aab15b89749a67b669bf3d4975b/woudc-extcsv-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b776597b07a1f1788627c7354de92c70", "sha256": "7d25ca4769d34559d0adbf01690e4bd8827e041427f3e89c34d728c8305a04b2" }, "downloads": -1, "filename": "woudc_extcsv-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b776597b07a1f1788627c7354de92c70", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17684, "upload_time": "2019-06-04T19:15:00", "url": "https://files.pythonhosted.org/packages/10/ac/8d9cf94fa544a906846b3e1a3811fcc09c8700e50f46312314b8a1f7820f/woudc_extcsv-0.2.2-py2.py3-none-any.whl" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "6696973275207f39c0b8c821868754f0", "sha256": "f762abcc5c8da5bf7843c34f78efb325a539dacb5c3892c89afd2ec312ebc410" }, "downloads": -1, "filename": "woudc_extcsv-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6696973275207f39c0b8c821868754f0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17607, "upload_time": "2019-06-17T22:56:29", "url": "https://files.pythonhosted.org/packages/4f/f9/14a5863f95202d40b7110efeaacdcbfa0e95847001e1cc6780da3fe5cb59/woudc_extcsv-0.3.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6696973275207f39c0b8c821868754f0", "sha256": "f762abcc5c8da5bf7843c34f78efb325a539dacb5c3892c89afd2ec312ebc410" }, "downloads": -1, "filename": "woudc_extcsv-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6696973275207f39c0b8c821868754f0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17607, "upload_time": "2019-06-17T22:56:29", "url": "https://files.pythonhosted.org/packages/4f/f9/14a5863f95202d40b7110efeaacdcbfa0e95847001e1cc6780da3fe5cb59/woudc_extcsv-0.3.1-py2.py3-none-any.whl" } ] }