$npx skillfedfor your agent

tinycss2

A tiny CSS parser

Worth itPyPI Text ProcessingReleased Nov 2025113.2M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — tinycss2-1.5.1-py3-none-any.whl
v1.5.1 · released 2025-11-23 · Python >=3.10 · 1 runtime deps: webencodings

Yes. tinycss2 is a stable, actively maintained library with low install friction, permissive licensing, and no known vulnerabilities. It fills a specific niche—low-level CSS parsing without semantic enforcement—making it the right choice if you need to parse or generate CSS syntax programmatically. Install it if your project requires CSS tokenization or syntax manipulation.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later; tested on CPython and PyPy.
  • Low install friction with a single runtime dependency (webencodings).
  • The package is actively maintained with a recent commit on 2026-06-21 and has been in production use since 2013.

License · maintenance · safety

permissive license (permissive) — BSD license (permissive) means you can use, modify, and distribute tinycss2 freely in commercial and private projects with minimal restrictions.

last release 2025-11-23 (264 days) · last repo commit 2026-06-21 · 190 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 113,205,802 downloads/mo, #317 on PyPI

Verify before relying

pip install tinycss2

import tinycss2

tokens = tinycss2.parse_declaration_list('color: red; margin: 0')
for token in tokens:
    print(token)
  • Whether tinycss2 can parse CSS from external files or only from strings
  • Performance characteristics when parsing large or complex CSS documents
  • Whether the package provides utilities for CSS validation or only parsing/generation
Same gist for agents: .md · .json

What it is and what it does

tinycss2 is a low-level CSS parser that converts CSS strings into structured token and block objects according to the CSS Syntax Level 3 specification. It does not enforce CSS module-specific rules or properties—it understands the grammar of CSS itself but leaves semantic validation to higher-level tools. The package also generates CSS strings from these objects, making it useful as a foundation for CSS processing pipelines.

The library is designed for developers who need to inspect, manipulate, or regenerate CSS at the syntactic level. Its single runtime dependency (webencodings) keeps installation lightweight, and it supports Python 3.10+ on both CPython and PyPy. Active maintenance and a 13-year history suggest it is stable and suitable for production use.

Use it for

  • Build CSS preprocessors or linters that need to parse and analyze CSS syntax without enforcing specific properties
  • Generate CSS dynamically from Python objects or data structures
  • Extract tokens from CSS to inspect selectors, declarations, or at-rules for analysis or transformation
  • Implement CSS minifiers or formatters that operate on the token level
  • Parse CSS in web scraping or HTML processing pipelines to extract styling information

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

tinycss2 is a stable, actively maintained library with low install friction, permissive licensing, and no known vulnerabilities. It fills a specific niche—low-level CSS parsing without semantic enforcement—making it the right choice if you need to parse or generate CSS syntax programmatically. Install it if your project requires CSS tokenization or syntax manipulation.

Install

tinycss2 on PyPI

Before you install

Low install friction with a single runtime dependency (webencodings). The package is actively maintained with a recent commit on 2026-06-21 and has been in production use since 2013.

Requires Python 3.10 or later; tested on CPython and PyPy.

License in practice

BSD license (permissive) means you can use, modify, and distribute tinycss2 freely in commercial and private projects with minimal restrictions.

Quickstart

pip install tinycss2

import tinycss2

tokens = tinycss2.parse_declaration_list('color: red; margin: 0')
for token in tokens:
    print(token)

Verify before relying

  • Whether tinycss2 can parse CSS from external files or only from strings
  • Performance characteristics when parsing large or complex CSS documents
  • Whether the package provides utilities for CSS validation or only parsing/generation

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
webencodings
MaintenanceActively maintained 264 days since the last release
Last repo commit
First released
Downloads113,205,802 / month, #317 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Text Processing

Evidence: tinycss2-1.5.1-py3-none-any.whl

Tags

Capabilities
css parser pythonparse css tokenscss syntax parserlow-level css parsingcss generatorcss tokenizercss block parser
Topics
css-parsingsyntax-analysis
PyPI keywords
cssparser

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “css parser python”

  • tinycss2tinycss2 parses CSS strings into token and block objects, and…
  • tree-sitter-cssProvides a CSS grammar parser for tree-sitter, enabling incremental…
  • cssutilscssutils parses and builds CSS stylesheets as a DOM structure without…

Give your agent the search over MCP, or paste the wish link into any chat.

More Text Processing packages

regex Worth it
PyPI · Python Modules · released Jul 2026

A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.

Apache-2.0 AND CNRI-Pythoncompiled wheel · 3.10+
437.7Mdownloads / mo
pyparsing Worth it
PyPI · Text Processing · released Jan 2026

pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.

Install it if you need to parse text or define grammars programmatically.

MITpure Python · 3.9+
412.7Mdownloads / mo
fonttools Worth it
PyPI · Text Processing · released May 2026

fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.

Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.

permissive licensepure Python · 3.10+
235.9Mdownloads / mo
docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
RapidFuzz Worth it
PyPI · Text Processing · released Apr 2026

RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.

Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.

MITcompiled wheel · 3.10+
184.2Mdownloads / mo
brotli Worth it
PyPI · Libraries · released Nov 2025

Provides Python bindings to the Brotli compression library, enabling lossless compression and decompression using a modern LZ77 variant with Huffman coding and context modeling.

Install it if you need Brotli compression in Python; the API is straightforward and the library is battle-tested.

permissive licensecompiled wheel
94.7Mdownloads / mo

See also cssselect2 · tinyhtml5 · tree-sitter-css · cssutils · pyphen · weasyprint · cssselect · md2pdf · django-premailer · pygmars