Generate custom Fut cards.
Fut Card Generator is a command line tool and library to generate custom Fut cards.
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 --recursiveBuild the project:
mkdir build
cd build
cmake ..
cmake --build .There is also a custom script for doing that, build.sh.
Download the latest release from the releases page.
There is a developement Docker image available, you can use it by executing the dev.sh script.
You can also build and run the binary and forward all the arguments to it by executing the run.sh script.
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.
fut-card-generator --helpThe 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 |
| Code | Language |
|---|---|
| en | English |
| fr | French |
| es | Spanish |
| pt | Portuguese |
| it | Italian |
| de | German |
| Code | Edition |
|---|---|
| fifa19 | FIFA 19 |
| 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 |
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.
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.
Returns the API version.
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'This project is licensed under the GNU GENERAL PUBLIC 3.0 License - see the LICENSE file for details.





















































