{ "info": { "author": "David Collien", "author_email": "me@dcollien.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Infer an image for a given URL\n\n## What this does:\n\nGiven the URL of a website (e.g. \"https://www.mozilla.org\"), it attempts to find the most appropriate image that represents this site, and returns the URL of that image.\n\n## How it works:\n\nThe HTML of the page is parsed (BeautifulSoup) and meta/link tags are extracted which may contain clues as to which image to use. Failing this, the favicon is tried, or else it searches for the first img tag following the first h1 on the page.\n\nThe default search order is:\n\n```\nDEFAULT_CHECK_ORDER = [\n SCHEMA_IMAGE,\n OG_IMAGE,\n TWITTER_IMAGE,\n MS_WIDE_310,\n MS_SQUARE_310,\n ICON,\n APPLE_TOUCH_ICON,\n MS_SQUARE_150,\n MS_SQUARE_70,\n FAV_ICON,\n FIRST_IMAGE,\n]\n```\n\nWhich corresponds to:\n\n * meta tag with itemprop=\"image\" or property=\"image\"\n * meta tag with property=\"og:image:secure_url\" or property=\"og:image\"\n * meta tag with name=\"twitter:image\"\n * meta tag with name=\"msapplication-wide310x150logo\"\n * meta tag with name=\"msapplication-square310x310logo\"\n * link tag with rel=\"apple-touch-icon\" (if 'sizes' is provided, the link tag with the largest minimum dimension is selected)\n * link tag with rel=\"icon\" (if 'sizes' is provided, the link tag with the largest minimum dimension is selected)\n * meta tag with name=\"msapplication-square150x150logo\"\n * meta tag with name=\"msapplication-square70x70logo\"\n * requesting \"{scheme}://{domain}/favicon.ico\" to see if it exists\n * the first img tag siblings with an h1 tag.", "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/dcollien/urlimage", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "urlimage", "package_url": "https://pypi.org/project/urlimage/", "platform": "", "project_url": "https://pypi.org/project/urlimage/", "project_urls": { "Homepage": "https://github.com/dcollien/urlimage" }, "release_url": "https://pypi.org/project/urlimage/0.0.2/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Infers an image to use for a given URL", "version": "0.0.2" }, "last_serial": 5818502, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d69800f246a5d4abdca04be112313e13", "sha256": "74d0b4f2a6731d65deedd1be6c37093b5d6ffd9e46f97f76a57c325a7471e8b8" }, "downloads": -1, "filename": "urlimage-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d69800f246a5d4abdca04be112313e13", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4729, "upload_time": "2019-09-12T06:00:58", "url": "https://files.pythonhosted.org/packages/67/12/dc68ebf67fe472b00351d10b296c2adf00670794e8a78faa5a52a9e62323/urlimage-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bd0be18e7011d350d9ee71f38966fc7", "sha256": "5dc4e256d552f6b4b31592b7efd1eeea99663bb7ec4f4a06682c8897a9cd1be1" }, "downloads": -1, "filename": "urlimage-0.0.1.tar.gz", "has_sig": false, "md5_digest": "3bd0be18e7011d350d9ee71f38966fc7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3348, "upload_time": "2019-09-12T06:01:00", "url": "https://files.pythonhosted.org/packages/35/67/80e6e37dcdfed1518ea0edd344b56d3d3de0c3bba7ee4de948e3d2353712/urlimage-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "72389510a9b0166bdc20f5df88d17e41", "sha256": "1647eb4f5519dee562c03080fa2048eddd8d7f55f25c3bb8822d330e750dcdb1" }, "downloads": -1, "filename": "urlimage-0.0.2.tar.gz", "has_sig": false, "md5_digest": "72389510a9b0166bdc20f5df88d17e41", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3350, "upload_time": "2019-09-12T06:33:32", "url": "https://files.pythonhosted.org/packages/84/c9/58f8154f8b634813d5bde6377165c53a7dc04646d829491d746d7d18bded/urlimage-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "72389510a9b0166bdc20f5df88d17e41", "sha256": "1647eb4f5519dee562c03080fa2048eddd8d7f55f25c3bb8822d330e750dcdb1" }, "downloads": -1, "filename": "urlimage-0.0.2.tar.gz", "has_sig": false, "md5_digest": "72389510a9b0166bdc20f5df88d17e41", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3350, "upload_time": "2019-09-12T06:33:32", "url": "https://files.pythonhosted.org/packages/84/c9/58f8154f8b634813d5bde6377165c53a7dc04646d829491d746d7d18bded/urlimage-0.0.2.tar.gz" } ] }