A framing library for content with headers and body.
Project description
Kirje
A framing library for content with headers and body.
Installation: pip install kirje
Usage
Import Kirje
and KirjeDetails
. Initialize KirjeDetails
and use it as parameter to construct concrete Kirje
object.
from kirje import Kirje, KirjeDetails
details = KirjeDetails(
headers={
'ID': 2,
'Title': 'Hello world',
'Created': '2023-10-27 14:18:14',
'Modified': '2023-10-27 14:18:25'
},
content="Hello\nworld."
)
message = Kirje(details)
message.display("rounded")
Expected output:
╭──────────Hello world──────────╮
│ ID: 2 │
│ Created: 2023-10-27 14:18:14 │
│ Modified: 2023-10-27 14:18:25 │
├───────────────────────────────┤
│ Hello │
│ world. │
╰───────────────────────────────╯
Styles
Default:
+----------Hello world----------+
| ID: 2 |
| Created: 2023-10-27 14:18:14 |
| Modified: 2023-10-27 14:18:25 |
+-------------------------------+
| Hello |
| world. |
+-------------------------------+
Rounded:
╭──────────Hello world──────────╮
│ ID: 2 │
│ Created: 2023-10-27 14:18:14 │
│ Modified: 2023-10-27 14:18:25 │
├───────────────────────────────┤
│ Hello │
│ world. │
╰───────────────────────────────╯
Doubled style letter:
+==========Hello world==========+
‖ ID: 2 ‖
‖ Created: 2023-10-27 14:18:14 ‖
‖ Modified: 2023-10-27 14:18:25 ‖
+===============================+
‖ Hello ‖
‖ world. ‖
+===============================+
Streamlined style letter:
+==========Hello world==========+
| ID: 2 |
| Created: 2023-10-27 14:18:14 |
| Modified: 2023-10-27 14:18:25 |
+-------------------------------+
| Hello |
| world. |
+===============================+
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kirje-0.2.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
kirje-0.2.0-py3-none-any.whl
(4.2 kB
view hashes)