Skip to main content

Sass for Python: A straightforward binding of libsass for Python.

Project description

PyPI Build Status Coverage Status pre-commit.ci status

This package provides a simple Python extension module sass which is binding LibSass (written in C/C++ by Hampton Catlin and Aaron Leung). It’s very straightforward and there isn’t any headache related Python distribution/deployment. That means you can add just libsass into your setup.py’s install_requires list or requirements.txt file. No need for Ruby nor Node.js.

It currently supports CPython 3.6+, and PyPy 3!

Features

  • You don’t need any Ruby/Node.js stack at all, for development or deployment either.

  • Fast. (LibSass is written in C++.)

  • Simple API. See the below example code for details.

  • Custom functions.

  • @import callbacks.

  • Support both tabbed (Sass) and braces (SCSS) syntax.

  • WSGI middleware for ease of development. It automatically compiles Sass/SCSS files for each request.

  • setuptools/distutils integration. You can build all Sass/SCSS files using setup.py build_sass command.

  • Works also on PyPy.

  • Provides prebuilt wheel binaries for Linux, Windows, and Mac.

Install

It’s available on PyPI, so you can install it using pip (or easy_install):

$ pip install libsass

Example

>>> import sass
>>> print sass.compile(string='a { b { color: blue; } }')
a b {
  color: blue; }

Docs

There’s the user guide manual and the full API reference for libsass:

https://sass.github.io/libsass-python/

You can build the docs by yourself:

$ cd docs/
$ make html

The built docs will go to docs/_build/html/ directory.

Credit

Hong Minhee wrote this Python binding of LibSass.

Hampton Catlin and Aaron Leung wrote LibSass, which is portable C/C++ implementation of Sass.

Hampton Catlin originally designed Sass language and wrote the first reference implementation of it in Ruby.

The above three are all distributed under MIT license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libsass-0.22.0.tar.gz (316.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

libsass-0.22.0-cp38-abi3-macosx_14_0_arm64.whl (982.8 kB view details)

Uploaded CPython 3.8+macOS 14.0+ ARM64

libsass-0.22.0-cp37-abi3-win_amd64.whl (880.9 kB view details)

Uploaded CPython 3.7+Windows x86-64

libsass-0.22.0-cp37-abi3-win32.whl (775.7 kB view details)

Uploaded CPython 3.7+Windows x86

libsass-0.22.0-cp37-abi3-macosx_10_15_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7+macOS 10.15+ x86-64

libsass-0.22.0-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (9.4 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.5+ x86-64

File details

Details for the file libsass-0.22.0.tar.gz.

File metadata

  • Download URL: libsass-0.22.0.tar.gz
  • Upload date:
  • Size: 316.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for libsass-0.22.0.tar.gz
Algorithm Hash digest
SHA256 3ab5ad18e47db560f4f0c09e3d28cf3bb1a44711257488ac2adad69f4f7f8425
MD5 7e15417666c1c5d87e532b8ac3c71c47
BLAKE2b-256 5514f1d9578dce39f890ae3c0f93db8a23e89d2a1403da81d307ffb429df7c3b

See more details on using hashes here.

File details

Details for the file libsass-0.22.0-cp38-abi3-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for libsass-0.22.0-cp38-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5fb2297a4754a6c8e25cfe5c015a3b51a2b6b9021b333f989bb8ce9d60eb5828
MD5 f0100178ac39d0f8d229d7becc577747
BLAKE2b-256 1599f0bbc4ccd254ad7b8e76fe878f11eb98a1931fa9bc46d599a52443641bff

See more details on using hashes here.

File details

Details for the file libsass-0.22.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: libsass-0.22.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 880.9 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for libsass-0.22.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 65455a2728b696b62100eb5932604aa13a29f4ac9a305d95773c14aaa7200aaf
MD5 3508539160ef537dba48ca741ed770c9
BLAKE2b-256 4333ccd65ef94bf37ad01ad4f82c3426d9274eee7d448ca9c23e516d03322520

See more details on using hashes here.

File details

Details for the file libsass-0.22.0-cp37-abi3-win32.whl.

File metadata

  • Download URL: libsass-0.22.0-cp37-abi3-win32.whl
  • Upload date:
  • Size: 775.7 kB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for libsass-0.22.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 89c5ce497fcf3aba1dd1b19aae93b99f68257e5f2026b731b00a872f13324c7f
MD5 afe602ff90caaf7b859c3bd1808ef81d
BLAKE2b-256 f5ee844666d66a4dbb7b81e3c0257253963091f2abec8454ce7abf6f89b409f9

See more details on using hashes here.

File details

Details for the file libsass-0.22.0-cp37-abi3-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libsass-0.22.0-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 081e256ab3c5f3f09c7b8dea3bf3bf5e64a97c6995fd9eea880639b3f93a9f9a
MD5 a5781f1a6865196ffce4b09714442c2d
BLAKE2b-256 92fd73b8081c5bc2b11b61596f74b54d45226633313c2a4de53205da948fc01c

See more details on using hashes here.

File details

Details for the file libsass-0.22.0-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for libsass-0.22.0-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f1efc1b612299c88aec9e39d6ca0c266d360daa5b19d9430bdeaffffa86993f9
MD5 56e86268190e9bd61795ada9f54c287b
BLAKE2b-256 0cbe178b03e598e86bf1faa70f9ebe4cfad236dcf159af11a39f30ac8d7ce693

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page