{ "info": { "author": "James Oakley", "author_email": "jfunk@funktronics.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "python-xmltv\n============\n\nIntroduction\n------------\npython-xmltv is a Python module that provides access to XMLTV data. XMLTV is\nan XML format for storing TV listings.\n\nMore information on XMLTV can be found at http://membled.com/work/apps/xmltv/\n\n\nRequirements\n------------\nThere are no requirements for Python 2.5 and up. For older versions,\nElementTree is required, which can be found at\nhttp://effbot.org/zone/element-index.htm\n\n\nUsage\n-----\nUsage of the module is generally straight-forward::\n\n import xmltv\n from pprint import pprint\n\n # If you need to change the locale:\n # xmltv.locale = 'Latin-1'\n\n # If you need to change the date format used in the XMLTV file:\n # xmltv.date_format = '%Y%m%d%H%M%S %Z'\n\n filename = '/path/to/xmltv/file'\n\n # Print info for XMLTV file (source, etc.)\n pprint(xmltv.read_data(open(filename, 'r')))\n\n # Print channels\n pprint(xmltv.read_channels(open(filename, 'r')))\n\n # Print programmes\n pprint(xmltv.read_programmes(open(filename, 'r')))\n\nThere are currently three functions for reading that should be used:\n\n **read_data** ``(file_object) -> dict``\n Get the source and other info from an XMLTV file.\n\n Returns a dictionary of attributes, eg::\n\n {'date': u'20030702230041 -0300',\n 'generator-info-name': u'tv_grab_na V3.20030629',\n 'generator-info-url': u'http://sourceforge.net/projects/xmltv',\n 'source-info-name': u'Zap2It',\n 'source-info-url': u'http://www.zap2it.com'}\n\n **read_channels** ``(file_object) -> list``\n Get all of the channels.\n\n Returns a list of hashes, each representing a channel, eg::\n\n [{'display-name': [(u'Channel 10 ELTV', u'')],\n 'id': u'C10eltv.zap2it.com'},\n {'display-name': [(u'Channel 11 CBHT', u'')],\n 'icon': [{'desc': '','src': u'http://tvlistings2.zap2it.com/tms_network_logos/cbc.gif'}],\n 'id': u'C11cbht.zap2it.com'}]\n\n **read_programmes** ``(file_object) -> list``\n Get all of the programmes.\n\n Returns a list of hashes, each representing a programme, eg::\n\n [{'audio': [{'stereo': [u'stereo']}],\n 'category': [(u'Biz', u''), (u'Fin', u'')],\n 'channel': u'C23robtv.zap2it.com',\n 'start': u'20030702000000 ADT',\n 'stop': u'20030702003000 ADT',\n 'title': [(u'This Week in Business', u'')]},\n {'audio': [{'stereo': [u'stereo']}],\n 'channel': u'C36wuhf.zap2it.com',\n 'desc': [(u'In an effort to grow up, George proposes marriage to former girlfriend Susan.',\n u'')],\n 'rating': [{'system': u'VCHIP', 'value': u'PG'}],\n 'start': u'20030702000000 ADT',\n 'stop': u'20030702003000 ADT',\n 'sub-title': [(u'The Engagement', u'')],\n 'subtitles': [{'type': u'teletext'}],\n 'title': [(u'Seinfeld', u'')]}]\n\nThere is also a Writer class. It should always write proper XMLTV data. All\nstrings, except for dictionary keys, should be in Unicode.\n\nIt contains the following methods:\n\n **__init__** ``(fp, encoding=\"iso-8859-1\", date=None, source_info_url=None, source_info_name=None, generator_info_url=None, generator_info_name=None)`` -> ``Writer``\n Returns a Writer object.\n\n Arguments:\n\n ``fp``\n A File object to write XMLTV data to\n\n ``encoding``\n The text encoding that will be used. *Defaults to\n ``iso-8859-1``*\n\n ``date``\n The date this data was generated. *Optional*\n\n ``source_info_url``\n A URL for information about the source of the data. *Optional*\n\n ``source_info_name``\n A human readable description of ``source_info_url``.\n *Optional*\n\n ``generator_info_url``\n A URL for information about the program that is generating the\n XMLTV document. *Optional*\n\n ``generator_info_name``\n A human readable description of ``generator_info_url``.\n *Optional*\n\n **write_channel** ``(channel)``\n Write a channel dictionary\n\n Here's an example channel dictionary::\n\n {'display-name': [(u'Channel 11 CBHT', u'en')],\n 'icon': [{'src': u'http://tvlistings2.zap2it.com/tms_network_logos/cbc.gif'}],\n 'id': u'C11cbht.zap2it.com',\n 'url': u:'http://www.cbc.com'}\n\n **write_programme** ``(programme)``\n Write a programme dictionary\n\n Here's an example programme dictionary::\n\n {'audio': [{'stereo': u'stereo'}],\n 'category': [(u'Comedy', u'')],\n 'channel': u'C36wuhf.zap2it.com',\n 'country': [(u'USA', u'')],\n 'credits': [{'producer': [u'Larry David'], 'actor': [u'Jerry Seinfeld']}],\n 'date': [u'1995'],\n 'desc': [(u'In an effort to grow up, George proposes marriage to former girlfriend Susan.',\n u'')],\n 'episode-num': [(u'7 . 1 . 1/1', u'xmltv_ns')],\n 'language': [(u'English', u'')],\n 'last-chance': [(u'Hah!', u'')],\n 'length': [{'units': u'minutes', 'length': 22}],\n 'new': [1],\n 'orig-language': [(u'English', u'')],\n 'premiere': [(u'Not really. Just testing', u'en')],\n 'previously-shown': [{'channel': u'C12whdh.zap2it.com',\n 'start': u'19950921103000 ADT'}],\n 'rating': [{'icon': [{'height': u'64',\n 'src': u'http://some.ratings/PGicon.png',\n 'width': u'64'}],\n 'system': u'VCHIP',\n 'value': u'PG'}],\n 'star-rating': [{'icon': [{'height': u'32',\n 'src': u'http://some.star/icon.png',\n 'width': u'32'}],\n 'value': u'4/5'}],\n 'start': u'20030702000000 ADT',\n 'stop': u'20030702003000 ADT',\n 'sub-title': [(u'The Engagement', u'')],\n 'subtitles': [{'type': u'teletext', 'language': (u'English', u'')}],\n 'title': [(u'Seinfeld', u'')],\n 'video': [{'colour': 1, 'aspect': u'4:3', 'present': 1}]}\n\n **end** ``()``\n Write end tag\n\n Call this before closing a file.\n\nReporting Bugs\n--------------\nPlease send all bugs, comments, and questions to James Oakley\n\n\n\nChangelog\n=========\n\nVersion 1.4.3\n* Add pretty_print option to Writer.write()\n\nVersion 1.4.2\n-------------\n* Text encoding fixes. (Patch from Jan Su\u0161nik)\n\nVersion 1.4.1\n-------------\n* Updated MANIFEST.in to include all doc files\n\nVersion 1.4\n-----------\n* Updated to reflect current XMLTV DTD (patch from Igor Sobolev)\n* Clean up for pypi release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/jfunk/python-xmltv", "keywords": null, "license": "LGPL-3.0+", "maintainer": null, "maintainer_email": null, "name": "python-xmltv", "package_url": "https://pypi.org/project/python-xmltv/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-xmltv/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/jfunk/python-xmltv" }, "release_url": "https://pypi.org/project/python-xmltv/1.4.3/", "requires_dist": null, "requires_python": null, "summary": "A Python Module for Reading and Writing XMLTV Files", "version": "1.4.3" }, "last_serial": 1151044, "releases": { "1.4": [ { "comment_text": "", "digests": { "md5": "65ab245b616510c43f852f3e29199ec2", "sha256": "9a7663b315606ccf9f75217e633f7a4370182861f77d73bbfe36404cb6aa1545" }, "downloads": -1, "filename": "python-xmltv-1.4.tar.gz", "has_sig": false, "md5_digest": "65ab245b616510c43f852f3e29199ec2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11735, "upload_time": "2012-02-21T19:21:38", "url": "https://files.pythonhosted.org/packages/ac/6d/1f50069577d834f0bee67e90ef820ab66e0200980c15e7d9e9e67037990b/python-xmltv-1.4.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "c29c55fd8d4f750e82f1996f4c75ae79", "sha256": "06b14fb0496b2df09aac815bfe20313bb60c81a6704232c376bf04fd3e5e43a6" }, "downloads": -1, "filename": "python-xmltv-1.4.1.tar.gz", "has_sig": false, "md5_digest": "c29c55fd8d4f750e82f1996f4c75ae79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20686, "upload_time": "2012-02-21T21:20:17", "url": "https://files.pythonhosted.org/packages/4b/b1/df944728aaeac9eaf808e4bbfcfabe2116d9fd1abc63d9379d1e8a5ffe40/python-xmltv-1.4.1.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "1bd9bb49c90376c25bd70ea0378c69f4", "sha256": "b776cd43b7da00d51a4888266735d316ead8410532f0dd2436a10d0f4f8a3233" }, "downloads": -1, "filename": "python-xmltv-1.4.2.tar.gz", "has_sig": false, "md5_digest": "1bd9bb49c90376c25bd70ea0378c69f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21735, "upload_time": "2014-06-29T19:32:50", "url": "https://files.pythonhosted.org/packages/e5/f7/bfceff8a4f3eff5c164dc90e206dccc95ffb3f8e08eeec42ec0e14fa3339/python-xmltv-1.4.2.tar.gz" } ], "1.4.3": [ { "comment_text": "", "digests": { "md5": "0e0e0606c60669d15565e237d7db78b5", "sha256": "e99d961a9009d8df098f0b56273cbdf732fb8000bed96def5cf2cea7fc73bed5" }, "downloads": -1, "filename": "python-xmltv-1.4.3.tar.gz", "has_sig": false, "md5_digest": "0e0e0606c60669d15565e237d7db78b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21944, "upload_time": "2014-07-08T14:45:24", "url": "https://files.pythonhosted.org/packages/89/18/e51df49b864a31f4a5b08a50b7cf4a2ef7e2192ef355152a02943082f083/python-xmltv-1.4.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e0e0606c60669d15565e237d7db78b5", "sha256": "e99d961a9009d8df098f0b56273cbdf732fb8000bed96def5cf2cea7fc73bed5" }, "downloads": -1, "filename": "python-xmltv-1.4.3.tar.gz", "has_sig": false, "md5_digest": "0e0e0606c60669d15565e237d7db78b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21944, "upload_time": "2014-07-08T14:45:24", "url": "https://files.pythonhosted.org/packages/89/18/e51df49b864a31f4a5b08a50b7cf4a2ef7e2192ef355152a02943082f083/python-xmltv-1.4.3.tar.gz" } ] }