Name | create-intro-cards JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | A Python module to generate a PDF of intro cards from a dataset of individuals' attributes. |
upload_time | 2025-03-01 00:38:36 |
maintainer | None |
docs_url | None |
author | Bobby Math |
requires_python | >=3.11 |
license | BSD 3-Clause License
Copyright (c) 2025, Robert Math
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
keywords |
introductions
intro
cards
matplotlib
pdf
visualization
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 
<div align="center">
[](https://github.com/robertfmath/Create-Intro-Cards/actions/workflows/ci.yml)
[](https://pypi.org/project/create-intro-cards/)
[](https://github.com/robertfmath/Create-Intro-Cards/blob/main/LICENSE.txt)
[](https://robertfmath.github.io/Create-Intro-Cards)
</div>
`create-intro-cards` is a Python module that transforms a data set of individuals' names, photos, and custom attributes into a paginated PDF consisting of "intro cards" that describe each individual. Each intro card displays a person's name, their photo, and a series of attributes based on custom columns in the data set.
<p align="center">
<img src="https://github.com/robertfmath/Create-Intro-Cards/blob/main/docs/source/_static/images/example_output_page.png?raw=true" alt="An example of one page of output in the pdf" style="height: 500px; width: auto; object-fit: contain;">
</p>
The input to the main function — `make_pdf` — is a Pandas DataFrame, where rows represent individuals and columns their attributes. Columns containing individuals' first names, last names, and paths to their photos are required, but the content (and number) of other columns is arbitrary and completely up to the user.
<p align="center">
<img src="https://github.com/robertfmath/Create-Intro-Cards/blob/main/docs/source/_static/images/example_people_data.png?raw=true" alt="An example of the structure of the input Pandas DataFrame" style="height: 150; width: auto; object-fit: contain;">
</p>
These arbitrary columns are used to generate a series of "column name: attribute value" pairings (e.g., "Hometown: New York, NY") for each individual, which is then plotted below their name on their intro card. If an individual doesn't have a value listed for any arbitrary column, that column's "column name: attribute value" pairing will be omitted from their card.
The shareable output PDF contains all individuals' intro cards, four per page. It's a great way for people to get to know each other!
## Dependencies
- NumPy
- Pandas
- Matplotlib
- Pillow
- ipykernel
For a full list of dependencies—both direct and transitive—please refer to the provided `requirements.txt` file. The `requirements-dev.txt` file provides additional dependencies for development — namely Black, docformatter, Sphinx, and pypdf.
## Installation
With Python installed, simply run:
```bash
pip install create-intro-cards
```
## Usage
The entrypoint of the module is the function `make_pdf`, which generates a PDF containing intro cards for all the individuals in the input Pandas DataFrame. The function is passed this DataFrame; the names of the columns in the DataFrame that house first names, last names, and paths to individuals' photos; a path to a default photo to use in the event an individual doesn't have a photo path listed; and a path to the directory in which to store the output.
```python
from create_intro_cards import make_pdf
import pandas as pd
people_data = pd.read_csv('path/to/people/data.csv')
make_pdf(people_data, 'First Name', 'Last Name', 'Photo Path', 'path/to/default/photo.png', 'path/to/output/dir')
```
The output directory will contain the PDF, PNG images of all the PDF's constituent pages, and a logging file that denotes the names and photo availability statuses of all the individuals who had an intro card created.
`make_pdf` also provides optional keyword arguments to tweak the default layout of the intro cards, from font sizes and text placement to photo boundaries and more.
```python
make_pdf(people_data, 'First Name', 'Last Name', 'Photo Path', 'path/to/default/photo.png', 'path/to/output/dir',
figure_size=(20, 10), name_x_coord=0.40, desc_font_size=14, photo_axes_bounds=(0.01, 0.02, 0.2, 0.92))
```
To see how the different keyword arguments affect the appearance of the intro cards, a utility function called `make_pdf_preview` is provided. This function, which must be run in a Jupyter environment, displays a mock-up of the first page of the PDF that would otherwise be created if `make_pdf` were run with the same arguments (minus `path_to_output_dir`). Since it doesn't iterate through the entire data set, it takes a fraction of the time that `make_pdf` does and is ideal for prototyping.
```python
make_pdf_preview(people_data, 'First Name', 'Last Name', 'Photo Path', 'path/to/default/photo.png',
figure_size=(20, 10), name_x_coord=0.40, desc_font_size=14, photo_axes_bounds=(0.01, 0.02, 0.2, 0.92))
```
## Documentation
For full documentation, please see [here](https://robertfmath.github.io/Create-Intro-Cards).
Raw data
{
"_id": null,
"home_page": null,
"name": "create-intro-cards",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "introductions, intro, cards, matplotlib, pdf, visualization",
"author": "Bobby Math",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/94/87/683988e25c1ab830f6d3344f1aa9aed6bb9940944c68111c3a2813bc22ce/create_intro_cards-0.1.0.tar.gz",
"platform": null,
"description": "# \n\n<div align=\"center\">\n\n[](https://github.com/robertfmath/Create-Intro-Cards/actions/workflows/ci.yml)\n[](https://pypi.org/project/create-intro-cards/)\n[](https://github.com/robertfmath/Create-Intro-Cards/blob/main/LICENSE.txt)\n[](https://robertfmath.github.io/Create-Intro-Cards)\n\n</div>\n\n`create-intro-cards` is a Python module that transforms a data set of individuals' names, photos, and custom attributes into a paginated PDF consisting of \"intro cards\" that describe each individual. Each intro card displays a person's name, their photo, and a series of attributes based on custom columns in the data set.\n\n<p align=\"center\">\n <img src=\"https://github.com/robertfmath/Create-Intro-Cards/blob/main/docs/source/_static/images/example_output_page.png?raw=true\" alt=\"An example of one page of output in the pdf\" style=\"height: 500px; width: auto; object-fit: contain;\">\n</p>\n\nThe input to the main function \u2014 `make_pdf` \u2014 is a Pandas DataFrame, where rows represent individuals and columns their attributes. Columns containing individuals' first names, last names, and paths to their photos are required, but the content (and number) of other columns is arbitrary and completely up to the user.\n\n<p align=\"center\">\n <img src=\"https://github.com/robertfmath/Create-Intro-Cards/blob/main/docs/source/_static/images/example_people_data.png?raw=true\" alt=\"An example of the structure of the input Pandas DataFrame\" style=\"height: 150; width: auto; object-fit: contain;\">\n</p>\n\nThese arbitrary columns are used to generate a series of \"column name: attribute value\" pairings (e.g., \"Hometown: New York, NY\") for each individual, which is then plotted below their name on their intro card. If an individual doesn't have a value listed for any arbitrary column, that column's \"column name: attribute value\" pairing will be omitted from their card.\n\nThe shareable output PDF contains all individuals' intro cards, four per page. It's a great way for people to get to know each other!\n\n## Dependencies\n\n- NumPy\n- Pandas\n- Matplotlib\n- Pillow\n- ipykernel\n\nFor a full list of dependencies—both direct and transitive—please refer to the provided `requirements.txt` file. The `requirements-dev.txt` file provides additional dependencies for development \u2014 namely Black, docformatter, Sphinx, and pypdf.\n\n## Installation\n\nWith Python installed, simply run:\n\n```bash\npip install create-intro-cards\n```\n\n## Usage\n\nThe entrypoint of the module is the function `make_pdf`, which generates a PDF containing intro cards for all the individuals in the input Pandas DataFrame. The function is passed this DataFrame; the names of the columns in the DataFrame that house first names, last names, and paths to individuals' photos; a path to a default photo to use in the event an individual doesn't have a photo path listed; and a path to the directory in which to store the output.\n\n```python\nfrom create_intro_cards import make_pdf\nimport pandas as pd\n\npeople_data = pd.read_csv('path/to/people/data.csv')\n\nmake_pdf(people_data, 'First Name', 'Last Name', 'Photo Path', 'path/to/default/photo.png', 'path/to/output/dir')\n```\n\nThe output directory will contain the PDF, PNG images of all the PDF's constituent pages, and a logging file that denotes the names and photo availability statuses of all the individuals who had an intro card created.\n\n`make_pdf` also provides optional keyword arguments to tweak the default layout of the intro cards, from font sizes and text placement to photo boundaries and more.\n\n```python\nmake_pdf(people_data, 'First Name', 'Last Name', 'Photo Path', 'path/to/default/photo.png', 'path/to/output/dir',\n figure_size=(20, 10), name_x_coord=0.40, desc_font_size=14, photo_axes_bounds=(0.01, 0.02, 0.2, 0.92))\n```\n\nTo see how the different keyword arguments affect the appearance of the intro cards, a utility function called `make_pdf_preview` is provided. This function, which must be run in a Jupyter environment, displays a mock-up of the first page of the PDF that would otherwise be created if `make_pdf` were run with the same arguments (minus `path_to_output_dir`). Since it doesn't iterate through the entire data set, it takes a fraction of the time that `make_pdf` does and is ideal for prototyping.\n\n```python\nmake_pdf_preview(people_data, 'First Name', 'Last Name', 'Photo Path', 'path/to/default/photo.png', \n figure_size=(20, 10), name_x_coord=0.40, desc_font_size=14, photo_axes_bounds=(0.01, 0.02, 0.2, 0.92))\n```\n\n## Documentation\n\nFor full documentation, please see [here](https://robertfmath.github.io/Create-Intro-Cards).\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License\n \n Copyright (c) 2025, Robert Math\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n \n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n \n 3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"summary": "A Python module to generate a PDF of intro cards from a dataset of individuals' attributes.",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://robertfmath.github.io/Create-Intro-Cards",
"Homepage": "https://www.github.com/robertfmath/Create-Intro-Cards"
},
"split_keywords": [
"introductions",
" intro",
" cards",
" matplotlib",
" pdf",
" visualization"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c4f8f8bed0ec1865a19dcd51d0a598d360ce4736a9d6fafb88b44a7c990afae5",
"md5": "21f55f524146e78adeabb94c6428f3ed",
"sha256": "0570cde67418d725cfcae7cc9c251dd964698ce831c82ad82f12b39e67c61999"
},
"downloads": -1,
"filename": "create_intro_cards-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "21f55f524146e78adeabb94c6428f3ed",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 14511,
"upload_time": "2025-03-01T00:38:34",
"upload_time_iso_8601": "2025-03-01T00:38:34.730420Z",
"url": "https://files.pythonhosted.org/packages/c4/f8/f8bed0ec1865a19dcd51d0a598d360ce4736a9d6fafb88b44a7c990afae5/create_intro_cards-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9487683988e25c1ab830f6d3344f1aa9aed6bb9940944c68111c3a2813bc22ce",
"md5": "2ac17bc75596303cced2a2a06f1d62ee",
"sha256": "63057edbf99e55bf171aa6f4c43c46a4b1194b187e221c8f7649c1a83f2f4e5c"
},
"downloads": -1,
"filename": "create_intro_cards-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "2ac17bc75596303cced2a2a06f1d62ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 16207,
"upload_time": "2025-03-01T00:38:36",
"upload_time_iso_8601": "2025-03-01T00:38:36.393201Z",
"url": "https://files.pythonhosted.org/packages/94/87/683988e25c1ab830f6d3344f1aa9aed6bb9940944c68111c3a2813bc22ce/create_intro_cards-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-01 00:38:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "robertfmath",
"github_project": "Create-Intro-Cards",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "create-intro-cards"
}