endfield-cards 1.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.
Files changed (37) hide show
  1. endfield_cards-1.0.0/LICENSE.txt +21 -0
  2. endfield_cards-1.0.0/PKG-INFO +257 -0
  3. endfield_cards-1.0.0/README.md +221 -0
  4. endfield_cards-1.0.0/pyproject.toml +41 -0
  5. endfield_cards-1.0.0/setup.cfg +4 -0
  6. endfield_cards-1.0.0/src/endfield_cards/__init__.py +3 -0
  7. endfield_cards-1.0.0/src/endfield_cards/character/__init__.py +0 -0
  8. endfield_cards-1.0.0/src/endfield_cards/character/template1/__init__.py +0 -0
  9. endfield_cards-1.0.0/src/endfield_cards/character/template1/character.py +255 -0
  10. endfield_cards-1.0.0/src/endfield_cards/character/template1/relics.py +115 -0
  11. endfield_cards-1.0.0/src/endfield_cards/character/template1/skills.py +70 -0
  12. endfield_cards-1.0.0/src/endfield_cards/character/template1/stats.py +61 -0
  13. endfield_cards-1.0.0/src/endfield_cards/character/template1/weapon.py +155 -0
  14. endfield_cards-1.0.0/src/endfield_cards/client.py +135 -0
  15. endfield_cards-1.0.0/src/endfield_cards/models/__init__.py +0 -0
  16. endfield_cards-1.0.0/src/endfield_cards/models/profile1.py +14 -0
  17. endfield_cards-1.0.0/src/endfield_cards/profile/__init__.py +0 -0
  18. endfield_cards-1.0.0/src/endfield_cards/profile/template1/__init.py +0 -0
  19. endfield_cards-1.0.0/src/endfield_cards/profile/template1/char_showcase.py +52 -0
  20. endfield_cards-1.0.0/src/endfield_cards/profile/template1/medals.py +28 -0
  21. endfield_cards-1.0.0/src/endfield_cards/profile/template1/profile1.py +59 -0
  22. endfield_cards-1.0.0/src/endfield_cards/utils/__init__.py +0 -0
  23. endfield_cards-1.0.0/src/endfield_cards/utils/assets/__init__.py +0 -0
  24. endfield_cards-1.0.0/src/endfield_cards/utils/assets/asset_map.py +115 -0
  25. endfield_cards-1.0.0/src/endfield_cards/utils/assets/core.py +190 -0
  26. endfield_cards-1.0.0/src/endfield_cards/utils/char1.py +38 -0
  27. endfield_cards-1.0.0/src/endfield_cards/utils/fonts/__init__.py +0 -0
  28. endfield_cards-1.0.0/src/endfield_cards/utils/fonts/fonts.py +32 -0
  29. endfield_cards-1.0.0/src/endfield_cards/utils/pil.py +10 -0
  30. endfield_cards-1.0.0/src/endfield_cards/utils/render/__init__.py +0 -0
  31. endfield_cards-1.0.0/src/endfield_cards/utils/render/pil.py +0 -0
  32. endfield_cards-1.0.0/src/endfield_cards.egg-info/PKG-INFO +257 -0
  33. endfield_cards-1.0.0/src/endfield_cards.egg-info/SOURCES.txt +35 -0
  34. endfield_cards-1.0.0/src/endfield_cards.egg-info/dependency_links.txt +1 -0
  35. endfield_cards-1.0.0/src/endfield_cards.egg-info/requires.txt +5 -0
  36. endfield_cards-1.0.0/src/endfield_cards.egg-info/top_level.txt +2 -0
  37. endfield_cards-1.0.0/src/examples/basic_usage.py +16 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MR-LORD-REX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,257 @@
