# Xebus ID Card Generator
`Xebus ID Card Generator` is a Command-Line Interface (CLI) written in Python used to generate JPEG images of Xebus ID cards.
This script generates images which size has the same portrait ratio as [ISO/IEC 7810 Identification cards ID-1](https://en.wikipedia.org/wiki/ISO/IEC_7810#ID-1) (3 3⁄8 in × 2 1⁄8 in, 54mm x 85.6mm).
## Installation
`Xebus ID Card Generator` can be easily installed with [`pipenv`]cod(https://github.com/pypa/pipenv):
```shell
$ pipenv --python 3.8 shell
$ pipenv install xebus-id-card-image-generator
```
_Note: As of October 2020, the Python Image Library (PIL) is not yet compatible with Python 3.9._
## Execution
```shell
$ ./bin/xidgen --help
usage: xidgen [-h] [-c TYPE] -f FILE [-d CHAR] [-q CHAR] [-e CHAR]
[-s GEOMETRY] [-p SIZE] --header-file FILE [--font-name NAME]
Xebus ID Card Images Generator
optional arguments:
-h, --help show this help message and exit
-c TYPE, --card-type TYPE
specify the type of ID cards to generate (driver,
guardian, securityguard, student)
-f FILE, --csv-file FILE
specify the absolute path and name of the CSV file
containing the information of ID cards to generate
-d CHAR, --delimiter CHAR
specify the character used to separate each field
(default to character [,])
-q CHAR, --quotechar CHAR
specify the character used to surround fields that
contain the delimiter character (default to character
["]).
-e CHAR, --escapechar CHAR
specify the character used to escape the delimiter
character, in case quotes aren't used (default to
character [None]).
-s GEOMETRY, --size GEOMETRY
specify the width and/or height in pixels of the image
to build, with the ratio of a CR80 standard credit
card size ID-1 in portrait mode (54mm x 85.6mm)
-p SIZE, --padding SIZE
specify the space in pixels or percentage to generate
around the ID card
--header-file FILE specify the absolute path name of the header image
file
--font-name NAME specify the name of the font to display the full name
of each ID card
--name-format FORMAT specify the format of ID card file name
--debug LEVEL specify the logging level (value between 0 and 4, from
critical to debug)
```
For example:
```bash
$ xidgen --card-type student --header-file lfiduras_logo.jpg --csv-file lfiduras-students.csv
```
The user can specify the file name of the ID card images by passing the argument `name-format`. A ID card file name format MUST be composed of field names to build this file name with. These field names MUST be defined in braces, each field names separated with a character underscore. For example:
```text
{id}_{first name}_{grade level}
```
_Note: The accepted field names correspond to the CSV field names._
### CSV File
The CSV file passed to the script MUST contain a first row corresponding to the header fields in whatever order:
- `#` (optional): The identification of the registration file of the card owner (as provided by the organization that manages this list)
- `ID` (required): The identification of the card owner
- `Card Type` (optional): Specify the type of the ID card (`driver`, `guardian`, `securityguard`, or `student`)
- `Class Name` (optional)
- `First Name` (optional)
- `Full Name` (required)
- `Grade Level` (optional): The number of the year a pupil has reached in this given educational
- `Grade Name` (optional): THe name given to this grade
- `Last Name` (optional)
For example:
| # | ID | First Name | Last Name | Full Name | Grade Level | Grade Name |
|---------------|--------------------------------------|------------| --------- | --------------------------- | ----------- | ---------- |
| `862-295-729` | 3a72a73e-c57b-11ea-8e0d-0008a20c190f | Céline | CAUNE | Céline Kim Anh CAUNE LÝ | 16 | Terminale |
| `873-774-763` | d8be1eef-2493-11eb-9dcf-0007cb040bcc | Aline | CAUNE | Aline Minh Anh CAUNE LÝ | 15 | Première |
| `457-128-612` | f6315b69-11af-11eb-bb6b-0007cb040bcc | Éline | CAUNE | Éline Xuân Anh CAUNE NGUYỄN | 2 | PS |
## Available Fonts
| | | |
| ---------------------------------------- | ------------------------------------ | --------------------------------- |
| `Amorino_beta` | `Calibri Light` | `Opificio_light_rounded` |
| `Barlow-Black` | `Calibri Regular` | `Opificio_regular` |
| `Barlow-BlackItalic` | `CaviarDreams` | `Opificio_rounded` |
| `Barlow-Bold` | `CaviarDreams_Bold` | `PirataOne-Regular` |
| `Barlow-BoldItalic` | `CaviarDreams_BoldItalic` | `PlayfairDisplay-Black` |
| `Barlow-ExtraBold` | `CaviarDreams_Italic` | `PlayfairDisplay-BlackItalic` |
| `Barlow-ExtraBoldItalic` | `Champagne & Limousines Bold Italic` | `PlayfairDisplay-Bold` |
| `Barlow-ExtraLight` | `Champagne & Limousines Bold` | `PlayfairDisplay-BoldItalic` |
| `Barlow-ExtraLightItalic` | `Champagne & Limousines Italic` | `PlayfairDisplay-ExtraBold` |
| `Barlow-Italic` | `Champagne & Limousines` | `PlayfairDisplay-ExtraBoldItalic` |
| `Barlow-Light` | `Forgotbi` | `PlayfairDisplay-Italic` |
| `Barlow-LightItalic` | `Forgottb` | `PlayfairDisplay-Medium` |
| `Barlow-Medium` | `Forgotte` | `PlayfairDisplay-MediumItalic` |
| `Barlow-MediumItalic` | `Forgotti` | `PlayfairDisplay-Regular` |
| `Barlow-Regular` | `Forgotts` | `PlayfairDisplay-SemiBold` |
| `Barlow-SemiBold` | `Giorgino` | `PlayfairDisplay-SemiBoldItalic` |
| `Barlow-SemiBoldItalic` | `Jura-Bold` | `Quicksand-Bold` |
| `Barlow-Thin` | `Jura-Light` | `Quicksand-Light` |
| `Barlow-ThinItalic` | `Jura-Medium` | `Quicksand-Medium` |
| `BebasNeue-Bold` | `Jura-Regular` | `Quicksand-Regular` |
| `BebasNeue-Book` | `Jura-SemiBold` | `Quicksand-SemiBold` |
| `BebasNeue-Light` | `LibreBaskerville-Bold` | `Rothwell` |
| `BebasNeue-Regular` | `LibreBaskerville-Italic` | `Skarpa regular` |
| `BebasNeue-Thin` | `LibreBaskerville-Regular` | `SkarpaLt` |
| `Bedizen` | `Merriweather-Black` | `Steinerlight` |
| `Blacker-Display-Bold-italic-trial` | `Merriweather-BlackItalic` | `Teko-Bold` |
| `Blacker-Display-Bold-trial` | `Merriweather-Bold` | `Teko-Light` |
| `Blacker-Display-ExtraBold-Italic-trial` | `Merriweather-BoldItalic` | `Teko-Medium` |
| `Blacker-Display-ExtraBold-trial` | `Merriweather-Italic` | `Teko-Regular` |
| `Blacker-Display-Heavy-Italic-trial` | `Merriweather-Light` | `Teko-SemiBold` |
| `Blacker-Display-Heavy-trial` | `Merriweather-LightItalic` | `Verdana` |
| `Blacker-Display-Light-Italic-trial` | `Merriweather-Regular` | `quarthck` |
| `Blacker-Display-Light-trial` | `Montserrat-Black` | `quarthin` |
| `Blacker-Display-Medium-Italic-trial` | `Montserrat-BlackItalic` | `rokikier` |
| `Blacker-Display-Medium-trial` | `Montserrat-Bold` | `rokikierc` |
| `Blacker-Display-Regular-Italic-trial` | `Montserrat-BoldItalic` | `rokikierci` |
| `Blacker-Display-Regular-trial` | `Montserrat-ExtraBold` | `rokikiere` |
| `Blacker-Text-Bold-Italic-trial` | `Montserrat-ExtraBoldItalic` | `rokikierei` |
| `Blacker-Text-Bold-trial` | `Montserrat-ExtraLight` | `rokikieri` |
| `Blacker-Text-Book-Italic-trial` | `Montserrat-ExtraLightItalic` | `rokikierl` |
| `Blacker-Text-Book-trial` | `Montserrat-Italic` | `rokikierla` |
| `Blacker-Text-Heavy-Italic-trial` | `Montserrat-Light` | `rokikierlai` |
| `Blacker-Text-Heavy-trial` | `Montserrat-LightItalic` | `rokikierp` |
| `Blacker-Text-Light-Italic-trial` | `Montserrat-Medium` | `rokikierpi` |
| `Blacker-Text-Light-trial` | `Montserrat-MediumItalic` | `rokikiers` |
| `Blacker-Text-Medium-Italic-trial` | `Montserrat-Regular` | `rokikierse` |
| `Blacker-Text-Medium-trial` | `Montserrat-SemiBold` | `rokikiersi` |
| `Blacker-Text-Regular-Italic-trial` | `Montserrat-SemiBoldItalic` | `saunder` |
| `Blacker-Text-Regular-trial` | `Montserrat-Thin` | `vibroceb` |
| `Calibri Bold Italic` | `Montserrat-ThinItalic` | `vibrocei` |
| `Calibri Bold` | `Opificio_Bold` | `vibrocen` |
| `Calibri Italic` | `Opificio_Bold_rounded` | `vibrocex` |
| `Calibri Light Italic` | `Opificio_light` | |
## Development and Publication
`Xebus ID Card Generator` uses [Poetry](https://python-poetry.org/), a packaging and dependency management for Python. To install the required packages, execute the following command:
```shell
poetry install
```
To activate the virtual environment, run the following command:
```shell
poetry shell
```
To publish a new version of the library `Xebus ID Card Generator` to the [Python Package Index (PyPI)](https://pypi.org/), execute the following command:
```shell
poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD
```
_Note: If you are storing the PyPi credentials in a `.env` file, you can get this file automatically loaded when activating your virtual environment. You need to install the Poetry plugin [`poetry-dotenv-plugin`](https://github.com/mpeteuil/poetry-dotenv-plugin):_
```shell
poetry self add poetry-dotenv-plugin
```
Raw data
{
"_id": null,
"home_page": "https://github.com/xebus/xebus-id-card-image-generator",
"name": "xebus-id-card-image-generator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "card,generator,identity,xebus",
"author": "Daniel CAUNE",
"author_email": "daniel.caune@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/21/7c/ff3d58475cf4fee8640d24496f7dc94acfd092e5a4ff16dc95367cbb355a/xebus_id_card_image_generator-1.4.1.tar.gz",
"platform": null,
"description": "# Xebus ID Card Generator\n\n`Xebus ID Card Generator` is a Command-Line Interface (CLI) written in Python used to generate JPEG images of Xebus ID cards.\n\nThis script generates images which size has the same portrait ratio as [ISO/IEC 7810 Identification cards ID-1](https://en.wikipedia.org/wiki/ISO/IEC_7810#ID-1) (3 3\u20448 in \u00d7 2 1\u20448 in, 54mm x 85.6mm).\n\n## Installation\n\n`Xebus ID Card Generator` can be easily installed with [`pipenv`]cod(https://github.com/pypa/pipenv):\n\n```shell\n$ pipenv --python 3.8 shell\n$ pipenv install xebus-id-card-image-generator\n```\n\n_Note: As of October 2020, the Python Image Library (PIL) is not yet compatible with Python 3.9._\n\n## Execution\n\n```shell\n$ ./bin/xidgen --help\nusage: xidgen [-h] [-c TYPE] -f FILE [-d CHAR] [-q CHAR] [-e CHAR]\n [-s GEOMETRY] [-p SIZE] --header-file FILE [--font-name NAME]\n\nXebus ID Card Images Generator\n\noptional arguments:\n -h, --help show this help message and exit\n -c TYPE, --card-type TYPE\n specify the type of ID cards to generate (driver,\n guardian, securityguard, student)\n -f FILE, --csv-file FILE\n specify the absolute path and name of the CSV file\n containing the information of ID cards to generate\n -d CHAR, --delimiter CHAR\n specify the character used to separate each field\n (default to character [,])\n -q CHAR, --quotechar CHAR\n specify the character used to surround fields that\n contain the delimiter character (default to character\n [\"]).\n -e CHAR, --escapechar CHAR\n specify the character used to escape the delimiter\n character, in case quotes aren't used (default to\n character [None]).\n -s GEOMETRY, --size GEOMETRY\n specify the width and/or height in pixels of the image\n to build, with the ratio of a CR80 standard credit\n card size ID-1 in portrait mode (54mm x 85.6mm)\n -p SIZE, --padding SIZE\n specify the space in pixels or percentage to generate\n around the ID card\n --header-file FILE specify the absolute path name of the header image\n file\n --font-name NAME specify the name of the font to display the full name\n of each ID card\n --name-format FORMAT specify the format of ID card file name\n --debug LEVEL specify the logging level (value between 0 and 4, from\n critical to debug)\n```\n\nFor example:\n\n```bash\n$ xidgen --card-type student --header-file lfiduras_logo.jpg --csv-file lfiduras-students.csv\n```\n\nThe user can specify the file name of the ID card images by passing the argument `name-format`. A ID card file name format MUST be composed of field names to build this file name with. These field names MUST be defined in braces, each field names separated with a character underscore. For example:\n\n```text\n{id}_{first name}_{grade level}\n```\n\n_Note: The accepted field names correspond to the CSV field names._\n\n### CSV File\n\nThe CSV file passed to the script MUST contain a first row corresponding to the header fields in whatever order:\n\n- `#` (optional): The identification of the registration file of the card owner (as provided by the organization that manages this list)\n- `ID` (required): The identification of the card owner\n- `Card Type` (optional): Specify the type of the ID card (`driver`, `guardian`, `securityguard`, or `student`)\n- `Class Name` (optional)\n- `First Name` (optional)\n- `Full Name` (required)\n- `Grade Level` (optional): The number of the year a pupil has reached in this given educational\n- `Grade Name` (optional): THe name given to this grade\n- `Last Name` (optional)\n\nFor example:\n\n| # | ID | First Name | Last Name | Full Name | Grade Level | Grade Name |\n|---------------|--------------------------------------|------------| --------- | --------------------------- | ----------- | ---------- |\n| `862-295-729` | 3a72a73e-c57b-11ea-8e0d-0008a20c190f | C\u00e9line | CAUNE | C\u00e9line Kim Anh CAUNE L\u00dd | 16 | Terminale |\n| `873-774-763` | d8be1eef-2493-11eb-9dcf-0007cb040bcc | Aline | CAUNE | Aline Minh Anh CAUNE L\u00dd | 15 | Premi\u00e8re |\n| `457-128-612` | f6315b69-11af-11eb-bb6b-0007cb040bcc | \u00c9line | CAUNE | \u00c9line Xu\u00e2n Anh CAUNE NGUY\u1ec4N | 2 | PS |\n\n## Available Fonts\n\n| | | |\n| ---------------------------------------- | ------------------------------------ | --------------------------------- |\n| `Amorino_beta` | `Calibri Light` | `Opificio_light_rounded` |\n| `Barlow-Black` | `Calibri Regular` | `Opificio_regular` |\n| `Barlow-BlackItalic` | `CaviarDreams` | `Opificio_rounded` |\n| `Barlow-Bold` | `CaviarDreams_Bold` | `PirataOne-Regular` |\n| `Barlow-BoldItalic` | `CaviarDreams_BoldItalic` | `PlayfairDisplay-Black` |\n| `Barlow-ExtraBold` | `CaviarDreams_Italic` | `PlayfairDisplay-BlackItalic` |\n| `Barlow-ExtraBoldItalic` | `Champagne & Limousines Bold Italic` | `PlayfairDisplay-Bold` |\n| `Barlow-ExtraLight` | `Champagne & Limousines Bold` | `PlayfairDisplay-BoldItalic` |\n| `Barlow-ExtraLightItalic` | `Champagne & Limousines Italic` | `PlayfairDisplay-ExtraBold` |\n| `Barlow-Italic` | `Champagne & Limousines` | `PlayfairDisplay-ExtraBoldItalic` |\n| `Barlow-Light` | `Forgotbi` | `PlayfairDisplay-Italic` |\n| `Barlow-LightItalic` | `Forgottb` | `PlayfairDisplay-Medium` |\n| `Barlow-Medium` | `Forgotte` | `PlayfairDisplay-MediumItalic` |\n| `Barlow-MediumItalic` | `Forgotti` | `PlayfairDisplay-Regular` |\n| `Barlow-Regular` | `Forgotts` | `PlayfairDisplay-SemiBold` |\n| `Barlow-SemiBold` | `Giorgino` | `PlayfairDisplay-SemiBoldItalic` |\n| `Barlow-SemiBoldItalic` | `Jura-Bold` | `Quicksand-Bold` |\n| `Barlow-Thin` | `Jura-Light` | `Quicksand-Light` |\n| `Barlow-ThinItalic` | `Jura-Medium` | `Quicksand-Medium` |\n| `BebasNeue-Bold` | `Jura-Regular` | `Quicksand-Regular` |\n| `BebasNeue-Book` | `Jura-SemiBold` | `Quicksand-SemiBold` |\n| `BebasNeue-Light` | `LibreBaskerville-Bold` | `Rothwell` |\n| `BebasNeue-Regular` | `LibreBaskerville-Italic` | `Skarpa regular` |\n| `BebasNeue-Thin` | `LibreBaskerville-Regular` | `SkarpaLt` |\n| `Bedizen` | `Merriweather-Black` | `Steinerlight` |\n| `Blacker-Display-Bold-italic-trial` | `Merriweather-BlackItalic` | `Teko-Bold` |\n| `Blacker-Display-Bold-trial` | `Merriweather-Bold` | `Teko-Light` |\n| `Blacker-Display-ExtraBold-Italic-trial` | `Merriweather-BoldItalic` | `Teko-Medium` |\n| `Blacker-Display-ExtraBold-trial` | `Merriweather-Italic` | `Teko-Regular` |\n| `Blacker-Display-Heavy-Italic-trial` | `Merriweather-Light` | `Teko-SemiBold` |\n| `Blacker-Display-Heavy-trial` | `Merriweather-LightItalic` | `Verdana` |\n| `Blacker-Display-Light-Italic-trial` | `Merriweather-Regular` | `quarthck` |\n| `Blacker-Display-Light-trial` | `Montserrat-Black` | `quarthin` |\n| `Blacker-Display-Medium-Italic-trial` | `Montserrat-BlackItalic` | `rokikier` |\n| `Blacker-Display-Medium-trial` | `Montserrat-Bold` | `rokikierc` |\n| `Blacker-Display-Regular-Italic-trial` | `Montserrat-BoldItalic` | `rokikierci` |\n| `Blacker-Display-Regular-trial` | `Montserrat-ExtraBold` | `rokikiere` |\n| `Blacker-Text-Bold-Italic-trial` | `Montserrat-ExtraBoldItalic` | `rokikierei` |\n| `Blacker-Text-Bold-trial` | `Montserrat-ExtraLight` | `rokikieri` |\n| `Blacker-Text-Book-Italic-trial` | `Montserrat-ExtraLightItalic` | `rokikierl` |\n| `Blacker-Text-Book-trial` | `Montserrat-Italic` | `rokikierla` |\n| `Blacker-Text-Heavy-Italic-trial` | `Montserrat-Light` | `rokikierlai` |\n| `Blacker-Text-Heavy-trial` | `Montserrat-LightItalic` | `rokikierp` |\n| `Blacker-Text-Light-Italic-trial` | `Montserrat-Medium` | `rokikierpi` |\n| `Blacker-Text-Light-trial` | `Montserrat-MediumItalic` | `rokikiers` |\n| `Blacker-Text-Medium-Italic-trial` | `Montserrat-Regular` | `rokikierse` |\n| `Blacker-Text-Medium-trial` | `Montserrat-SemiBold` | `rokikiersi` |\n| `Blacker-Text-Regular-Italic-trial` | `Montserrat-SemiBoldItalic` | `saunder` |\n| `Blacker-Text-Regular-trial` | `Montserrat-Thin` | `vibroceb` |\n| `Calibri Bold Italic` | `Montserrat-ThinItalic` | `vibrocei` |\n| `Calibri Bold` | `Opificio_Bold` | `vibrocen` |\n| `Calibri Italic` | `Opificio_Bold_rounded` | `vibrocex` |\n| `Calibri Light Italic` | `Opificio_light` | |\n\n\n## Development and Publication\n\n`Xebus ID Card Generator` uses [Poetry](https://python-poetry.org/), a packaging and dependency management for Python. To install the required packages, execute the following command: \n\n```shell\npoetry install\n```\n\nTo activate the virtual environment, run the following command:\n\n```shell\npoetry shell\n```\n\nTo publish a new version of the library `Xebus ID Card Generator` to the [Python Package Index (PyPI)](https://pypi.org/), execute the following command:\n\n```shell\npoetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD\n```\n\n_Note: If you are storing the PyPi credentials in a `.env` file, you can get this file automatically loaded when activating your virtual environment. You need to install the Poetry plugin [`poetry-dotenv-plugin`](https://github.com/mpeteuil/poetry-dotenv-plugin):_ \n\n```shell\npoetry self add poetry-dotenv-plugin\n```",
"bugtrack_url": null,
"license": "SEE LICENSE IN <LICENSE.md>",
"summary": "Command-Line Interface (CLI) to generate JPEG images of Xebus ID cards",
"version": "1.4.1",
"project_urls": {
"Homepage": "https://github.com/xebus/xebus-id-card-image-generator",
"Repository": "https://github.com/xebus/xebus-id-card-image-generator"
},
"split_keywords": [
"card",
"generator",
"identity",
"xebus"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "20828d3dba77da17839db97b1d537ad50fde51905e9102555525b5db588f5fb8",
"md5": "7ddcbfb8060acda3dc81faa78fff0f9c",
"sha256": "7998ec1e2ab1f41e24f3f2575768b2399cad6865bde312bf34dd5c672ba46584"
},
"downloads": -1,
"filename": "xebus_id_card_image_generator-1.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ddcbfb8060acda3dc81faa78fff0f9c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 11925722,
"upload_time": "2024-03-14T02:39:48",
"upload_time_iso_8601": "2024-03-14T02:39:48.472348Z",
"url": "https://files.pythonhosted.org/packages/20/82/8d3dba77da17839db97b1d537ad50fde51905e9102555525b5db588f5fb8/xebus_id_card_image_generator-1.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "217cff3d58475cf4fee8640d24496f7dc94acfd092e5a4ff16dc95367cbb355a",
"md5": "73b08af4b946dfe6fc4ab5d5ed294f02",
"sha256": "885ce753457d37a6a0b600d45d0d129d45d03791f8fc14e3a2364693e7e54ca8"
},
"downloads": -1,
"filename": "xebus_id_card_image_generator-1.4.1.tar.gz",
"has_sig": false,
"md5_digest": "73b08af4b946dfe6fc4ab5d5ed294f02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 11917649,
"upload_time": "2024-03-14T02:39:53",
"upload_time_iso_8601": "2024-03-14T02:39:53.182995Z",
"url": "https://files.pythonhosted.org/packages/21/7c/ff3d58475cf4fee8640d24496f7dc94acfd092e5a4ff16dc95367cbb355a/xebus_id_card_image_generator-1.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-14 02:39:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xebus",
"github_project": "xebus-id-card-image-generator",
"github_not_found": true,
"lcname": "xebus-id-card-image-generator"
}