Skip to content

eoussama/fut-card-generator

Logo

Fut Card Generator

Generate custom Fut cards.

Index

Description

Fut Card Generator is a command line tool and library to generate custom Fut cards.

Installation

From source

Clone the repository and update the submodules:

git clone https://github.com/eoussama/fut-card-generator.git
cd fut-card-generator
git submodule update --init --recursive

Build the project:

mkdir build
cd build
cmake ..
cmake --build .

There is also a custom script for doing that, build.sh.

From binary

Download the latest release from the releases page.

From Docker

Development

There is a developement Docker image available, you can use it by executing the dev.sh script.

Build

You can also build and run the binary and forward all the arguments to it by executing the run.sh script.

API

A web API image is also available, you can use it by executing the api.sh script. The container exposes port 5000 and mounts the current directory to /fut-card-generator. The endpoint is available at http://localhost:5000/generate.

Or you can pull a pre build image from Docker Hub.

Usage

fut-card-generator --help

Options

The following are the options available

Option Abbreviation Default Description
--help -h N/A Show help message
--version -v N/A Show version
--name -n N/A Player name
--out -o out.png Output file path
--show -s false Flag whether to preview the card after generation
--logo -l ./assets/logo.png Path to the logo of the player
--image -i ./assets/image.png Path to the image of the player
--translation -t en Transaltion of the text on the card
--edition -e fifa19 Code for the edition of the fut card to generate
--kind -k common_bronze Code for the template of the card to generate
--country -c ma Country code of the player
--position -p all Position of the player on the card
--pace -pac 50 Pace of the player on the card
--passing -pas 50 Passing of the player on the card
--physical -phy 50 Physical of the player on the card
--shooting -sho 50 Skill of the player on the card
--dribbling -dri 50 Dribbling of the player on the card
--defending -def 50 Defense of the player on the card

Translations

Code Language
en English
fr French
es Spanish
pt Portuguese
it Italian
de German

Editions

Code Edition
fifa19 FIFA 19

Positions

Code Position
gk Goalkeeper
lb Left Back
lwb Left Wing Back
cb Centre Back
rb Right Back
rwb Right Wing Back
lm Left Midfield
cdm Centre Midfield
cm Centre Midfield
cam Centre Midfield
rm Right Midfield
lw Left Wing
rw Right Wing
lf Left Full Back
cf Centre Full Back
rf Right Full Back
st Striker
all All

Kinds

Code Kind Preview
common_bronze Common Bronze
common_silver Common Silver
common_gold Common Gold
rare_bronze Rare Bronze
rare_silver Rare Silver
rare_gold Rare Gold
if_bronze IF Bronze
if_silver IF Silver
if_gold IF Gold
fc_bronze FC Bronze
fc_silver FC Silver
fc_gold FC Gold
motm MOTM
pl_potm PL POTM
bl_potm BL POTM
futties Futties
futtiesw FuttiesW
toty Toty
toty_n Toty N
el EL
el_motm EL MOTM
el_live EL Live
el_sbc EL SBC
el_tott EL Tott
common_ucl Common UCL
rare_ucl Rare UCL
ucl_motm UCL MOTM
ucl_live UCL Live
ucl_sbc UCL SBC
ucl_tott UCL Tott
fsr FSR
fs FS
fsn FSN
pp PP
cb CB
rb RB
hero Hero
aw AW
fb FB
headliners Headliners
cc CC
sbc SBC
sbcp SBCP
legend Legend
fs1 FS1
fs2 FS2
fs3 FS3
fs4 FS4
fs5 FS5
fs6 FS6
fs7 FS7
fs8 FS8
fs9 FS9
fs10 FS10
fs11 FS11
otw OTW
st_patricks ST PATRICKS

Country Codes

Check out countries.json for a list of all the country codes.

Note: All parameters should be lowercase, that goes especially for the country codes.

API

The API can be started by running the Flask script at api/app.py. There is also a docker image available (Dockerfile.api), you can use it by executing the api.sh script.

The API is available at http://localhost:5000.

Routes

[GET] /

Returns the API version.

[POST] /generate

Generates a card.

This route accepts the following parameters:

Parameter Description Type Default
args Arguments to pass to the executable String N/A
clubLogo Club logo image File N/A
playerImage Player image File N/A

Example:

curl -X POST \
  http://localhost:5000/generate \
  -F 'args=-n "Player" -e fifa19 -k ma -p all -pace 50 -pas 50 -phy 50 -sho 50 -dri 50 -def 50' \
  -F 'clubLogo=@./assets/clubs/1.png' \
  -F 'playerImage=@./assets/defaults/person.png'

License

This project is licensed under the GNU GENERAL PUBLIC 3.0 License - see the LICENSE file for details.

About

Generate custom Fut cards.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Contributors