nicholasbruce 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: nicholasbruce
3
+ Version: 0.0.0
4
+ Summary: Nicholas Bruce's terminal business card
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: termcolor>=3.1.0
@@ -0,0 +1,76 @@
1
+ from termcolor import colored
2
+ import re
3
+
4
+
5
+ def main():
6
+ def hex_to_ansi(hex_color):
7
+ return tuple(int(hex_color.lstrip('#')[i:i + 2], 16) for i in (0, 2, 4))
8
+
9
+ # Define colors and styles (Base4Tone Classic C)
10
+ def border(x): return colored(x, hex_to_ansi('#1ABC9C'))
11
+ def divider(x): return colored(x, hex_to_ansi('#7F8C8D'))
12
+ def plain_text(x): return colored(x, hex_to_ansi('#FFFFFF'))
13
+ def secondary(x): return colored(x, hex_to_ansi('#C0392B'))
14
+ def highlight(x): return colored(x, hex_to_ansi('#FDBC4B'), attrs=['bold'])
15
+ def handle(x): return colored(x, hex_to_ansi('#16A085'))
16
+ def label(x): return colored(x, hex_to_ansi('#1D99F3'), attrs=['bold'])
17
+ def bsky(x): return colored(x, hex_to_ansi('#3DAEE9'))
18
+ def url(x): return colored(x, hex_to_ansi('#55A649'), attrs=['underline'])
19
+ def email(x): return colored(x, hex_to_ansi('#9B59B6'))
20
+ def gh(x): return colored(x, hex_to_ansi('#FDBC4B'))
21
+ def work(x): return colored(x, hex_to_ansi('#ED1515'))
22
+
23
+ flag = '🇨🇦'
24
+ # Card dimensions - fixed width for better alignment
25
+ width = 57
26
+
27
+ # Create borders with exact width
28
+ top_border = border('╭' + '─' * width + '╮')
29
+ bottom_border = border('╰' + '─' * width + '╯')
30
+
31
+ def strip_ansi_codes(text):
32
+ ansi_escape_pattern = re.compile(r'\x1b\[[0-9;]*m')
33
+ return ansi_escape_pattern.sub('', text)
34
+
35
+ # Function to create a line with perfectly aligned borders
36
+ def create_line(text: str):
37
+ # Strip ANSI codes for accurate length calculation
38
+ clean_text = strip_ansi_codes(text)
39
+ padding = width - len(clean_text)
40
+ return border('│') + text + ' ' * padding + border('│')
41
+
42
+ # Empty line and divider
43
+ empty_line = create_line(' ' * width)
44
+ horiz_line = create_line(' ' + divider('─' * (width - 2)) + ' ')
45
+
46
+ # Build the card with precise spacing
47
+ card = [
48
+ '',
49
+ top_border,
50
+ empty_line,
51
+ create_line(' ' + highlight('Nicholas Bruce') + ' ' + secondary(
52
+ '(') + plain_text('he/him') + secondary(')')),
53
+ horiz_line,
54
+ empty_line,
55
+ create_line(' ' + work('⚙') + ' ' + label('Work') + divider(
56
+ ' ∴ ') + plain_text('Radio telescope engineer @ NRC ') + flag),
57
+ create_line(' ' + bsky('☁') + ' ' + label('Bluesky') +
58
+ divider(' ∴ ') + handle('@dorktips')),
59
+ create_line(' ' + gh('★') + ' ' + label('GitHub') +
60
+ divider(' ∴ ') + url('https://github.com/nsbruce')),
61
+ create_line(' ' + email('✉') + ' ' + label('Email') +
62
+ divider(' ∴ ') + url('nicholas@nicholasbruce.ca')),
63
+ empty_line,
64
+ horiz_line,
65
+ create_line(' ' + divider('>') + ' ' + plain_text('Run') + ' `' + secondary('pipx run') +
66
+ ' ' + highlight('nicholasbruce') + '` ' + plain_text('anytime to see this card')),
67
+ empty_line,
68
+ bottom_border,
69
+ ''
70
+ ]
71
+
72
+ print('\n'.join(card))
73
+
74
+
75
+ if __name__ == "__main__":
76
+ main()
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: nicholasbruce
3
+ Version: 0.0.0
4
+ Summary: Nicholas Bruce's terminal business card
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: termcolor>=3.1.0
@@ -0,0 +1,9 @@
1
+ pyproject.toml
2
+ ./nicholasbruce/main.py
3
+ nicholasbruce/main.py
4
+ nicholasbruce.egg-info/PKG-INFO
5
+ nicholasbruce.egg-info/SOURCES.txt
6
+ nicholasbruce.egg-info/dependency_links.txt
7
+ nicholasbruce.egg-info/entry_points.txt
8
+ nicholasbruce.egg-info/requires.txt
9
+ nicholasbruce.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ start = nicholasbruce.main:main
@@ -0,0 +1 @@
1
+ termcolor>=3.1.0
@@ -0,0 +1,2 @@
1
+ dist
2
+ nicholasbruce
@@ -0,0 +1,21 @@
1
+ [project]
2
+ name = "nicholasbruce"
3
+ version = "0.0.0"
4
+ description = "Nicholas Bruce's terminal business card"
5
+ requires-python = ">=3.12"
6
+ dependencies = [
7
+ "termcolor>=3.1.0",
8
+ ]
9
+
10
+ [build-system]
11
+ requires = ["setuptools>=61.0"]
12
+ build-backend = "setuptools.build_meta"
13
+
14
+ [project.scripts]
15
+ start = "nicholasbruce.main:main"
16
+
17
+ [tool.setuptools]
18
+ package-dir = {"" = "."}
19
+
20
+ [tool.setuptools.packages.find]
21
+ where = ["."]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+