File: PKG-INFO

package info (click to toggle)
python-lesscpy 0.15.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,488 kB
  • sloc: python: 3,591; sh: 5; makefile: 4
file content (201 lines) | stat: -rw-r--r-- 5,929 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
Metadata-Version: 2.1
Name: lesscpy
Version: 0.15.1
Summary: Python LESS compiler
Home-page: https://github.com/lesscpy/lesscpy
Author: Jóhann T Maríusson
Author-email: jtm@robot.is
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Pre-processors
License-File: LICENSE
License-File: AUTHORS

LESSCPY
=======

.. image:: https://travis-ci.org/lesscpy/lesscpy.png?branch=master
        :target: https://travis-ci.org/lesscpy/lesscpy

.. image:: https://coveralls.io/repos/lesscpy/lesscpy/badge.png
        :target: https://coveralls.io/r/lesscpy/lesscpy

.. image:: https://img.shields.io/pypi/dm/lesscpy.svg
        :target: https://pypi.python.org/pypi/lesscpy

.. image:: https://img.shields.io/pypi/v/lesscpy.svg
        :target: https://pypi.python.org/pypi/lesscpy

.. image:: https://img.shields.io/pypi/wheel/lesscpy.svg
        :target: https://pypi.python.org/pypi/lesscpy
        :alt: Wheel Status

.. image:: https://img.shields.io/pypi/l/lesscpy.svg
        :target: https://pypi.python.org/pypi/lesscpy
        :alt: License

Python LESS Compiler.

A compiler written in Python for the LESS language. For those of us not willing
or able to have node.js installed in our environment. Not all features of LESS
are supported (yet). Some features wil probably never be supported (JavaScript
evaluation). This program uses PLY (Python Lex-Yacc) to tokenize / parse the
input and is considerably slower than the NodeJS compiler. The plan is to
utilize this to build in proper syntax checking and perhaps YUI compressing.

This is an early version, so you are likely to find bugs.

For more information on LESS:
  http://lesscss.org/ or https://github.com/cloudhead/less.js
 
Development files:
  https://github.com/lesscpy/lesscpy


Supported features
------------------

- Variables
- String interpolation
- Mixins (nested, calls, closures, recursive)
- Guard expressions
- Parametered mixins (class / id)
- @arguments
- Nesting
- Escapes ~/e()
- Expressions
- Keyframe blocks
- Color functions (lighten, darken, saturate, desaturate, spin, hue, mix,
                   saturation, lightness)
- Other functions (round, increment, decrement, format '%(', ...)


Differences from less.js
------------------------

- All colors are auto-formatted to #nnnnnn. eg, #f7e923
- Does not preserve CSS comments


Not supported
-------------

- JavaScript evaluation
 

Requirements
------------

- Python 3.7 - 3.11,
- ply (Python Lex-Yacc) (check requirements.txt)

Installation
------------

To install lesscpy from the `Python Package Index`_, simply:

.. code-block:: bash

    $ pip install lesscpy

To do a local system-wide install:

.. code-block:: bash

    python setup.py install
 
Or simply place the package into your Python path. Or rather use packages
provided by your distribution (openSUSE has them at least).


Compiler script Usage
---------------------
 
.. code-block:: text

    usage: lesscpy [-h] [-v] [-I INCLUDE] [-V] [-C] [-x] [-X] [-t] [-s SPACES]
                   [-o OUT] [-r] [-f] [-m] [-D] [-g] [-S] [-L] [-N]
                   target [output]

    LessCss Compiler

    positional arguments:
      target                less file or directory
      output                output file path

    optional arguments:
      -h, --help            show this help message and exit
      -v, --version         show program's version number and exit
      -I INCLUDE, --include INCLUDE
                            Included less-files (comma separated)
      -V, --verbose         Verbose mode
      -C, --dont_create_dirs
                            Creates directories when outputing files (lessc non-
                            compatible)

    Formatting options:
      -x, --minify          Minify output
      -X, --xminify         Minify output, no end of block newlines
      -t, --tabs            Use tabs
      -s SPACES, --spaces SPACES
                            Number of startline spaces (default 2)

    Directory options:
      Compiles all *.less files in directory that have a newer timestamp than
      it's css file.

      -o OUT, --out OUT     Output directory
      -r, --recurse         Recursive into subdirectorys
      -f, --force           Force recompile on all files
      -m, --min-ending      Add '.min' into output filename. eg, name.min.css
      -D, --dry-run         Dry run, do not write files

    Debugging:
      -g, --debug           Debugging information
      -S, --scopemap        Scopemap
      -L, --lex-only        Run lexer on target
      -N, --no-css          No css output

    << jtm@robot.is @_o >>

Python usage
------------

If you want to use the compiler from within Python, you can do it like this:

.. code-block:: python

    import lesscpy

    print(lesscpy.compile(StringIO(u"a { border-width: 2px * 3; }"), minify=True))

The output will be:

.. code-block:: text

    a{border-width:6px;}

License
-------

See the LICENSE file


.. _`Python Package Index`: https://pypi.python.org/pypi/lesscpy