Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ jobs:
python -m pip install build
python -m build
python -m pip install dist/woad-*.whl
python -c "import woad; assert woad.__version__ == '0.0.0'; print(woad.__version__)"
python -c "import woad; assert woad.__version__ == '0.0.1'; print(woad.__version__)"

build-py27:

Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
# woad.Python - Changes <!-- omit in toc -->


## 0.0.1 - 15th August 2026

* SGR colour and reset codes (`RESET`, `FG_*`, `BG_*`, including bright variants);


## 0.0.0 - 15th August 2026

* initial project scaffolding;
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
# woad.Python - News <!-- omit in toc -->

| Date | News Item |
| ---------------- | ------------------------------------------------------------------------------------------ |
| 15th August 2026 | [**woad.Python** 0.0.1](https://github.com/synesissoftware/woad.Python/releases/tag/0.0.1) |
| 15th August 2026 | [**woad.Python** 0.0.0](https://github.com/synesissoftware/woad.Python/releases/tag/0.0.0) |


<!-- ########################### end of file ########################### -->
5 changes: 4 additions & 1 deletion README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,12 +46,14 @@ Use via **import**:

```Python
import woad

print(woad.FG_GREEN + "ok" + woad.RESET)
```


## Components

**woad.Python** currently ships the **`woad`** package and version metadata (`woad.__version__`). Colour codes, TTY/stream gating, and Windows virtual-terminal opt-in are not implemented in this 0.0.0 skeleton.
**woad.Python** ships SGR string constants (`RESET`, `FG_*`, `BG_*`, including bright variants). TTY/stream gating and Windows virtual-terminal opt-in are not implemented yet.


## Project Information
Expand DownExpand Up@@ -87,6 +89,7 @@ None (currently).

### Related projects

* [**woad**](https://github.com/synesissoftware/woad/)
* [**woad.Ruby**](https://github.com/synesissoftware/woad.Ruby/)
* [**woad.Rust**](https://github.com/synesissoftware/woad.Rust/)

Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

## Functional improvements

* [ ] SGR colour and reset codes;
* [x] ~~~SGR colour and reset codes~~~ ✅;
* [ ] TTY-conditional colour codes (process and per-stream);
* [ ] Windows virtual-terminal gating (OS build + `GetConsoleMode`);

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ license = { text = "BSD-3-Clause" }
name = "woad"
readme = "README.md"
requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*"
version = "0.0.0"
version = "0.0.1"

[project.urls]
"Bug Tracker" = "https://github.com/synesissoftware/woad.Python/issues"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@

name='woad',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
version='0.0.0',
version='0.0.1',

author='Matt Wilson',
author_email='matthew@synesis.com.au',
Expand Down
29 changes: 28 additions & 1 deletion tests/test_woad.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,4 +7,31 @@ class Test_woad(unittest.TestCase):

def test_version(self):

self.assertEqual('0.0.0', woad.__version__)
self.assertEqual('0.0.1', woad.__version__)

def test_RESET(self):

self.assertEqual('\033[0m', woad.RESET)

def test_FG_RED(self):

self.assertEqual('\033[31m', woad.FG_RED)

def test_BG_BLUE(self):

self.assertEqual('\033[44m', woad.BG_BLUE)

def test_all_codes_are_csi_sgr(self):

for name in woad.__all__:

code = getattr(woad, name)

self.assertTrue(
code.startswith('\033['),
name,
)
self.assertTrue(
code.endswith('m'),
name,
)
91 changes: 90 additions & 1 deletion woad/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,94 @@
__license__ = 'BSD-3-Clause'
__maintainer__ = 'Matt Wilson'
__status__ = 'Alpha'
__version__ = '0.0.0'
__version__ = '0.0.1'


# Reset

RESET = '\033[0m'


# Foreground (standard)

FG_BLACK = '\033[30m'
FG_RED = '\033[31m'
FG_GREEN = '\033[32m'
FG_YELLOW = '\033[33m'
FG_BLUE = '\033[34m'
FG_MAGENTA = '\033[35m'
FG_CYAN = '\033[36m'
FG_WHITE = '\033[37m'


# Foreground (bright)

FG_BRIGHT_BLACK = '\033[90m'
FG_BRIGHT_RED = '\033[91m'
FG_BRIGHT_GREEN = '\033[92m'
FG_BRIGHT_YELLOW = '\033[93m'
FG_BRIGHT_BLUE = '\033[94m'
FG_BRIGHT_MAGENTA = '\033[95m'
FG_BRIGHT_CYAN = '\033[96m'
FG_BRIGHT_WHITE = '\033[97m'


# Background (standard)

BG_BLACK = '\033[40m'
BG_RED = '\033[41m'
BG_GREEN = '\033[42m'
BG_YELLOW = '\033[43m'
BG_BLUE = '\033[44m'
BG_MAGENTA = '\033[45m'
BG_CYAN = '\033[46m'
BG_WHITE = '\033[47m'


# Background (bright)

BG_BRIGHT_BLACK = '\033[100m'
BG_BRIGHT_RED = '\033[101m'
BG_BRIGHT_GREEN = '\033[102m'
BG_BRIGHT_YELLOW = '\033[103m'
BG_BRIGHT_BLUE = '\033[104m'
BG_BRIGHT_MAGENTA = '\033[105m'
BG_BRIGHT_CYAN = '\033[106m'
BG_BRIGHT_WHITE = '\033[107m'


__all__ = [
'BG_BLACK',
'BG_BLUE',
'BG_BRIGHT_BLACK',
'BG_BRIGHT_BLUE',
'BG_BRIGHT_CYAN',
'BG_BRIGHT_GREEN',
'BG_BRIGHT_MAGENTA',
'BG_BRIGHT_RED',
'BG_BRIGHT_WHITE',
'BG_BRIGHT_YELLOW',
'BG_CYAN',
'BG_GREEN',
'BG_MAGENTA',
'BG_RED',
'BG_WHITE',
'BG_YELLOW',
'FG_BLACK',
'FG_BLUE',
'FG_BRIGHT_BLACK',
'FG_BRIGHT_BLUE',
'FG_BRIGHT_CYAN',
'FG_BRIGHT_GREEN',
'FG_BRIGHT_MAGENTA',
'FG_BRIGHT_RED',
'FG_BRIGHT_WHITE',
'FG_BRIGHT_YELLOW',
'FG_CYAN',
'FG_GREEN',
'FG_MAGENTA',
'FG_RED',
'FG_WHITE',
'FG_YELLOW',
'RESET',
]
Loading