{ "info": { "author": "Ned Batchelder", "author_email": "ned@nedbatchelder.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7" ], "description": "Caveman: Validation of HTML5 cache manifests\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCaveman is a package that parses and validates\n`HTML5 cache manifests `_. HTML5\napplications are notoriously picky about their cache manifests, and it is\ndifficult to check that all of the components are as they should be.\n\nCaveman provides one command-line script, `check_manifest`, which pulls an HTML\npage, scrapes it for used resources, parses its cache manifest, and validates\nthe resources against the manifest::\n\n $ check_manifest URL\n\nProblems with the manifest are written to the standard output. More detail\nabout the process is output if you set the log level to a different severity\nwith the --level=LEVEL switch, where LEVEL is DEBUG, INFO, WARNING, or ERROR.\n\n\nProgrammatic use\n----------------\n\nCaveman has been designed to be usable from your own code, for example, as\npart of a larger validation process, or as part of unit tests in your web\napplication.\n\nCaveman's work is done by the `ManifestChecker` class. You instantiate it\nwith two helpers: a `get_url` function that fetches data from URLs, and a\n`logger` object that gets logged messages::\n\n from caveman import ManifestChecker\n\n def get_url(url): ...\n\n logger = ...\n\n man_checker = ManifestChecker(get_url=get_url, logger=logger)\n\nThen call its `check_manifest` method with the URL of the HTML page::\n\n man_checker.check_manifest(url)\n\nNo value is returned: the output has been logged to the logger object.\nSee the docstrings in the source code for details.\n\n\nDjango unit tests\n+++++++++++++++++\n\nAs an example of programmatic use, here's one way to use Caveman in a Django\ntest suite::\n\n from caveman import ManifestChecker\n\n class TestManifest(django.test.TestCase):\n def setUp(self):\n self.checker = ManifestChecker(get_url=self.get_url, logger=self)\n self.caveman_log = []\n\n def get_url(self, url):\n \"\"\"A get_url function for `caveman.ManifestChecker`.\"\"\"\n # Use the Django test client to fetch the URL.\n response = self.client.get(url)\n return response.status_code, response.content, response\n\n # Record the serious Caveman messages in `self.caveman_log`.\n def debug(self, msg): pass\n def info(self, msg): pass\n def warning(self, msg): self.caveman_log.append(msg)\n def error(self, msg): self.caveman_log.append(msg)\n\n def test_my_manifest(self):\n \"\"\"Caveman produces no warnings or errors for the cache manifest.\"\"\"\n self.checker.check_manifest(\"/\")\n self.assertEqual([], self.caveman_log)\n\n\nLimitations\n-----------\n\nCaveman only pulls the HTML page you specify. Although it validates links to\nother HTML pages against the manifest, it does not pull those linked-to pages\nand verify their resources.\n\nCertain rules from the HTML5 spec are not validated.\n\n\nMore information\n----------------\n\nCaveman can be downloaded from PyPI: http://pypi.python.org/pypi/caveman\n\nThe HTML5 cache manifest spec is at http://www.w3.org/TR/html5/offline.html\n\nDocs at `http://nedbatchelder.com/code/caveman `_.\n\nCode repository and issue tracker are at `bitbucket.org `_.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://nedbatchelder.com/code/caveman", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "caveman", "package_url": "https://pypi.org/project/caveman/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/caveman/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://nedbatchelder.com/code/caveman" }, "release_url": "https://pypi.org/project/caveman/1.0/", "requires_dist": null, "requires_python": null, "summary": "Caveman: Validation of HTML5 cache manifests", "version": "1.0" }, "last_serial": 787269, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "605e7a98e8797e3f216d943dfd883f5f", "sha256": "75906cedc2a8932111713b9ac22cf6a303b2ad33e8a9e0c1fabfec0374452c9f" }, "downloads": -1, "filename": "caveman-1.0.tar.gz", "has_sig": false, "md5_digest": "605e7a98e8797e3f216d943dfd883f5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6145, "upload_time": "2011-11-16T13:50:47", "url": "https://files.pythonhosted.org/packages/37/05/d0cb167c868a98aa79d9a5e0af661e72351f3dde26c9793c27cdcfb6149f/caveman-1.0.tar.gz" } ], "1.0b1": [ { "comment_text": "", "digests": { "md5": "446ca1eba8a696e76dd4c2fd513b4715", "sha256": "e5ddc2adc90fa07357e4994c35ae7256e09c8b924f32c4680deb044f2ab228fe" }, "downloads": -1, "filename": "caveman-1.0b1.tar.gz", "has_sig": false, "md5_digest": "446ca1eba8a696e76dd4c2fd513b4715", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6148, "upload_time": "2011-11-07T04:28:35", "url": "https://files.pythonhosted.org/packages/60/19/66c020bd378a2a61096d2419cc7fffb1b5cd67cafc20e1561f683058e426/caveman-1.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "605e7a98e8797e3f216d943dfd883f5f", "sha256": "75906cedc2a8932111713b9ac22cf6a303b2ad33e8a9e0c1fabfec0374452c9f" }, "downloads": -1, "filename": "caveman-1.0.tar.gz", "has_sig": false, "md5_digest": "605e7a98e8797e3f216d943dfd883f5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6145, "upload_time": "2011-11-16T13:50:47", "url": "https://files.pythonhosted.org/packages/37/05/d0cb167c868a98aa79d9a5e0af661e72351f3dde26c9793c27cdcfb6149f/caveman-1.0.tar.gz" } ] }