This Python script reads data from a JSON file containing information about firearms and their accessories. It creates two tables: one for the firearms and one for the accessories with serial numbers. The tables are displayed side by side on a single page in a PDF document.
- Loads firearm and accessory data from a JSON file
- Generates two tables: one for firearms and one for accessories with serial numbers
- Formats the tables with left-aligned text and increased cell spacing
- Saves the tables as a PDF document in A4 landscape format
- Python 3.x
- Pandas library
- Matplotlib library
-
Make sure you have Python 3.x installed on your system. You can download it from the official Python website: python.org
-
Install the required Python libraries using pip, the package installer for Python. Open a terminal or command prompt and run the following commands:
pip install pandas pip install matplotlib
This will install the
pandas
andmatplotlib
libraries.
- Ensure that you have the required Python libraries installed (
pandas
andmatplotlib
). - Place the JSON file containing firearm and accessory data in the same directory as the script.
- Update the
json_file_path
variable in the script to specify the correct filename. - Run the script.
- The script will generate a PDF file named
firearms_and_accessories.pdf
in the same directory.
This code is released under the MIT License.