{"id":15011189,"url":"https://github.com/lesscpy/lesscpy","last_synced_at":"2025-04-04T13:09:48.496Z","repository":{"id":2329719,"uuid":"3291035","full_name":"lesscpy/lesscpy","owner":"lesscpy","description":"Python LESS compiler","archived":false,"fork":false,"pushed_at":"2023-09-23T15:39:53.000Z","size":817,"stargazers_count":144,"open_issues_count":37,"forks_count":47,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T12:06:00.032Z","etag":null,"topics":["compiler","css","less","lex","ply","python","yacc"],"latest_commit_sha":null,"homepage":"","language":"Less","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesscpy.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null}},"created_at":"2012-01-28T14:45:59.000Z","updated_at":"2024-08-14T00:17:39.000Z","dependencies_parsed_at":"2024-04-09T20:49:19.799Z","dependency_job_id":"f76e2006-3403-44ff-9ece-f50e0a99eef9","html_url":"https://github.com/lesscpy/lesscpy","commit_stats":{"total_commits":382,"total_committers":27,"mean_commits":"14.148148148148149","dds":"0.46335078534031415","last_synced_commit":"fa96910b25c70c923040e34916b1f4288056e5bc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesscpy%2Flesscpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesscpy%2Flesscpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesscpy%2Flesscpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesscpy%2Flesscpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesscpy","download_url":"https://codeload.github.com/lesscpy/lesscpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182337,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","css","less","lex","ply","python","yacc"],"created_at":"2024-09-24T19:39:39.336Z","updated_at":"2025-04-04T13:09:48.476Z","avatar_url":"https://github.com/lesscpy.png","language":"Less","readme":"LESSCPY\n=======\n\n.. image:: https://travis-ci.org/lesscpy/lesscpy.png?branch=master\n        :target: https://travis-ci.org/lesscpy/lesscpy\n\n.. image:: https://coveralls.io/repos/lesscpy/lesscpy/badge.png\n        :target: https://coveralls.io/r/lesscpy/lesscpy\n\n.. image:: https://img.shields.io/pypi/dm/lesscpy.svg\n        :target: https://pypi.python.org/pypi/lesscpy\n\n.. image:: https://img.shields.io/pypi/v/lesscpy.svg\n        :target: https://pypi.python.org/pypi/lesscpy\n\n.. image:: https://img.shields.io/pypi/wheel/lesscpy.svg\n        :target: https://pypi.python.org/pypi/lesscpy\n        :alt: Wheel Status\n\n.. image:: https://img.shields.io/pypi/l/lesscpy.svg\n        :target: https://pypi.python.org/pypi/lesscpy\n        :alt: License\n\nPython LESS Compiler.\n\nA compiler written in Python for the LESS language. For those of us not willing\nor able to have node.js installed in our environment. Not all features of LESS\nare supported (yet). Some features wil probably never be supported (JavaScript\nevaluation). This program uses PLY (Python Lex-Yacc) to tokenize / parse the\ninput and is considerably slower than the NodeJS compiler. The plan is to\nutilize this to build in proper syntax checking and perhaps YUI compressing.\n\nThis is an early version, so you are likely to find bugs.\n\nFor more information on LESS:\n  http://lesscss.org/ or https://github.com/cloudhead/less.js\n \nDevelopment files:\n  https://github.com/lesscpy/lesscpy\n\n\nSupported features\n------------------\n\n- Variables\n- String interpolation\n- Mixins (nested, calls, closures, recursive)\n- Guard expressions\n- Parametered mixins (class / id)\n- @arguments\n- Nesting\n- Escapes ~/e()\n- Expressions\n- Keyframe blocks\n- Color functions (lighten, darken, saturate, desaturate, spin, hue, mix,\n                   saturation, lightness)\n- Other functions (round, increment, decrement, format '%(', ...)\n\n\nDifferences from less.js\n------------------------\n\n- All colors are auto-formatted to #nnnnnn. eg, #f7e923\n- Does not preserve CSS comments\n\n\nNot supported\n-------------\n\n- JavaScript evaluation\n \n\nRequirements\n------------\n\n- Python 3.7 - 3.11,\n- ply (Python Lex-Yacc) (check requirements.txt)\n\nInstallation\n------------\n\nTo install lesscpy from the `Python Package Index`_, simply:\n\n.. code-block:: bash\n\n    $ pip install lesscpy\n\nTo do a local system-wide install:\n\n.. code-block:: bash\n\n    python setup.py install\n \nOr simply place the package into your Python path. Or rather use packages\nprovided by your distribution (openSUSE has them at least).\n\n\nCompiler script Usage\n---------------------\n \n.. code-block:: text\n\n    usage: lesscpy [-h] [-v] [-I INCLUDE] [-V] [-C] [-x] [-X] [-t] [-s SPACES]\n                   [-o OUT] [-r] [-f] [-m] [-D] [-g] [-S] [-L] [-N]\n                   target [output]\n\n    LessCss Compiler\n\n    positional arguments:\n      target                less file or directory\n      output                output file path\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -v, --version         show program's version number and exit\n      -I INCLUDE, --include INCLUDE\n                            Included less-files (comma separated)\n      -V, --verbose         Verbose mode\n      -C, --dont_create_dirs\n                            Creates directories when outputing files (lessc non-\n                            compatible)\n\n    Formatting options:\n      -x, --minify          Minify output\n      -X, --xminify         Minify output, no end of block newlines\n      -t, --tabs            Use tabs\n      -s SPACES, --spaces SPACES\n                            Number of startline spaces (default 2)\n\n    Directory options:\n      Compiles all *.less files in directory that have a newer timestamp than\n      it's css file.\n\n      -o OUT, --out OUT     Output directory\n      -r, --recurse         Recursive into subdirectorys\n      -f, --force           Force recompile on all files\n      -m, --min-ending      Add '.min' into output filename. eg, name.min.css\n      -D, --dry-run         Dry run, do not write files\n\n    Debugging:\n      -g, --debug           Debugging information\n      -S, --scopemap        Scopemap\n      -L, --lex-only        Run lexer on target\n      -N, --no-css          No css output\n\n    \u003c\u003c jtm@robot.is @_o \u003e\u003e\n\nPython usage\n------------\n\nIf you want to use the compiler from within Python, you can do it like this:\n\n.. code-block:: python\n\n    import lesscpy\n\n    print(lesscpy.compile(StringIO(u\"a { border-width: 2px * 3; }\"), minify=True))\n\nThe output will be:\n\n.. code-block:: text\n\n    a{border-width:6px;}\n\nLicense\n-------\n\nSee the LICENSE file\n\n\n.. _`Python Package Index`: https://pypi.python.org/pypi/lesscpy\n","funding_links":[],"categories":["Ports of Less"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesscpy%2Flesscpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesscpy%2Flesscpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesscpy%2Flesscpy/lists"}