Skip to main content

A library for creating beautiful cards for Endfield.

Project description

Endfield Cards

PyPI version Python 3.10+ License

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:

Quick Start

Basic Usage

import asyncio
from ef_cards import EFCard

async def main():
    uid = 4225399080  # Your Endfield UID
    
    # Using async context manager (recommended)
    async with EFCard() as ef_card:
        # 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")

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

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

Example Output

Character Card

Character Card Example

Profile Card

Profile Card Example

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

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - 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
  • enka.network - For providing player data and asset caching

Support

If you encounter any issues or have questions:

  1. Check the examples directory for usage patterns
  2. Enable debug mode to see detailed logs
  3. Open an issue on GitHub
  4. Contact me on Telegram

Related Projects


Note: Make sure you have a valid Endfield UID to use this library. You can find your UID in-game .

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

endfield_cards-1.0.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

endfield_cards-1.0.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file endfield_cards-1.0.0.tar.gz.

File metadata

  • Download URL: endfield_cards-1.0.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for endfield_cards-1.0.0.tar.gz
Algorithm Hash digest
SHA256 89894aeacfce57c25d947755e715ebc003c9266e5e334caf919efc5a16268417
MD5 ba0eaf3b3121826f53f9ee2653ce6c1e
BLAKE2b-256 0836061888fd30724fa8bae19985256964962902fbadba6284b2c5f82a6c496c

See more details on using hashes here.

File details

Details for the file endfield_cards-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: endfield_cards-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for endfield_cards-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bab540e11428cdb51bd5d81a7d58685c0fd14b061f1775580bf82bbd27f9f5c5
MD5 6da85a046cf62b1fe2946327e7010d78
BLAKE2b-256 05320284509b989fb350901b3f37f9496e997a7074862fcaf711883cf4bc649b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page