Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
olyatjtaylo committed Apr 29, 2024
1 parent 5e95437 commit 1973251
Show file tree
Hide file tree
Showing 25 changed files with 630 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.venv/
.vscode/
.venv/
.vscode/

114 changes: 102 additions & 12 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,74 @@ Styles
:target: https://pypi.python.org/pypi/style


style
=====

|Build Status| |PyPI version|

**style** is a simple terminal string styling library. Its API is a port of the popular
`chalk <https://github.com/chalk/chalk>`__ module for javascript.


Install
-------

::

$ pip install style


Usage
-----

.. code:: py
import style
print(style.red('Hello', style.bold('world') + '!'))
API
---

style.\ ``style*[.style](*objects, sep=' ')``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Chain `styles <#styles>`__ and call the last one as a method with an argument. Order doesn't matter, and later styles
take precedence in case of a conflict, e.g. ``style.red.yellow.green`` is equivalent to ``style.green``. Styles can
be nested.

Multiple arguments will be separated by ``sep``, a space by default.

style.\ ``enabled``
~~~~~~~~~~~~~~~~~~~

Color support is automatically detected, but can also be changed manually.

- set ``style.enabled`` to ``True`` or ``False``
- use the command line parameter ``--color`` or ``--no-color``


Styles
------

+---------------------+-------------------------------------+-------------------------------------------+
| Modifiers | Colors | Background colors |
+=====================+===============+=====================+==================+========================+
| - ``bold`` | - ``black`` | - ``light_black`` | - ``on_black`` | - ``on_light_black`` |
| - ``dim`` | - ``red`` | - ``light_red`` | - ``on_red`` | - ``on_light_red`` |
| - ``italic`` | - ``green`` | - ``light_green`` | - ``on_green`` | - ``on_light_green`` |
| - ``underline`` | - ``yellow`` | - ``light_yellow`` | - ``on_yellow`` | - ``on_light_yellow`` |
| - ``inverse`` | - ``blue`` | - ``light_blue`` | - ``on_blue`` | - ``on_light_blue`` |
| - ``hidden`` | - ``magenta`` | - ``light_magenta`` | - ``on_magenta`` | - ``on_light_magenta`` |
| - ``strikethrough`` | - ``cyan`` | - ``light_cyan`` | - ``on_cyan`` | - ``on_light_cyan`` |
| | - ``white`` | - ``light_white`` | - ``on_white`` | - ``on_light_white`` |
+---------------------+---------------+---------------------+------------------+------------------------+


.. |Build Status| image:: https://travis-ci.org/lmittmann/style.svg?branch=master
:target: https://travis-ci.org/lmittmann/style
.. |PyPI version| image:: https://img.shields.io/pypi/v/style.svg
:target: https://pypi.python.org/pypi/style


Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pip
pip
82 changes: 82 additions & 0 deletions .venv/lib/python3.10/site-packages/style-1.1.0.dist-info/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,85 @@ Styles
:target: https://pypi.python.org/pypi/style


Metadata-Version: 2.0
Name: style
Version: 1.1.0
Summary: 🌈 Terminal string styling
Home-page: https://github.com/lmittmann/style
Author: lmittmann
Author-email: UNKNOWN
License: MIT
Keywords: style,color,ansi,terminal styling,chalk
Platform: UNKNOWN

style
=====

|Build Status| |PyPI version|

**style** is a simple terminal string styling library. Its API is a port of the popular
`chalk <https://github.com/chalk/chalk>`__ module for javascript.


Install
-------

::

$ pip install style


Usage
-----

.. code:: py

import style

print(style.red('Hello', style.bold('world') + '!'))


API
---

style.\ ``style*[.style](*objects, sep=' ')``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Chain `styles <#styles>`__ and call the last one as a method with an argument. Order doesn't matter, and later styles
take precedence in case of a conflict, e.g. ``style.red.yellow.green`` is equivalent to ``style.green``. Styles can
be nested.

Multiple arguments will be separated by ``sep``, a space by default.

style.\ ``enabled``
~~~~~~~~~~~~~~~~~~~

Color support is automatically detected, but can also be changed manually.

- set ``style.enabled`` to ``True`` or ``False``
- use the command line parameter ``--color`` or ``--no-color``


Styles
------

