Skip to main content

Extract resources from Autodesk Fusion Electronics .f3z project files

Project description

FusionExtractor

A Python library for extracting resources from Autodesk Fusion Electronics .f3z project files.

Overview

.f3z files are ZIP archives that embed multiple nested archives containing schematic (.sch), PCB (.brd), and preview image data. FusionExtractor unpacks these without any third-party dependencies.

Installation

pip install fusionextractor                  # stdlib only
pip install "fusionextractor[zstd]"          # adds Zstandard support for 3D model previews

Examples

A sample Fusion Electronics project is included in examples/IOMOD-AD5593R_v2_0.f3z for use by automatic tests and for you to use when trying out the library.

To run examples/extract.py, open a terminal in the library folder and type:

pip install -e ".[zstd]"
python examples/extract.py examples/IOMOD-AD5593R-v2_0.f3z

This will create a new folder called output in the current directory, and extract various assets from the sample project into it. Check the source of extract.py to see the options it uses relating to output filenames, etc.

Usage

from fusionextractor import FusionProject

with FusionProject("design.f3z") as proj:
    # Read the design name from embedded metadata
    print(proj.design_name)

    # Get raw bytes
    sch_bytes = proj.get_schematic()   # Eagle .sch file
    brd_bytes = proj.get_board()       # Eagle .brd file
    previews  = proj.get_previews()    # list[PreviewImage]
    bom       = proj.get_bom()         # list[BomEntry]

    # Extract to disk
    proj.extract_schematic("output/")           # writes original filename into output/
    proj.extract_board("output/my_board.brd")   # writes to exact path
    proj.extract_previews("output/previews/")   # writes all preview PNGs
    proj.extract_bom("output/")                 # writes {design_name}_bom.csv

Destination path behaviour

extract_schematic and extract_board accept an optional dest argument:

dest value Result
None (default) Written to the current directory, original filename preserved
A directory path or path ending with / Original filename preserved inside that directory
A full file path (with extension) Written to that exact path

Preview images

get_previews and extract_previews return images from all four nested archives:

  • small.png — thumbnail present in every nested archive (schematic, board, project, 3D model)
  • Large PNG renders — present in the project (.fprj) and 3D model (.f3d) archives only

Pass include_large_images=False to retrieve thumbnails only.

for preview in proj.get_previews(include_large_images=False):
    print(preview.source, len(preview.data), "bytes")
    # e.g. "schematic 4821 bytes"

PreviewImage fields:

Field Type Description
source str Archive the image came from ("schematic", "board", "project", "3d_model")
path str Path of the image inside the nested archive
data bytes Raw PNG bytes

Extracted preview files are named {source}__{original_filename} to avoid collisions when multiple archives contain a small.png.

API reference

class FusionProject:
    path: str | Path                                          # path to the .f3z file

    design_name: str                                          # property; from embedded metadata

    def get_schematic() -> bytes
    def get_board() -> bytes
    def get_previews(*, include_large_images: bool = True) -> list[PreviewImage]
    def get_bom(*, include_power_symbols: bool = False) -> list[BomEntry]

    def extract_schematic(dest=None) -> Path
    def extract_board(dest=None) -> Path
    def extract_previews(dest=None, *, include_large_images: bool = True) -> list[Path]
    def extract_bom(dest=None, *, include_power_symbols: bool = False) -> Path

BOM

get_bom parses the component list from the embedded schematic. Supply/power symbols (GND, VCC, NC, etc.) are excluded by default; pass include_power_symbols=True to include them.

for entry in proj.get_bom():
    print(entry.reference, entry.device, entry.package, entry.value)
    # e.g. "C1  CAP  0603  100nF"

BomEntry fields:

Field Type Description
reference str Reference designator ("C1", "U1")
device str Component type / part number base ("CAP", "AD5593R")
package str Footprint / package ("0603", "TSSOP16")
value str Component value ("100nF", "10K") — empty string when not set
library str Eagle library name ("SuperHouse-Capacitors")

extract_bom writes the BOM as a CSV file named {design_name}_bom.csv.

Exceptions

Exception Raised when
FileNotFoundError The .f3z file path does not exist
FusionExtractorError The file is not a valid ZIP/f3z archive
FileNotFoundInArchiveError A required entry is missing from inside the archive

Both custom exceptions are subclasses of FusionExtractorError and are importable from the package root:

from fusionextractor import FusionExtractorError, FileNotFoundInArchiveError

Requirements

Python 3.9+. No required third-party dependencies.

The .f3d archive (3D model) uses Zstandard compression, which Python's stdlib zipfile does not support. Without the optional extra, 3D model previews are silently skipped. Install .[zstd] to enable them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fusionextractor-1.1.0.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fusionextractor-1.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file fusionextractor-1.1.0.tar.gz.

File metadata

  • Download URL: fusionextractor-1.1.0.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fusionextractor-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a8a305a1f2f1fb0afe944aee9adfa78ee66e998b7a6ea19fc3a2a0516d851fcb
MD5 9beb523bf678bf2bd3e55b37e8ac63b6
BLAKE2b-256 88638e2c292ca7959e6d319e4a41a50e661a290a648324e28031ba007e9e7808

See more details on using hashes here.

File details

Details for the file fusionextractor-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fusionextractor-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7109c3966decb0baebeb5eb31477813dd581c978419d7150e6d2095768c309f
MD5 3a501d2c68c5926c6e429c9bcada46c2
BLAKE2b-256 4deb8ce0cd61c7dfd6c947de703fe57b50404523ce5bfcfbe12824ed4a114a4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page