A command line tool for automatic export of figures of various formats to PDF/SVG/PNG/JPG files.
Project description
FigExport
FigExport is a package for automatic export of figures of heterogeneous formats
to PDF, SVG, PNG or JPG files.
It uses a JSON export configuration and includes a user-friendly command line interface (CLI).
List of Contents:
Input File Formats
FigExport supports the following input files formats:
.svg: Vector graphic figures.drawio: Draw.io diagrams, created using the Draw.io tool.tex: LaTeX documents, e.g., containing a TikZ figure (recommended:\documentclass{standalone}).puml: PlantUML diagrams
Note: Other file formats in the input folder(s) will be ignored during the export process.
Installation
Using Pip
pip install figexport
Using Pre-built Executable
A self-contained package is available on a the Releases page. To install a specific executable version:
- Download the zip file of the version you want to use.
- Extract the downloaded file.
To start the application from a terminal at any time, add the folder containing the figexport executable to
your system path.
Usage
Configuration File Example
figexport_config.json:
{
"export_dir": "export",
"export_format": "pdf",
"directory_mappings": [
{
"source": "figures_A",
"target": "."
},
{
"source": "figures_B",
"target": "figures_B"
}
],
"excluded_paths": [
"figures_A/subfolder_A1"
],
"tools": {
"drawio": {
"exe_path": "C:/Program Files/Draw.io/draw.io.exe",
},
"plantuml": {
"download_url": "https://github.com/plantuml/plantuml/releases/download/v1.2025.2/plantuml-1.2025.2.jar",
"jar_name": "plantuml.jar"
}
}
}
Command Line Arguments
- CLI usage:
figexport [-h] [-c CONFIG] [-f FORMAT] [path]
-
Positional arguments: path Path to a file or folder to export. If not provided, the path(s) from the configuration file will be used.
-
Options:
| Option | Description |
|---|---|
| -h, --help | Show the help message and exit |
| -c/--config CONFIG | Path to the configuration JSON file. Default: "figexport_config.json" |
| -f/--format FORMAT | Format of the exported figures: pdf, svg, png, jpg. Default: value in config file, or "pdf" if not specified. |
Developer Section
Install from Source
Note: To avoid potential dependency conflicts on your system, it is recommended to use a Python virtual environment.
- Clone this repository and create a Python virtual environment:
git clone https://github.com/HouGui/figexport.git && cd figexport
python -m venv env
- Activate the virtual environment, then install the package and its dependencies using
pip:
pip install -e .[dev]
-e installs the package in editable mode, and [dev] includes the dev dependencies in the installation.
Generate PyInstaller Executable
Note: This step requires installing
FigExportfrom source before (see section above).
We use PyInstaller to generate a self-contained Windows executable for simple distribution:
cd src/figexport
pyinstaller main.py --name figexport
License
You are free to use, modify, and distribute this software under the terms of the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file figexport-0.2.5.tar.gz.
File metadata
- Download URL: figexport-0.2.5.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
752ced2d04670786f5c0a99c043ff28177dd6572d136ecac54ba2b1470c4df87
|
|
| MD5 |
9213640d0dd7a5f15e4d626c1fc2e81d
|
|
| BLAKE2b-256 |
9d9cae24f7fcde157f2d893aa69d16f49a13e9cd62bab7f8b63519c3fb4de8d3
|
File details
Details for the file figexport-0.2.5-py3-none-any.whl.
File metadata
- Download URL: figexport-0.2.5-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdd113f86fddabc4e2a8722a475c841df28ea522d2abdbb08582cfa7c97c04ae
|
|
| MD5 |
13c751545d34b7df6b8fea99431c4a0a
|
|
| BLAKE2b-256 |
c578f91b2f293e26ca8802882ef62f55b7cf50338cb1cf9f7feaed0d5ff845fe
|