{ "info": { "author": "Joel Nothman", "author_email": "joel.nothman@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "``cssdecl`` Python CSS declaration computer\n-------------------------------------------\n\n|version| |py-versions|\n\n|build| |docs| |coverage|\n\n\nThis package provides basic computation of CSS declarations in order to:\n\n* handle overwriting of properties\n\n >>> from cssdecl import CSS22Resolver\n >>> resolve = CSS22Resolver().resolve_string\n >>> resolve('font-size: 10pt; font-size: 12pt')\n {'font-size': '12pt'}\n\n* expand shorthands like `border-width: 0 5pt`\n\n >>> resolved = resolve('border-width: 0 5pt')\n >>> resolved.pop('border-left-width')\n '5pt'\n >>> resolved.pop('border-right-width')\n '5pt'\n >>> resolved.pop('border-bottom-width')\n '0pt'\n >>> resolved.pop('border-top-width')\n '0pt'\n >>> resolved\n {}\n\n* (TODO!) expand shorthands like `font: 5px sans-serif bold` into `font-family: sans-serif`, `font-size: 5px`, `font-weight: bold`\n* resolve sizes to a common unit (i.e. pt)\n\n >>> resolve('font-size: 20px')\n {'font-size': '15pt'}\n >>> resolve('font-size: 1em')\n {'font-size': '12pt'}\n >>> resolve('font-size: 1em', inherited={'font-size': '20pt'})\n {'font-size': '20pt'}\n >>> resolve('font-size: small')\n {'font-size': '9.600000pt'}\n\n* resolve `inherit` given some inherited declarations\n\n >>> resolve('color: red; color: inherit', inherited={'color': 'blue'})\n {'color': 'blue'}\n\nSome properties that are not shorthands in CSS 2.2 become\nshorthands in CSS 3, such as `text-decoration`. We therefore\nhope to provide :class:`cssdecl.CSS22Resolver` and :class:`cssdecl.CSS3Resolver`.\n\nThis module does *not* process CSS selectors (e.g. ``#some-id > * > div.some-class``) and their applicability to elements, including specificity (e.g. ``!important``).\n\nThis was first developed for use in Pandas_ (`#15530 `_).\nIssues will continue to be prioritised to improve CSS support there, in the absence of other clear use-cases.\n\n\n.. _Pandas: http://pandas.pydata.org\n\n\n.. |py-versions| image:: https://img.shields.io/pypi/pyversions/Django.svg\n :alt: Python versions supported\n\n.. |version| image:: https://badge.fury.io/py/cssdecl.svg\n :alt: Latest version on PyPi\n :target: https://badge.fury.io/py/cssdecl\n\n.. |build| image:: https://travis-ci.org/jnothman/cssdecl.svg?branch=master\n :alt: Travis CI build status\n :scale: 100%\n :target: https://travis-ci.org/jnothman/cssdecl\n\n.. |coverage| image:: https://coveralls.io/repos/github/jnothman/cssdecl/badge.svg\n :alt: Test coverage\n :target: https://coveralls.io/github/jnothman/cssdecl\n\n.. |docs| image:: https://readthedocs.org/projects/cssdecl/badge/?version=latest\n :alt: Documentation Status\n :scale: 100%\n :target: https://cssdecl.readthedocs.io/en/latest/?badge=latest\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jnothman/cssdecl", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "cssdecl", "package_url": "https://pypi.org/project/cssdecl/", "platform": "", "project_url": "https://pypi.org/project/cssdecl/", "project_urls": { "Homepage": "https://github.com/jnothman/cssdecl" }, "release_url": "https://pypi.org/project/cssdecl/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Python CSS declaration computer", "version": "0.1.2" }, "last_serial": 2851131, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "2bb720577d2694dacb7ea961ad57e2a2", "sha256": "c4790a4c88194685b6018dcd0ad7eadef3a64fbe8c65d6e18436b8e6229fedcb" }, "downloads": -1, "filename": "cssdecl-0.0.0.tar.gz", "has_sig": false, "md5_digest": "2bb720577d2694dacb7ea961ad57e2a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4077, "upload_time": "2017-04-26T11:33:41", "url": "https://files.pythonhosted.org/packages/23/54/cc50e9011289be2a633bd46a2be62d5fcf76728465c8e1085c9b1cf04419/cssdecl-0.0.0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2d09517af4c2a819044017feb245a953", "sha256": "3984e91e3cd807cd24e7ab75040f396da79937cd41c0b319cd6062a1d4224c4e" }, "downloads": -1, "filename": "cssdecl-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2d09517af4c2a819044017feb245a953", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3880, "upload_time": "2017-04-27T13:47:08", "url": "https://files.pythonhosted.org/packages/ad/ea/5c4e82d2ae40a80e9b20c44529c95a149e8b415669af0afb5a53bfad75f2/cssdecl-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b6f421becf8f14843de7bf821ccd80c2", "sha256": "40b2481622cc805930ae35309d09527b49ba5f7c12545cdc844d8f6240e9495b" }, "downloads": -1, "filename": "cssdecl-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b6f421becf8f14843de7bf821ccd80c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4465, "upload_time": "2017-04-27T14:11:33", "url": "https://files.pythonhosted.org/packages/c8/6a/5620e9f501f2332fe11fa3fc227a73458dc0d0ac43fce81d622906708789/cssdecl-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "72ec0166cefe9a05b456b6123fb1b29b", "sha256": "05db0d001fbb822a9ee2e04b32eb4a34481a2568caff424e4092aced1725658c" }, "downloads": -1, "filename": "cssdecl-0.1.2.tar.gz", "has_sig": false, "md5_digest": "72ec0166cefe9a05b456b6123fb1b29b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4830, "upload_time": "2017-05-04T12:41:16", "url": "https://files.pythonhosted.org/packages/e5/e3/a6a8e330e4cd06e7a5d93edb3fc2fffbf2b5a51bbc9c1b5905e35d656df4/cssdecl-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "72ec0166cefe9a05b456b6123fb1b29b", "sha256": "05db0d001fbb822a9ee2e04b32eb4a34481a2568caff424e4092aced1725658c" }, "downloads": -1, "filename": "cssdecl-0.1.2.tar.gz", "has_sig": false, "md5_digest": "72ec0166cefe9a05b456b6123fb1b29b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4830, "upload_time": "2017-05-04T12:41:16", "url": "https://files.pythonhosted.org/packages/e5/e3/a6a8e330e4cd06e7a5d93edb3fc2fffbf2b5a51bbc9c1b5905e35d656df4/cssdecl-0.1.2.tar.gz" } ] }