{ "info": { "author": "Philip J Grabner, Canary Health Inc", "author_email": "oss@canary.md", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development" ], "description": "=======================\nPython LESSCSS Compiler\n=======================\n\nThe `lessc` Python package compiles content in LESS syntax into CSS by\nfirst preprocessing it and then invoking the nodejs `lessc` program to\nactually compile it. The preprocessing resolves imports which allows\nthe LESS content to come from anywhere, including the filesystem,\nzipped EGG files, databases, etc. This solves one of the greatest\nlimitations of the nodejs lessc program which requires all of the LESS\ndependencies to be actual files and imports to be non-absolute.\n\nIt is possible, but *quite* improbable, that this package turns into a\npure-Python implementation of a LESS compiler.\n\nFor more information on LESS, please see http://lesscss.org/.\n\n\nProject\n=======\n\n* Homepage: https://github.com/canaryhealth/lessc\n* Bugs: https://github.com/canaryhealth/lessc/issues\n\n\nInstallation\n============\n\n.. code:: bash\n\n $ npm install less\n $ export PATH=\"`pwd`/node_modules/.bin:$PATH\"\n $ pip install lessc\n\n\nUsage\n=====\n\n.. code:: python\n\n import lessc\n\n # compile a less asset in the \"mypackage\" python module:\n css = lessc.compile_asset('mypackage:path/to/style.less')\n\n # compile a less file on the filesystem\n css = lessc.compile_file('../path/to/style.less')\n\n # compile a less file-like object\n # (if there are any relative imports, specifying `base` is necessary)\n css = lessc.compile_file(open('../path/to/style.less'))\n\n # compile a less string\n # (if there are any relative imports, specifying `base` is necessary)\n\n less = '''\n @import \"mypackage:path/to/style.less\";\n // ...other less statements...\n '''\n\n css = lessc.compile(less)\n\n\nFor more import resolution control, you can specify a custom URI\nresolver (which resolves a relative URI to an absolute URI) and a\ncustom URI loader (which loads an absolute URI), using the `resolver`\nand `loader` keywords to any compile* function:\n\n.. code:: python\n\n import lessc\n\n def resolver(uri, base=None):\n '''\n Returns the absolute URI given a base URI and a potentially\n absolute or relative URI. Note that `base` may be ``None`` when\n the initial URI is being resolved (depending on the Compiler\n configuration).\n '''\n # calculate the absolute URI...\n return absolute_uri\n\n def loader(uri):\n '''\n Returns a file-like object that will return the content of\n the specified URI.\n '''\n # fetch the object defined by `uri`\n return file_like_object\n\n css = lessc.compile_asset(uri, resolver=resolver, loader=loader)\n\n\nOr you can create a custom compiler and set it as the default compiler:\n\n.. code:: python\n\n import lessc\n\n compiler = lessc.Compiler(resolver=my_custom_resolver, loader=my_custom_loader)\n lessc.set_default_compiler(compiler)\n\n # this will now use `my_custom_resolver` and `my_custom_loader`\n # to compile asset `uri`\n css = lessc.compile_asset(uri)\n\n\nLimitations\n===========\n\nCurrently, there exist the following restrictions in what kind of\nLESS syntax is used:\n\n* Recursive imports are not supported and will be silently ignored.\n\n* Only the following import keywords are explicitly supported:\n\n * ``less``\n * ``css``\n * ``once``\n * ``optional``\n\n The keywords ``reference``, ``inline``, and ``multiple`` are NOT\n supported. Any other keywords may or may not be supported (since\n only the above keywords were documented as of this writing,\n 2015/06/26).\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/canaryhealth/lessc", "keywords": "less css compiler", "license": "MIT (http://opensource.org/licenses/MIT)", "maintainer": "", "maintainer_email": "", "name": "lessc", "package_url": "https://pypi.org/project/lessc/", "platform": "", "project_url": "https://pypi.org/project/lessc/", "project_urls": { "Homepage": "http://github.com/canaryhealth/lessc" }, "release_url": "https://pypi.org/project/lessc/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "A Python less compiler", "version": "0.1.3" }, "last_serial": 5497887, "releases": { "0.1.0": [], "0.1.2": [ { "comment_text": "", "digests": { "md5": "962537ebfeb7840a4c5ccc2ca58ba9d6", "sha256": "6f9adcc61d6a1af978b16ebfb54c680d95a136aaa3da9af73d48c249a0a1fb6a" }, "downloads": -1, "filename": "lessc-0.1.2.tar.gz", "has_sig": false, "md5_digest": "962537ebfeb7840a4c5ccc2ca58ba9d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8153, "upload_time": "2016-09-20T16:19:26", "url": "https://files.pythonhosted.org/packages/cf/69/83cdb310cd32f7dc9ccd81d609c3551cf1884013b96318950a425a0a5ea9/lessc-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c8b8194e74b9900979b01754c152de2a", "sha256": "97a12f5f04731c9e77b5e14106ae07a77409081c901000fbec88e4a0a2e6de82" }, "downloads": -1, "filename": "lessc-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c8b8194e74b9900979b01754c152de2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8347, "upload_time": "2019-07-07T20:02:24", "url": "https://files.pythonhosted.org/packages/28/d3/018ea21e5438b7b461d475a8df1cea1755608e731a1c55ebb351d8531629/lessc-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8b8194e74b9900979b01754c152de2a", "sha256": "97a12f5f04731c9e77b5e14106ae07a77409081c901000fbec88e4a0a2e6de82" }, "downloads": -1, "filename": "lessc-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c8b8194e74b9900979b01754c152de2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8347, "upload_time": "2019-07-07T20:02:24", "url": "https://files.pythonhosted.org/packages/28/d3/018ea21e5438b7b461d475a8df1cea1755608e731a1c55ebb351d8531629/lessc-0.1.3.tar.gz" } ] }