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.0.tar.gz (658.1 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.0-cp310-abi3-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

pygfried-0.14.0-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.0-cp310-abi3-macosx_15_0_universal2.whl (2.1 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for pygfried-0.14.0.tar.gz
Algorithm Hash digest
SHA256 31b349af461d2f23ee61230377a628179eca4c97bb82c73c1ec2ef64ff127971
MD5 78363bfc359f9a651991a138da679a2c
BLAKE2b-256 e3cb8651773d97b46da12b534fcdef521bceb35a37f0be5f17c51d173178eeed

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.0.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.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.14.0-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.12

File hashes

Hashes for pygfried-0.14.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0d47a5b209a3dcb3368913f8eb5c758f0573384d3d3ac35dc9560ad8b3674f63
MD5 de3e7bfb80953062aca827908271a439
BLAKE2b-256 36cd966ded3948e4c4a97205606ea09dffc4d98ee980795e55958271998629f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.0-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.0-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.0-cp310-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a36eb062dab58602bbbbca5e0089f0570d2b36ddc22a51670633923840309012
MD5 4cd70977a35ac9014940a0cc2f0f9140
BLAKE2b-256 757dccb1d828bc80d3615bcffff905319faaef63fd23f3d72b7fe8f33991e95e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.0-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.0-cp310-abi3-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for pygfried-0.14.0-cp310-abi3-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 40970a6d469348e0cd91f5ea02bcb351afef52f27fa2c98bc650d157bc257e2c
MD5 9d21e97090831d3764c6d8492a7d7328
BLAKE2b-256 3cc21bdd831e808633ab07f96d70d27e0c05b936b3358cdb2ff83c3e3512d6fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.14.0-cp310-abi3-macosx_15_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