{ "info": { "author": "Harel Malka", "author_email": "harel@harelmalka.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Topic :: Communications :: Email" ], "description": ".. image:: https://badge.fury.io/py/metatron.svg\n :target: https://badge.fury.io/py/metatron\n\nMetatron\n========\n\nHTML Meta tag parser, with emphasis on OpenGraph/Twitter Cards, and\ncomplex (and custom) meta tag schemes. Supports Python 3.x and up.\nThe Metatron object extends dict, and all the meta tag data is set within it.\n\n\nInstallation\n------------\nYou know the drill:\n\n::\n\n pip install metatron\n\n\nStraight to an example\n----------------------\n\nSimple meta tag collector\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThis example collects top level meta tags without a schema:\n\n::\n\n > mt = Metatron(url='https://www.bbc.co.uk')\n > mt.traverse()\n\n {\n 'x-country': 'gb',\n 'x-audience': 'Domestic',\n 'CPS_AUDIENCE': 'Domestic',\n 'CPS_CHANGEQUEUEID': '115204091',\n 'theme-color': 'bb1919',\n 'msapplication-TileColor': '#bb1919'\n }\n\n > mt['x-country']\n > 'gb'\n\nCollect structures OpenGraph meta tags\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n > mt = Metatron(url='https://www.bbc.co.uk', schemas=['og'])\n > mt.traverse()\n\n {\n 'og': {\n 'title': 'Home - BBC News',\n 'description': 'Visit BBC News for up-to-the-minute news....',\n 'site_name': 'BBC News',\n 'locale': 'en_GB',\n 'article': {\n 'author': 'https://www.facebook.com/bbcnews',\n 'section': 'Home'\n },\n 'url': 'http://www.bbc.co.uk/news',\n 'image': '//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/bbc_news_logo.png'\n }\n }\n\nSupports opengraph arrays (and can receive content as input)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n > content = \"\"\"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\"\"\n\n > mt = Metatron(content=content, schemas=['og'])\n > mt.traverse()\n\n {\n 'og': {\n 'description': 'description tag',\n 'image': [\n {\n 'alt': 'First image descriptoin',\n 'height': '300',\n 'image': 'http://example.com/image.jpg',\n 'secure_url': 'https://secure.example.com/image.jpg',\n 'type': 'image/jpeg',\n 'width': '400'\n },\n {\n 'alt': 'A shiny green apple with a bite taken out',\n 'height': '600',\n 'image': 'http://example.com/image2.jpg',\n 'secure_url': 'https://secure.example.com/ogp.jpg',\n 'type': 'image/jpeg',\n 'width': '500'\n }\n ],\n 'title': [\n 'First title tag',\n 'Second title tag'\n ]\n }\n }\n\nAdd your own meta tag schema\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nYou can provide Metatron with your own meta tag schema spec:\n::\n > from metatron import add_schema_spec\n > my_spec = {\n 'name': 'boom',\n 'attribute': 'name',\n 'value': 'value'\n }\n > add_schema_spec(my_spec)\n\nYou can then parse tags like:\n::\n \n \n\nUsing\n::\n > mt = Metatron(url='http://example.com', schemas=['boom'])\n > mt.traverse()\n > {\n 'boom': {\n 'title': 'Boom title',\n 'description': 'Boom description'\n }\n }\n\nCan run from the command line\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ make run URL=http://bbc.co.uk/news SCHEMA=og\n\n or\n\n $ python -m metatron.metatron http://bbc.co.uk/news og\n\n $ Getting: http://bbc.co.uk/news (schemas: og)\n {'og': {'description': 'Visit BBC News for up-to-the-minute news, breaking '\n 'news, video, audio and feature stories. BBC News '\n 'provides trusted World and UK news as well as local '\n 'and regional perspectives. Also entertainment, '\n 'business, science, technology and health news.',\n 'image': '//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.2.1/bbc_news_logo.png',\n 'locale': 'en_GB',\n 'section': 'Home',\n 'site_name': 'BBC News',\n 'title': 'Home - BBC News',\n 'type': 'website',\n 'url': 'http://www.bbc.co.uk/news'}}\n\nDependencies\n^^^^^^^^^^^^\n\n- requests\n- beautifulsoup4\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "https://github.com/harel/metatron/archive/0.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/harel/metatron", "keywords": "html meta parser opengraph twittercard", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "metatron", "package_url": "https://pypi.org/project/metatron/", "platform": "", "project_url": "https://pypi.org/project/metatron/", "project_urls": { "Download": "https://github.com/harel/metatron/archive/0.3.tar.gz", "Homepage": "https://github.com/harel/metatron" }, "release_url": "https://pypi.org/project/metatron/0.3/", "requires_dist": [ "beautifulsoup4", "requests" ], "requires_python": "", "summary": "Python 3 HTML meta tag parser, with emphasis on complex meta tag structures with support for OpenGraph and Twitter Card tags, including array handling", "version": "0.3" }, "last_serial": 3979509, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a4931dc7d503ca9476f51ad1270eb575", "sha256": "0dc6e68e804f5891e9364842ceede512c4346197d07b5080ab7ab020cbd11fc5" }, "downloads": -1, "filename": "metatron-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a4931dc7d503ca9476f51ad1270eb575", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9546, "upload_time": "2018-02-15T20:46:52", "url": "https://files.pythonhosted.org/packages/59/fc/6dc34ac9f1e6c86562d1d09a893f4c99cf051d620a4ef779d4ada7943457/metatron-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "38c73c7caec5a29d129443e480323d28", "sha256": "3acb351a91117954fed2a190938041fe384c9eba5cbb5e2a97dad844d2ade1e4" }, "downloads": -1, "filename": "metatron-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "38c73c7caec5a29d129443e480323d28", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9542, "upload_time": "2018-02-15T20:46:54", "url": "https://files.pythonhosted.org/packages/ee/1c/3e9f2d0c080977a011d2109f46604a85615c83e2b7e54a089b3a50d845d0/metatron-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "770d3887232e90b4fcbab9e8e24a2189", "sha256": "731523d577157077e5ce5965e7a629fc7a1eae38c98629b89238456b5df213c3" }, "downloads": -1, "filename": "metatron-0.1.tar.gz", "has_sig": false, "md5_digest": "770d3887232e90b4fcbab9e8e24a2189", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6700, "upload_time": "2018-02-15T20:46:56", "url": "https://files.pythonhosted.org/packages/49/bc/1dab19b1cc4563229f651df0993d8cc8c02fa5d02ba702947df83bea4763/metatron-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "918fbf3abe918f74f89e31ef75c5a836", "sha256": "6a000e67b82749dc546cf638a893c5724d19fa6755d9a6fd193110528b4ef9c2" }, "downloads": -1, "filename": "metatron-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "918fbf3abe918f74f89e31ef75c5a836", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10175, "upload_time": "2018-02-16T10:13:50", "url": "https://files.pythonhosted.org/packages/52/4e/ac405d47ef31f22d031542284e547d3958b66c8bb730aaf7e567142bf846/metatron-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b9555b042c66a1a279a75c60b5bb7928", "sha256": "638de8dbb25dc2f94ee0e81695e9bed091d9ef175c3ba5d5a25b8ad08c45fa62" }, "downloads": -1, "filename": "metatron-0.2.tar.gz", "has_sig": false, "md5_digest": "b9555b042c66a1a279a75c60b5bb7928", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7556, "upload_time": "2018-02-16T10:13:51", "url": "https://files.pythonhosted.org/packages/ac/56/924aa29cc40f6ea02596951ef5dee223f77cc6a933e2974f8461ea5378f0/metatron-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "478ae7a89721dfcdf304bcee1a98c7e6", "sha256": "9457ca37f9e3f7a99d7267329b33a219e13c38733d2d96d8e81f36685729bc2b" }, "downloads": -1, "filename": "metatron-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "478ae7a89721dfcdf304bcee1a98c7e6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7611, "upload_time": "2018-06-20T00:58:09", "url": "https://files.pythonhosted.org/packages/db/56/173be606a4f066a49ba6bd4e26183a5c3a44b5c7a6e81b3ecb2ebe1689f5/metatron-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9fc855b26e9c8f8cb80e2fcd5b372263", "sha256": "dc254f8d34f5d0df7782ff33e68e4d3112912d2e4081277733071499104c69ff" }, "downloads": -1, "filename": "metatron-0.3.tar.gz", "has_sig": false, "md5_digest": "9fc855b26e9c8f8cb80e2fcd5b372263", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7569, "upload_time": "2018-06-20T00:58:10", "url": "https://files.pythonhosted.org/packages/81/3b/76d923b35582792141a31fc9e4c5942168e936c38932da5f470cb8446236/metatron-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "478ae7a89721dfcdf304bcee1a98c7e6", "sha256": "9457ca37f9e3f7a99d7267329b33a219e13c38733d2d96d8e81f36685729bc2b" }, "downloads": -1, "filename": "metatron-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "478ae7a89721dfcdf304bcee1a98c7e6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7611, "upload_time": "2018-06-20T00:58:09", "url": "https://files.pythonhosted.org/packages/db/56/173be606a4f066a49ba6bd4e26183a5c3a44b5c7a6e81b3ecb2ebe1689f5/metatron-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9fc855b26e9c8f8cb80e2fcd5b372263", "sha256": "dc254f8d34f5d0df7782ff33e68e4d3112912d2e4081277733071499104c69ff" }, "downloads": -1, "filename": "metatron-0.3.tar.gz", "has_sig": false, "md5_digest": "9fc855b26e9c8f8cb80e2fcd5b372263", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7569, "upload_time": "2018-06-20T00:58:10", "url": "https://files.pythonhosted.org/packages/81/3b/76d923b35582792141a31fc9e4c5942168e936c38932da5f470cb8446236/metatron-0.3.tar.gz" } ] }