1
+ Metadata-Version: 2.4
2
+ Name: endfield-cards
3
+ Version: 1.0.0
4
+ Summary: A library for creating beautiful cards for Endfield.
5
+ Author-email: sora <sahikast07@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 MR-LORD-REX
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE.txt
30
+ Requires-Dist: pydantic>=2.5
31
+ Requires-Dist: aiohttp>=3.9
32
+ Requires-Dist: endfield-py>=1.0.7
33
+ Requires-Dist: pillow>=12.2.0
34
+ Requires-Dist: numpy>=2.4.5
35
+ Dynamic: license-file
36
+
37
+ # Endfield Cards
38
+
39
+ [![PyPI version](https://img.shields.io/pypi/v/endfield-cards)](https://pypi.org/project/endfield-cards/)
40
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
41
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.txt)
42
+
43
+ A powerful Python library for generating beautiful character and profile cards for **Endfield**. This library provides an easy-to-use interface to create stunning visual cards with character stats, weapons, relics, and profile information.
44
+
45
+ ## Features
46
+
47
+ **Beautiful Card Templates** - Multiple professional templates for character showcase and profile cards
48
+
49
+ **Complete Character Information** - Display stats, skills, weapons, relics, and more
50
+
51
+ **Profile Cards** - Generate comprehensive profile cards with operator showcase
52
+
53
+ **Async Support** - Full async/await support for efficient operations
54
+
55
+ **Caching** - Smart asset caching for improved performance
56
+
57
+ **Easy Integration** - Simple API for quick integration into your projects
58
+
59
+ ## Installation
60
+
61
+ ### From PyPI (Recommended)
62
+
63
+ ```bash
64
+ pip install endfield-cards
65
+ ```
66
+
67
+ ### From Source
68
+
69
+ ```bash
70
+ git clone https://github.com/MR-LORD-REX/endfield-cards.git
71
+ cd endfield-cards
72
+ pip install -e .
73
+ ```
74
+
75
+ ## Dependencies
76
+
77
+ This library depends on:
78
+
79
+ - **[endfield-py](https://github.com/MR-LORD-REX/endfield)** - Core Endfield game data client
80
+ - **[enka.network](https://enka.network)** - Player data and asset provider
81
+
82
+
83
+ ## Quick Start
84
+
85
+ ### Basic Usage
86
+
87
+ ```python
88
+ import asyncio
89
+ from ef_cards import EFCard
90
+
91
+ async def main():
92
+ uid = 4225399080 # Your Endfield UID
93
+
94
+ # Using async context manager (recommended)
95
+ async with EFCard() as ef_card:
96
+ # Get a single character card
97
+ char_card = await ef_card.get_character_card(uid, char_index=0)
98
+ char_card.save("character_card.png")
99
+
100
+ # Get all characters cards
101
+ all_cards = await ef_card.get_all_characters_card(uid)
102
+
103
+ # Get profile card with showcase
104
+ profile = await ef_card.get_profile_card(uid)
105
+ profile.card.save("profile_card.png")
106
+
107
+ if __name__ == "__main__":
108
+ asyncio.run(main())
109
+ ```
110
+
111
+ ### Without Context Manager
112
+
113
+ ```python
114
+ import asyncio
115
+ from ef_cards import EFCard
116
+
117
+ async def main():
118
+ ef_card = EFCard()
119
+ try:
120
+ char_card = await ef_card.get_character_card(4225399080, char_index=0)
121
+ char_card.save("character_card.png")
122
+ finally:
123
+ await ef_card.close() # Don't forget to close!
124
+
125
+ if __name__ == "__main__":
126
+ asyncio.run(main())
127
+ ```
128
+
129
+ ## Available Methods
130
+
131
+ ### Character Card
132
+
133
+ ```python
134
+ # Get a single character card
135
+ card = await ef_card.get_character_card(
136
+ uid: int,
137
+ char_index: int = 0,
138
+ user_img: Image.Image | None = None,
139
+ template: int = 1
140
+ ) -> Image.Image
141
+ ```
142
+
143
+ ### All Characters Cards
144
+
145
+ ```python
146
+ # Get cards for all characters in a profile
147
+ cards = await ef_card.get_all_characters_card(
148
+ uid: int,
149
+ user_imgs: list[Image.Image] | None = None,
150
+ template: int = 1
151
+ ) -> list[Image.Image]
152
+ ```
153
+
154
+ ### Profile Card
155
+
156
+ ```python
157
+ # Get a complete profile card with showcase
158
+ profile = await ef_card.get_profile_card(
159
+ uid: int,
160
+ template: int = 1
161
+ ) -> ProfileCard_1
162
+ ```
163
+
164
+ ## Card Information
165
+
166
+ ### Character Card Template 1 (1920x800)
167
+
168
+ Displays comprehensive character information including:
169
+
170
+ - **Main Frame** - Character artwork and basic stats
171
+ - **Weapon Panel** - Current weapon with stats
172
+ - **Relic Panel** - Equipped relics and bonuses
173
+ - **Skill Panel** - Character skills and cooldowns
174
+ - **Stats Panel** - Detailed character statistics
175
+
176
+ ### Profile Card Template 1 (1080x1467)
177
+
178
+ Includes:
179
+
180
+ - **Player Profile** - UID, Authority Level, Exploration Level
181
+ - **Awakening Day** - Days since account creation
182
+ - **Operator Showcase** - 4 featured characters
183
+ - **Statistics** - Total operators, weapons, and files collected
184
+ - **Regional Development** - Development levels by region
185
+
186
+ ## Example Output
187
+
188
+ ### Character Card
189
+ ![Character Card Example](https://github.com/MR-LORD-REX/endfield-cards/blob/main/src/examples/cards/char_card1.png)
190
+
191
+ ### Profile Card
192
+ ![Profile Card Example](https://github.com/MR-LORD-REX/endfield-cards/blob/main/src/examples/cards/profile_card1.png)
193
+
194
+ ## Data Sources
195
+
196
+ - **Game Data**: [endfield-py](https://github.com/MR-LORD-REX/endfield) - Endfield game data wrapper developed by me
197
+ - **Assets & Player Data**: [enka.network](https://enka.network) - Community-driven asset and player data provider
198
+
199
+ ## Configuration
200
+
201
+ ### Debug Mode
202
+
203
+ Enable debug logging to troubleshoot issues:
204
+
205
+ ```python
206
+ async with EFCard(debug=True) as ef_card:
207
+ # Your code here
208
+ pass
209
+ ```
210
+
211
+ ### Custom Endfield Client
212
+
213
+ Use your own Endfield client instance:
214
+
215
+ ```python
216
+ from endfield import Endfield
217
+
218
+ ef = Endfield()
219
+ async with EFCard(ef=ef) as ef_card:
220
+ # Your code here
221
+ pass
222
+ ```
223
+
224
+
225
+ ## Contributing
226
+
227
+ Contributions are welcome! Please feel free to submit a Pull Request.
228
+
229
+ ## License
230
+
231
+ This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
232
+
233
+ ## Disclaimer
234
+
235
+ This project is not affiliated with or endorsed by the developers of Endfield. All assets and game data are sourced from public APIs and are used for educational purposes only.
236
+
237
+ ## Acknowledgments
238
+
239
+ - **endfield-py** - Library developed by me for accessing Endfield game data
240
+ - **enka.network** - For providing player data and asset caching
241
+
242
+ ## Support
243
+
244
+ If you encounter any issues or have questions:
245
+
246
+ 1. Check the [examples](src/examples/) directory for usage patterns
247
+ 2. Enable debug mode to see detailed logs
248
+ 3. Open an issue on [GitHub](https://github.com/MR-LORD-REX/endfield-cards/issues)
249
+ 4. Contact me on [Telegram](https://t.me/The_Prime_Mover)
250
+
251
+ ## Related Projects
252
+
253
+ - [endfield-py](https://github.com/MR-LORD-REX/endfield) - Core Endfield game data client
254
+
255
+ ---
256
+
257
+ **Note**: Make sure you have a valid Endfield UID to use this library. You can find your UID in-game .
@@ -0,0 +1,221 @@
1
+ # Endfield Cards
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/endfield-cards)](https://pypi.org/project/endfield-cards/)
4
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
5
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.txt)
6
+
7
+ A powerful Python library for generating beautiful character and profile cards for **Endfield**. This library provides an easy-to-use interface to create stunning visual cards with character stats, weapons, relics, and profile information.
8
+
9
+ ## Features
10
+
11
+ **Beautiful Card Templates** - Multiple professional templates for character showcase and profile cards
12
+
13
+ **Complete Character Information** - Display stats, skills, weapons, relics, and more
14
+
15
+ **Profile Cards** - Generate comprehensive profile cards with operator showcase
16
+
17
+ **Async Support** - Full async/await support for efficient operations
18
+
19
+ **Caching** - Smart asset caching for improved performance
20
+
21
+ **Easy Integration** - Simple API for quick integration into your projects
22
+
23
+ ## Installation
24
+
25
+ ### From PyPI (Recommended)
26
+
27
+ ```bash
28
+ pip install endfield-cards
29
+ ```
30
+
31
+ ### From Source
32
+
33
+ ```bash
34
+ git clone https://github.com/MR-LORD-REX/endfield-cards.git
35
+ cd endfield-cards
36
+ pip install -e .
37
+ ```
38
+
39
+ ## Dependencies
40
+
41
+ This library depends on:
42
+
43
+ - **[endfield-py](https://github.com/MR-LORD-REX/endfield)** - Core Endfield game data client
44
+ - **[enka.network](https://enka.network)** - Player data and asset provider
45
+
46
+
47
+ ## Quick Start
48
+
49
+ ### Basic Usage
50
+
51
+ ```python
52
+ import asyncio
53
+ from ef_cards import EFCard
54
+
55
+ async def main():
56
+ uid = 4225399080 # Your Endfield UID
57
+
58
+ # Using async context manager (recommended)
59
+ async with EFCard() as ef_card:
60
+ # Get a single character card
61
+ char_card = await ef_card.get_character_card(uid, char_index=0)
62
+ char_card.save("character_card.png")
63
+
64
+ # Get all characters cards
65
+ all_cards = await ef_card.get_all_characters_card(uid)
66
+
67
+ # Get profile card with showcase
68
+ profile = await ef_card.get_profile_card(uid)
69
+ profile.card.save("profile_card.png")
70
+
71
+ if __name__ == "__main__":
72
+ asyncio.run(main())
73
+ ```
74
+
75
+ ### Without Context Manager
76
+
77
+ ```python
78
+ import asyncio
79
+ from ef_cards import EFCard
80
+
81
+ async def main():
82
+ ef_card = EFCard()
83
+ try:
84
+ char_card = await ef_card.get_character_card(4225399080, char_index=0)
85
+ char_card.save("character_card.png")
86
+ finally:
87
+ await ef_card.close() # Don't forget to close!
88
+
89
+ if __name__ == "__main__":
90
+ asyncio.run(main())
91
+ ```
92
+
93
+ ## Available Methods
94
+
95
+ ### Character Card
96
+
97
+ ```python
98
+ # Get a single character card
99
+ card = await ef_card.get_character_card(
100
+ uid: int,
101
+ char_index: int = 0,
102
+ user_img: Image.Image | None = None,
103
+ template: int = 1
104
+ ) -> Image.Image
105
+ ```
106
+
107
+ ### All Characters Cards
108
+
109
+ ```python
110
+ # Get cards for all characters in a profile
111
+ cards = await ef_card.get_all_characters_card(
112
+ uid: int,
113
+ user_imgs: list[Image.Image] | None = None,
114
+ template: int = 1
115
+ ) -> list[Image.Image]
116
+ ```
117
+
118
+ ### Profile Card
119
+
120
+ ```python
121
+ # Get a complete profile card with showcase
122
+ profile = await ef_card.get_profile_card(
123
+ uid: int,
124
+ template: int = 1
125
+ ) -> ProfileCard_1
126
+ ```
127
+
128
+ ## Card Information
129
+
130
+ ### Character Card Template 1 (1920x800)
131
+
132
+ Displays comprehensive character information including:
133
+
134
+ - **Main Frame** - Character artwork and basic stats
135
+ - **Weapon Panel** - Current weapon with stats
136
+ - **Relic Panel** - Equipped relics and bonuses
137
+ - **Skill Panel** - Character skills and cooldowns
138
+ - **Stats Panel** - Detailed character statistics
139
+
140
+ ### Profile Card Template 1 (1080x1467)
141
+
142
+ Includes:
143
+
144
+ - **Player Profile** - UID, Authority Level, Exploration Level
145
+ - **Awakening Day** - Days since account creation
146
+ - **Operator Showcase** - 4 featured characters
147
+ - **Statistics** - Total operators, weapons, and files collected
148
+ - **Regional Development** - Development levels by region
149
+
150
+ ## Example Output
151
+
152
+ ### Character Card
153
+ ![Character Card Example](https://github.com/MR-LORD-REX/endfield-cards/blob/main/src/examples/cards/char_card1.png)
154
+
155
+ ### Profile Card
156
+ ![Profile Card Example](https://github.com/MR-LORD-REX/endfield-cards/blob/main/src/examples/cards/profile_card1.png)
157
+
158
+ ## Data Sources
159
+
160
+ - **Game Data**: [endfield-py](https://github.com/MR-LORD-REX/endfield) - Endfield game data wrapper developed by me
161
+ - **Assets & Player Data**: [enka.network](https://enka.network) - Community-driven asset and player data provider
162
+
163
+ ## Configuration
164
+
165
+ ### Debug Mode
166
+
167
+ Enable debug logging to troubleshoot issues:
168
+
169
+ ```python
170
+ async with EFCard(debug=True) as ef_card:
171
+ # Your code here
172
+ pass
173
+ ```
174
+
175
+ ### Custom Endfield Client
176
+
177
+ Use your own Endfield client instance:
178
+
179
+ ```python
180
+ from endfield import Endfield
181
+
182
+ ef = Endfield()
183
+ async with EFCard(ef=ef) as ef_card:
184
+ # Your code here
185
+ pass
186
+ ```
187
+
188
+
189
+ ## Contributing
190
+
191
+ Contributions are welcome! Please feel free to submit a Pull Request.
192
+
193
+ ## License
194
+
195
+ This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
196
+
197
+ ## Disclaimer
198
+
199
+ This project is not affiliated with or endorsed by the developers of Endfield. All assets and game data are sourced from public APIs and are used for educational purposes only.
200
+
201
+ ## Acknowledgments
202
+
203
+ - **endfield-py** - Library developed by me for accessing Endfield game data
204
+ - **enka.network** - For providing player data and asset caching
205
+
206
+ ## Support
207
+
208
+ If you encounter any issues or have questions:
209
+
210
+ 1. Check the [examples](src/examples/) directory for usage patterns
211
+ 2. Enable debug mode to see detailed logs
212
+ 3. Open an issue on [GitHub](https://github.com/MR-LORD-REX/endfield-cards/issues)
213
+ 4. Contact me on [Telegram](https://t.me/The_Prime_Mover)
214
+
215
+ ## Related Projects
216
+
217
+ - [endfield-py](https://github.com/MR-LORD-REX/endfield) - Core Endfield game data client
218
+
219
+ ---
220
+
221
+ **Note**: Make sure you have a valid Endfield UID to use this library. You can find your UID in-game .
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires=["setuptools>=61.0"]
3
+ build-backend="setuptools.build_meta"
4
+
5
+ [project]
6
+ name="endfield-cards"
7
+ version="1.0.0"
8
+ description="A library for creating beautiful cards for Endfield."
9
+ authors=[
10
+ { name="sora", email="sahikast07@gmail.com" }
11
+ ]
12
+ readme="README.md"
13
+ license={file="LICENSE.txt"}
14
+ dependencies=[
15
+ "pydantic>=2.5",
16
+ "aiohttp>=3.9",
17
+ "endfield-py>=1.0.7",
18
+ "pillow>=12.2.0",
19
+ "numpy>=2.4.5"
20
+ ]
21
+ [tool.setuptools.packages.find]
22
+ where=["src"]
23
+
24
+ [tool.setuptools.package-data]
25
+ ef_cards = [
26
+ "assets/**/*",
27
+ "assets/char1/**/*",
28
+ "assets/char1/main/**/*",
29
+ "assets/char1/relics/**/*",
30
+ "assets/char1/skills/**/*",
31
+ "assets/char1/stats/**/*",
32
+ "assets/char1/weapon/**/*",
33
+ "assets/common/**/*",
34
+ "assets/elements/**/*",
35
+ "assets/fonts/**/*",
36
+ "assets/phases/**/*",
37
+ "assets/prof/**/*",
38
+ "assets/profile1/**/*",
39
+ "assets/props/**/*",
40
+ "assets/weap_types/**/*"
41
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from .client import EFCard
2
+
3
+ __all__ = ["EFCard"]