+---------------------+-------------------------------------+-------------------------------------------+
| Modifiers | Colors | Background colors |
+=====================+===============+=====================+==================+========================+
| - ``bold`` | - ``black`` | - ``light_black`` | - ``on_black`` | - ``on_light_black`` |
| - ``dim`` | - ``red`` | - ``light_red`` | - ``on_red`` | - ``on_light_red`` |
| - ``italic`` | - ``green`` | - ``light_green`` | - ``on_green`` | - ``on_light_green`` |
| - ``underline`` | - ``yellow`` | - ``light_yellow`` | - ``on_yellow`` | - ``on_light_yellow`` |
| - ``inverse`` | - ``blue`` | - ``light_blue`` | - ``on_blue`` | - ``on_light_blue`` |
| - ``hidden`` | - ``magenta`` | - ``light_magenta`` | - ``on_magenta`` | - ``on_light_magenta`` |
| - ``strikethrough`` | - ``cyan`` | - ``light_cyan`` | - ``on_cyan`` | - ``on_light_cyan`` |
| | - ``white`` | - ``light_white`` | - ``on_white`` | - ``on_light_white`` |
+---------------------+---------------+---------------------+------------------+------------------------+


.. |Build Status| image:: https://travis-ci.org/lmittmann/style.svg?branch=master
:target: https://travis-ci.org/lmittmann/style
.. |PyPI version| image:: https://img.shields.io/pypi/v/style.svg
:target: https://pypi.python.org/pypi/style


19 changes: 19 additions & 0 deletions .venv/lib/python3.10/site-packages/style-1.1.0.dist-info/RECORD
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,22 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
tests/__pycache__/__init__.cpython-310.pyc,,
tests/__pycache__/test_style.cpython-310.pyc,,
tests/test_style.py,sha256=JDzfyhUrPeaOihokRIXtrfMYMuF0uAeQyuSlbhw-4Uo,2170
style-1.1.0.dist-info/DESCRIPTION.rst,sha256=x8pJVWXjdwJbsSpCe2t611nwYZip6MKTYdQQZF_GrW0,2538
style-1.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
style-1.1.0.dist-info/METADATA,sha256=zCbvKKINzGKORksBqxs0zepMsNGnTCVzgv3oBsjE9Zg,2793
style-1.1.0.dist-info/RECORD,,
style-1.1.0.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110
style-1.1.0.dist-info/metadata.json,sha256=Gt5EeUNmPGbz_41gzH_we5dAgFYzpF7dv9XnLzwr_kw,451
style-1.1.0.dist-info/top_level.txt,sha256=0nMvznycP8HNk_oPGaKBeMOXi3dssV9xWO3JA14e_cs,12
style/__init__.py,sha256=asa1CAfCZTFCD0KhixpppIYGZ974WvkmyKxHl-d_hnM,418
style/__pycache__/__init__.cpython-310.pyc,,
style/__pycache__/ansi.cpython-310.pyc,,
style/__pycache__/styled_string.cpython-310.pyc,,
style/__pycache__/styled_string_builder.cpython-310.pyc,,
style/ansi.py,sha256=beQ3aKea3Q4RLKsJv9SHSbNUSsAM-jBtOZ5HBYEH2dY,1089
style/styled_string.py,sha256=zZAzEX8ghLyl_6pIfzDnYjHwduCgAAZZNkh-ZUuBqnQ,1038
style/styled_string_builder.py,sha256=DmQSoh8NHdpyHVahznW0n8WHm007Em59hsuinXA7NxU,1389
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
tests/__pycache__/__init__.cpython-310.pyc,,
tests/__pycache__/test_style.cpython-310.pyc,,
tests/test_style.py,sha256=JDzfyhUrPeaOihokRIXtrfMYMuF0uAeQyuSlbhw-4Uo,2170
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any

Wheel-Version: 1.0
Generator: bdist_wheel (0.29.0)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{"extensions": {"python.details": {"contacts": [{"name": "lmittmann", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/lmittmann/style"}}}, "generator": "bdist_wheel (0.29.0)", "keywords": ["style", "color", "ansi", "terminal", "styling", "chalk"], "license": "MIT", "metadata_version": "2.0", "name": "style", "summary": "\ud83c\udf08 Terminal string styling", "version": "1.1.0"}
{"extensions": {"python.details": {"contacts": [{"name": "lmittmann", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/lmittmann/style"}}}, "generator": "bdist_wheel (0.29.0)", "keywords": ["style", "color", "ansi", "terminal", "styling", "chalk"], "license": "MIT", "metadata_version": "2.0", "name": "style", "summary": "\ud83c\udf08 Terminal string styling", "version": "1.1.0"}
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
style
tests
style
tests
Loading

0 comments on commit 1973251

Please sign in to comment.