Metadata-Version: 2.4
Name: kgcss
Version: 1.0.0
Summary: Fast and comprehensive CSS handling: tokenizing, parsing, a mutable object model, serialization, selector matching, media queries, colors, fonts and shorthands, with a C99 backend
Author-email: Kovid Goyal <kovid@kovidgoyal.net>
License-Expression: BSD-3-Clause
Project-URL: Documentation, https://kgcss.readthedocs.io
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
Classifier: Topic :: Text Processing :: Markup
Classifier: Typing :: Typed
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# kgcss

[![CI](https://github.com/kovidgoyal/kgcss/actions/workflows/ci.yml/badge.svg)](https://github.com/kovidgoyal/kgcss/actions/workflows/ci.yml)
[![Documentation](https://readthedocs.org/projects/kgcss/badge/?version=latest)](https://kgcss.readthedocs.io/en/latest/)
[![PyPI](https://img.shields.io/pypi/v/kgcss)](https://pypi.org/project/kgcss/)
[![Python versions](https://img.shields.io/pypi/pyversions/kgcss)](https://pypi.org/project/kgcss/)

A fast and comprehensive CSS library for Python, with a C99 backend. It
parses CSS as browsers do, gives a mutable object model of sheets, rules,
selectors, declarations and values, and writes it back, reformatted or
byte for byte. It also rewrites URLs and handles `@import`, matches
Selectors Level 4 against lxml and ElementTree trees, and covers media
queries, colors, fonts and shorthand properties. It runs on regular and
free-threaded Python 3.14 and later.

```python
>>> import kgcss
>>> sheet = kgcss.parse_stylesheet('a { color: #ff0000; margin: 0px }')
>>> print(sheet.css_text)
a {
  color: #f00;
  margin: 0;
}

```

**Documentation: <https://kgcss.readthedocs.io>**: installation, a guide to
every part, the API reference, migrating from css_parser, tinycss and
css_selectors, and development.

## License

BSD 3-Clause. See [LICENSE](LICENSE).
