Skip to main content

Siegfried as a Python extension

Project description

PyPI version

Pygfried

pygfried is a CPython extension that brings siegfried - a powerful, signature-based file format identification tool written in Go - into the Python ecosystem.

Identifying a file with pygfried

Instead of reimplementing siegfried's logic, pygfried embeds the original Go code directly, making core siegfried functionality available to Python users without any changes to the underlying detection engine.

No animals were harmed in the making of this extension.

Usage

$ pip install pygfried
$ python -q
>>> import pygfried
>>> pygfried.version()
'1.11.2'
>>> pygfried.identify("example.png")
'fmt/11'
>>> pygfried.identify("example.png", detailed=True)
{'siegfried': '1.11.2', 'scandate': '2025-06-10T07:16:31+02:00', 'signature': 'default.sig', 'created': '2025-03-01T15:28:08+11:00', 'identifiers': [{'name': 'pronom', 'details': 'DROID_SignatureFile_V120.xml; container-signature-20240715.xml'}], 'files': [{'filename': 'example.png', 'filesize': 237675, 'modified': '2025-06-10T07:11:26+02:00', 'errors': '', 'matches': [{'ns': 'pronom', 'id': 'fmt/11', 'format': 'Portable Network Graphics', 'version': '1.0', 'mime': 'image/png', 'class': 'Image (Raster)', 'basis': 'extension match png; byte match at [[0 16] [237663 12]]', 'warning': ''}]}]}

Limitations

Go libraries can clash

This project uses Go's -buildmode=c-shared to provide its Python extension. Loading multiple Go-based shared libraries in the same process is unsupported and may result in panics or crashes due to conflicts between separate Go runtimes.

This limitation should only affect you if you're using pygfried together with another Python library that also uses a Go extension (built with the same c-shared mechanism) in the same process. If you're just using pygfried on its own, you don't need to worry - everything should work as expected.

Credits

pygfried is powered by the original siegfried project, which is distributed under the Apache License, Version 2.0. All core file format identification logic and signatures are provided by siegfried. We gratefully acknowledge the work of the siegfried project and its contributors.

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

pygfried-0.14.1.tar.gz (658.3 kB view details)

Uploaded Source

Built Distributions

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

pygfried-0.14.1-cp310-abi3-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

pygfried-0.14.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

pygfried-0.14.1-cp310-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pygfried-0.14.1-cp310-abi3-macosx_11_0_universal2.whl (2.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file pygfried-0.14.1.tar.gz.

File metadata

  • Download URL: pygfried-0.14.1.tar.gz
  • Upload date:
  • Size: 658.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pygfried-0.14.1.tar.gz
Algorithm Hash digest
SHA256 23491acb0e36012ac9b74df3201d0267e305e408cceadcbf85471f6ca0dfc329
MD5 28c6809acbdc48ab3d52c0b8e45c474f
BLAKE2b-256 b53d2339474172e8531c5996868187253c31d1a3e65e7aeee0f1102aa3e269d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.1.tar.gz:

Publisher: release.yml on artefactual-labs/pygfried

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygfried-0.14.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.14.1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pygfried-0.14.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 802f49c2f066113209c73c02f3acdd59ac9c2a11607f0ef2c2d3b724e3f4a155
MD5 8b220cc265bfb658c6a50d0fb558c899
BLAKE2b-256 3512d5284bc29845d05c398a634d34d99515a6f55d30a49c84494f353347aa47

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.1-cp310-abi3-win_amd64.whl:

Publisher: release.yml on artefactual-labs/pygfried

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygfried-0.14.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for pygfried-0.14.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 b1a27d857f1d691cd5d7b522a8651b92605d0a3d394eda3f225add24c613faa6
MD5 3af3c0f52bd1be29e80fbc76a02653ca
BLAKE2b-256 7f1235a0f3be43ebe00188fbaa93707b3a3ddfe558cff9df9139ed5f072a69d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl:

Publisher: release.yml on artefactual-labs/pygfried

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygfried-0.14.1-cp310-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygfried-0.14.1-cp310-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f98b20a5f1b2c675d6c729c44093773ed39441b4912b225e3d2bb7f5bab9fe59
MD5 11c123844cfe3f97a05db1787e86c345
BLAKE2b-256 dc458e73ac6e87dee29134cb959afcdab5c816c24746096d45ff1632427b9a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.1-cp310-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on artefactual-labs/pygfried

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygfried-0.14.1-cp310-abi3-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pygfried-0.14.1-cp310-abi3-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 6afb3262376c5c5095bafb78c2b9cf787558adbad3c3b1f2e9367a2b0e11bc3d
MD5 36c6d584afb9c825956f047dd75dbace
BLAKE2b-256 fe25bb7789ff5aaf80f285e55f4598b6a73b605dd42c9921c43509947231632f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.1-cp310-abi3-macosx_11_0_universal2.whl:

Publisher: release.yml on artefactual-labs/pygfried

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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