cocoserver


Namecocoserver JSON
Version 1.0.9 PyPI version JSON
download
home_page
SummaryA local HTTP server for compressed content.
upload_time2023-07-01 12:18:27
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords http server gzip documentation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            A Simple HTTP Server for Static Content
=======================================

This Python module provides a modified version of the ThreadingHTTPServer
class from the http.server module in the standard library.  This server
is designed to serve a static web site, such as documentation for a
python project generated by Sphinx and installed with the software.  It
serves the files locally, on a random port of the loopback interface,
and hence works off line.  The server runs in its own daemon thread
of the python process, so it terminates when the python program exits
and thus will not leave zombie processes running.

The server has been modified to allow any file in the site to be gzip
compressed and served with a Content-Encoding header set to "gzip".
The compressed file will be automatically decompressed by the browser,
with no noticeable performance loss.  This is more efficient than the
typical case of serving compressed content over the internet since the
compression is done in advance. It also takes significantly less space
on the user's disk. (Brotli compression would be even more efficient
in both ways, but web browsers still tend to only support Brotli
compression over https, due to the prevalence of broken proxy servers
on the internet.)

Source code is available on `Github <https://github.com/3-manifolds/cocoserver/>`_.
The git repository includes a script (compress_site.py) for compressing all of
the .html, .css, .js, .woff and .svg files below a given site root directory.
The tool is aware of Sphinx's tendency to produce many identical copies of the
same (large) _static directory.  So it also collects the contents of all of the
_static subdirectories into one _static directory in the root, replacing the
others by symlinks.

The server can be installed by running: ``python3 -m pip install cocoserver``.

To use the server::
  
  >>> from cocoserver import StaticServer
  >>> s = StaticServer('my/site/root')
  >>> s.visit('mypage')

The pip package also installs a console script named *coco* which can
be used to view your static site, for example by running: ``coco /usr/local/share/doc/myproject``.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cocoserver",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Marc Culler <culler@users.noreply.github.com>, \"Nathan M. Dunfield\" <nathan@dunfield.info>, Matthias G\u00f6rner <enischte@gmail.com>",
    "keywords": "http,server,gzip,documentation",
    "author": "",
    "author_email": "Marc Culler <culler@users.noreply.github.com>, \"Nathan M. Dunfield\" <nathan@dunfield.info>, Matthias G\u00f6rner <enischte@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a6/02/5c78d1aa066295f9e13e19e722bc82ee0779dfd366fb4b5cccbbe69bd0e8/cocoserver-1.0.9.tar.gz",
    "platform": null,
    "description": "A Simple HTTP Server for Static Content\n=======================================\n\nThis Python module provides a modified version of the ThreadingHTTPServer\nclass from the http.server module in the standard library.  This server\nis designed to serve a static web site, such as documentation for a\npython project generated by Sphinx and installed with the software.  It\nserves the files locally, on a random port of the loopback interface,\nand hence works off line.  The server runs in its own daemon thread\nof the python process, so it terminates when the python program exits\nand thus will not leave zombie processes running.\n\nThe server has been modified to allow any file in the site to be gzip\ncompressed and served with a Content-Encoding header set to \"gzip\".\nThe compressed file will be automatically decompressed by the browser,\nwith no noticeable performance loss.  This is more efficient than the\ntypical case of serving compressed content over the internet since the\ncompression is done in advance. It also takes significantly less space\non the user's disk. (Brotli compression would be even more efficient\nin both ways, but web browsers still tend to only support Brotli\ncompression over https, due to the prevalence of broken proxy servers\non the internet.)\n\nSource code is available on `Github <https://github.com/3-manifolds/cocoserver/>`_.\nThe git repository includes a script (compress_site.py) for compressing all of\nthe .html, .css, .js, .woff and .svg files below a given site root directory.\nThe tool is aware of Sphinx's tendency to produce many identical copies of the\nsame (large) _static directory.  So it also collects the contents of all of the\n_static subdirectories into one _static directory in the root, replacing the\nothers by symlinks.\n\nThe server can be installed by running: ``python3 -m pip install cocoserver``.\n\nTo use the server::\n  \n  >>> from cocoserver import StaticServer\n  >>> s = StaticServer('my/site/root')\n  >>> s.visit('mypage')\n\nThe pip package also installs a console script named *coco* which can\nbe used to view your static site, for example by running: ``coco /usr/local/share/doc/myproject``.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A local HTTP server for compressed content.",
    "version": "1.0.9",
    "project_urls": {
        "Bug Tracker": "https://github.com/3-manifolds/cocoserver/issues",
        "Homepage": "https://github.com/3-manifolds/cocoserver"
    },
    "split_keywords": [
        "http",
        "server",
        "gzip",
        "documentation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2a68799b94506e8719f12641cee5cb5dc541e68144b7150d12a1dceeb3a9777",
                "md5": "54360f3189802e791a2e99da8c2d1577",
                "sha256": "1c6df89404f638bf58a118323cb0f9ebc06c17644d40ce32b202ef29d1cdc7c0"
            },
            "downloads": -1,
            "filename": "cocoserver-1.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "54360f3189802e791a2e99da8c2d1577",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12689,
            "upload_time": "2023-07-01T12:18:26",
            "upload_time_iso_8601": "2023-07-01T12:18:26.370311Z",
            "url": "https://files.pythonhosted.org/packages/c2/a6/8799b94506e8719f12641cee5cb5dc541e68144b7150d12a1dceeb3a9777/cocoserver-1.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6025c78d1aa066295f9e13e19e722bc82ee0779dfd366fb4b5cccbbe69bd0e8",
                "md5": "c364e64138819a691e85ed60bf091809",
                "sha256": "3c3d6ee005a44eb90005f1e36eefe9450cb00efd521656ef1b12a3b7e8b58ae7"
            },
            "downloads": -1,
            "filename": "cocoserver-1.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "c364e64138819a691e85ed60bf091809",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 12108,
            "upload_time": "2023-07-01T12:18:27",
            "upload_time_iso_8601": "2023-07-01T12:18:27.617734Z",
            "url": "https://files.pythonhosted.org/packages/a6/02/5c78d1aa066295f9e13e19e722bc82ee0779dfd366fb4b5cccbbe69bd0e8/cocoserver-1.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-01 12:18:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "3-manifolds",
    "github_project": "cocoserver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cocoserver"
}
        
Elapsed time: 0.09015s