ff-name-styler 0.1.0__py3-none-any.whl

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,140 @@
1
+ """ff-name-styler: stylish nickname generator for Free Fire.
2
+
3
+ Turns a plain name into 10 Unicode styles that were verified inside the
4
+ actual Free Fire client, with a character counter that counts the way the
5
+ game counts (12-character nickname limit).
6
+ """
7
+
8
+ GAME_LIMIT = 12
9
+
10
+
11
+ def _fullwidth(text):
12
+ out = []
13
+ for ch in text:
14
+ n = ord(ch)
15
+ if 65 <= n <= 90:
16
+ out.append(chr(0xFF21 + n - 65))
17
+ elif 97 <= n <= 122:
18
+ out.append(chr(0xFF41 + n - 97))
19
+ elif 48 <= n <= 57:
20
+ out.append(chr(0xFF10 + n - 48))
21
+ else:
22
+ out.append(ch)
23
+ return "".join(out)
24
+
25
+
26
+ def _circled(text):
27
+ out = []
28
+ for ch in text:
29
+ n = ord(ch)
30
+ if 65 <= n <= 90:
31
+ out.append(chr(0x24B6 + n - 65))
32
+ elif 97 <= n <= 122:
33
+ out.append(chr(0x24D0 + n - 97))
34
+ elif ch == "0":
35
+ out.append("\u24ea")
36
+ elif 49 <= n <= 57:
37
+ out.append(chr(0x2460 + n - 49))
38
+ else:
39
+ out.append(ch)
40
+ return "".join(out)
41
+
42
+
43
+ _SMALL_CAPS = {
44
+ "a": "\u1d00", "b": "\u0299", "c": "\u1d04", "d": "\u1d05",
45
+ "e": "\u1d07", "f": "\u0493", "g": "\u0262", "h": "\u029c",
46
+ "i": "\u026a", "j": "\u1d0a", "k": "\u1d0b", "l": "\u029f",
47
+ "m": "\u1d0d", "n": "\u0274", "o": "\u1d0f", "p": "\u1d18",
48
+ "q": "\u02a0", "r": "\u1d19", "s": "\ua731", "t": "\u1d1b",
49
+ "u": "\u1d1c", "v": "\u1d20", "w": "\u1d21", "x": "x",
50
+ "y": "\u028f", "z": "\u1d22",
51
+ }
52
+
53
+
54
+ def _small_caps(text):
55
+ def conv(ch):
56
+ low = ch.lower()
57
+ if "a" <= low <= "z":
58
+ return _SMALL_CAPS.get(low, ch)
59
+ return ch
60
+
61
+ return "".join(conv(ch) for ch in text)
62
+
63
+
64
+ _UPSIDE_DOWN = {
65
+ "a": "\u0250", "b": "q", "c": "\u0254", "d": "p",
66
+ "e": "\u01dd", "f": "\u025f", "g": "\u0183", "h": "\u0265",
67
+ "i": "\u1d09", "j": "\u027e", "k": "\u029e", "l": "l",
68
+ "m": "\u026f", "n": "u", "o": "o", "p": "d",
69
+ "q": "b", "r": "\u0279", "s": "s", "t": "\u0287",
70
+ "u": "n", "v": "\u028c", "w": "\u028d", "x": "x",
71
+ "y": "\u028e", "z": "z",
72
+ }
73
+
74
+
75
+ def _upside_down(text):
76
+ def conv(ch):
77
+ low = ch.lower()
78
+ if "a" <= low <= "z":
79
+ return _UPSIDE_DOWN.get(low, ch)
80
+ return ch
81
+
82
+ return "".join(conv(ch) for ch in reversed(text))
83
+
84
+
85
+ STYLES = {
86
+ "small_caps": _small_caps,
87
+ "bubble": _circled,
88
+ "wide": _fullwidth,
89
+ "upside_down": _upside_down,
90
+ "crown": lambda t: "\ua9c1" + t + "\ua9c2",
91
+ "star": lambda t: "\u2605\u5f61" + t + "\u5f61\u2605",
92
+ "blade": lambda t: "\u4e42" + t + "\u4e42",
93
+ "king": lambda t: "\u265b" + t + "\u265b",
94
+ "brackets": lambda t: "\u300e" + t + "\u300f",
95
+ "smile": lambda t: "\u30c4" + t + "\u30c4",
96
+ }
97
+
98
+
99
+ def style(text, style_name):
100
+ """Render *text* in the named style (one of STYLES keys)."""
101
+ try:
102
+ func = STYLES[style_name]
103
+ except KeyError:
104
+ raise ValueError(
105
+ "unknown style %r (choose from %s)" % (style_name, ", ".join(STYLES))
106
+ )
107
+ return func(text)
108
+
109
+
110
+ def char_count(text):
111
+ """Count characters the way Free Fire counts them (Unicode code points)."""
112
+ return len(text)
113
+
114
+
115
+ def fits_game_limit(text):
116
+ """True if *text* fits Free Fire's 12-character nickname limit."""
117
+ return len(text) <= GAME_LIMIT
118
+
119
+
120
+ def all_styles(text):
121
+ """Return {style_name: rendered} for every style."""
122
+ return {name: func(text) for name, func in STYLES.items()}
123
+
124
+
125
+ def main(argv=None):
126
+ import sys
127
+
128
+ args = sys.argv[1:] if argv is None else argv
129
+ if not args:
130
+ print("usage: python -m ff_name_styler <name>")
131
+ raise SystemExit(2)
132
+ name = " ".join(args)
133
+ for style_name, func in STYLES.items():
134
+ out = func(name)
135
+ mark = "OK " if len(out) <= GAME_LIMIT else "TOO LONG"
136
+ print("[%s] %-12s %s (%d/12)" % (mark, style_name, out, len(out)))
137
+
138
+
139
+ if __name__ == "__main__":
140
+ main()
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
2
+ Name: ff-name-styler
3
+ Version: 0.1.0
4
+ Summary: Stylish nickname generator for Free Fire — 10 in-game-tested Unicode styles with a 12-character counter.
5
+ Author: Fin Alen
6
+ License: MIT
7
+ Project-URL: Homepage, https://ffnamegenerator.com/
8
+ Keywords: free-fire,nickname,unicode,styler
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: Games/Entertainment
13
+ Classifier: Topic :: Text Processing
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+
17
+ # ff-name-styler
18
+
19
+ Stylish nickname generator for Free Fire — 10 Unicode styles that were
20
+ verified inside the actual Free Fire client, plus a character counter that
21
+ counts the way the game counts (12-character nickname limit).
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install ff-name-styler
27
+ ```
28
+
29
+ ## Use it
30
+
31
+ ```python
32
+ from ff_name_styler import style, all_styles, fits_game_limit
33
+
34
+ print(style("Ali", "crown")) # ꧁Ali꧂
35
+ print(style("Ali", "small_caps")) # ᴀʟɪ
36
+
37
+ for name, out in all_styles("Ali").items():
38
+ print(name, "->", out, fits_game_limit(out))
39
+ ```
40
+
41
+ Or from the command line:
42
+
43
+ ```bash
44
+ python -m ff_name_styler Ali
45
+ ```
46
+
47
+ ## Full tool
48
+
49
+ For 100+ styles, a symbol crate, and in-game-tested guides, see the free web tool:
50
+
51
+ https://ffnamegenerator.com/
52
+
53
+ ## License
54
+
55
+ MIT — not affiliated with Garena.
@@ -0,0 +1,5 @@
1
+ ff_name_styler/__init__.py,sha256=mOn6Fblbt-oCJm5u_KYEIiBS-WPTSovzy88pxSuXiLc,3886
2
+ ff_name_styler-0.1.0.dist-info/METADATA,sha256=7kT5B2yk3M3mn2tCANwNKsl0DuwIP2OezrPGrPZGYHc,1387
3
+ ff_name_styler-0.1.0.dist-info/WHEEL,sha256=a-udL2m4V_6Yn8b-uKzWb12RjRxwwMo6ohYFM24tpaY,91
4
+ ff_name_styler-0.1.0.dist-info/top_level.txt,sha256=SNR87Vv9DyBBG8fI1si0H1lnklnDLrXCujdI4wHgJ7E,15
5
+ ff_name_styler-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ ff_name_styler