A library for creating beautiful cards for Endfield.
Project description
Endfield Cards
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.
Features
Beautiful Card Templates - Multiple professional templates for character showcase and profile cards
Complete Character Information - Display stats, skills, weapons, relics, and more
Profile Cards - Generate comprehensive profile cards with operator showcase
Async Support - Full async/await support for efficient operations
Caching - Smart asset caching for improved performance
Easy Integration - Simple API for quick integration into your projects
Installation
From PyPI (Recommended)
pip install endfield-cards
From Source
git clone https://github.com/MR-LORD-REX/endfield-cards.git
cd endfield-cards
pip install -e .
Dependencies
This library depends on:
- endfield-py - Core Endfield game data client
- enka.network - Player data and asset provider
Quick Start
Basic Usage
import asyncio
from ef_cards import EFCard
async def main():
uid = 4225399080 # Your Endfield UID
token = "your_token_here" # Required for live stats and factory cards
# Using async context manager (recommended)
async with EFCard() as ef_card:
# update assets on the first run or when new assets are available
await ef_card.ef.update_assets()
await ef_card.update_builds()
# Get a single character card
char_card = await ef_card.get_character_card(uid, char_index=0)
char_card.save("character_card.png")
# Get all characters cards
all_cards = await ef_card.get_all_characters_card(uid)
# Get profile card with showcase
profile = await ef_card.get_profile_card(uid)
profile.card.save("profile_card.png")
# Get live stats card (requires token)
stats = await ef_card.get_live_stats_card(uid, token)
if stats:
stats.img.save("live_stats.png")
# Get factory stats card (requires token)
factory = await ef_card.get_factory_stats_card(uid, token)
if factory:
factory.save("factory_stats.png")
char_card=await ef_card.get_character_build('endministrator')
char_card[0].show()
all=await ef_card.available_builds()
print(all)
if __name__ == "__main__":
asyncio.run(main())
Without Context Manager
import asyncio
from ef_cards import EFCard
async def main():
ef_card = EFCard()
try:
char_card = await ef_card.get_character_card(4225399080, char_index=0)
char_card.save("character_card.png")
finally:
await ef_card.close() # Don't forget to close!
if __name__ == "__main__":
asyncio.run(main())
Available Methods
Character Card
# Get a single character card
card = await ef_card.get_character_card(
uid: int,
char_index: int = 0,
user_img: Image.Image | None = None,
template: int = 1
) -> Image.Image
All Characters Cards
# Get cards for all characters in a profile
cards = await ef_card.get_all_characters_card(
uid: int,
user_imgs: list[Image.Image] | None = None,
template: int = 1
) -> list[Image.Image]
Profile Card
# Get a complete profile card with showcase
profile = await ef_card.get_profile_card(
uid: int,
template: int = 1
) -> ProfileCard_1
Live Stats Card
# Get live stats card (requires valid token)
stats = await ef_card.get_live_stats_card(
uid: int,
token: str,
server: int = 3
) -> LiveStats | None
Factory Stats Card
# Get factory stats card with settlement details (requires valid token)
factory = await ef_card.get_factory_stats_card(
uid: int,
token: str,
server: int = 3
) -> Image.Image | None
Card Information
Character Card Template 1 (1920x800)
Displays comprehensive character information including:
- Main Frame - Character artwork and basic stats
- Weapon Panel - Current weapon with stats
- Relic Panel - Equipped relics and bonuses
- Skill Panel - Character skills and cooldowns
- Stats Panel - Detailed character statistics
Profile Card Template 1 (1080x1467)
Includes:
- Player Profile - UID, Authority Level, Exploration Level
- Awakening Day - Days since account creation
- Operator Showcase - 4 featured characters
- Statistics - Total operators, weapons, and files collected
- Regional Development - Development levels by region
Live Stats Card (1024x355)
Real-time player statistics card (requires valid authentication token):
- Sanity Points - Current and maximum sanity
- Recovery Timer - Time until full sanity recovery
- Daily Points - Daily mission completion progress
- Weekly Points - Weekly mission score
- Battle Pass - Current battle pass level
Factory Stats Card (1156x1755)
Comprehensive factory and settlement information card (requires valid authentication token):
- Factory Overview - Main factory level and money status
- Settlement Details - Per-settlement information including:
- Settlement name and level
- Assigned officer/character
- Money storage status
- Regional Breakdown - Statistics for each region
- Resource Management - Visual progress bars for resources
Example Output
Character Card
Profile Card
Live stats card
Factory card
Character Guild Card
Data Sources
- Game Data: endfield-py - Endfield game data wrapper developed by me
- Assets & Player Data: enka.network - Community-driven asset and player data provider
- Guides data: prydwen.gg - For character build information and guides
Configuration
Debug Mode
Enable debug logging to troubleshoot issues:
async with EFCard(debug=True) as ef_card:
# Your code here
pass
Custom Endfield Client
Use your own Endfield client instance:
from endfield import Endfield
ef = Endfield()
async with EFCard(ef=ef) as ef_card:
# Your code here
pass
How to get Token
- Check the endfield-py documentation for instructions on obtaining a valid token for accessing player data.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE.txt file for details.
Disclaimer
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.
Acknowledgments
- endfield-py - Library developed by me for accessing Endfield game data
- endfield-builds - Sister project for character build cards
- enka.network - For providing player data and asset caching
Support
If you encounter any issues or have questions:
- Check the examples directory for usage patterns
- Enable debug mode to see detailed logs
- Open an issue on GitHub
- Contact me on Telegram
Related Projects
- endfield-py - Core Endfield game data client
- endfield-builds - Library for generating character build cards
Note: Make sure you have a valid Endfield UID to use this library. You can find your UID in-game .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file endfield_cards-1.0.8.tar.gz.
File metadata
- Download URL: endfield_cards-1.0.8.tar.gz
- Upload date:
- Size: 6.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bc26fd9b0da248af245b0b58dffd63f9ae365a55e5d539b47097e9d061103ab
|
|
| MD5 |
7642bc08393d550c06a3163aaf6472a1
|
|
| BLAKE2b-256 |
30282447b16caaa102018c5decd6e6567c994059faaaa272cb91865799bae46d
|
File details
Details for the file endfield_cards-1.0.8-py3-none-any.whl.
File metadata
- Download URL: endfield_cards-1.0.8-py3-none-any.whl
- Upload date:
- Size: 6.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7308531ac01e85d64840b40a61dc6d4dd7e25427f103069b870883af10c44b0b
|
|
| MD5 |
62360af324de38d25ec5cef4dc24ea81
|
|
| BLAKE2b-256 |
88767d06c16794e00dc937aa1c52923c698655bb8ecc20d193af9bf2ce3bc472
|