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.12.0.tar.gz (219.4 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.12.0-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pygfried-0.12.0-cp312-cp312-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pygfried-0.12.0-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

pygfried-0.12.0-cp310-cp310-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pygfried-0.12.0-cp39-cp39-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.9Windows x86-64

pygfried-0.12.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.5+ x86-64

pygfried-0.12.0-cp39-abi3-macosx_14_0_universal2.whl (2.0 MB view details)

Uploaded CPython 3.9+macOS 14.0+ universal2 (ARM64, x86-64)

File details

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

File metadata

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

File hashes

Hashes for pygfried-0.12.0.tar.gz
Algorithm Hash digest
SHA256 0e7e23a11c0348dab857a9a5cd0ef25b6d36cd3f157fe9f1da3b62e2319602c2
MD5 c69d10fb406e448f5109bc2e325ad702
BLAKE2b-256 328d9262e3a2c41892627a9a1803af8c992767d32b7d6df54f04de150471c925

See more details on using hashes here.

Provenance

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

Publisher: ci.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.12.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.12.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygfried-0.12.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b1fdcecf143543c4625e9ee47e5a4cb9107de48c190f531706cc4dd34029a1be
MD5 de519e5d19cbe63c19ddf36db24fa28e
BLAKE2b-256 d1899070e39ad05523d5ef761a0b9db601b3b63a2c3150850837d97ea91f4bd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.12.0-cp313-cp313-win_amd64.whl:

Publisher: ci.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.12.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.12.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygfried-0.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e9d3503d1cf6cfe287ef09dad685397feb0184f220a9ee5f851ca878d2000d71
MD5 82868e2e46527cb42fbd206aa92879ba
BLAKE2b-256 fc8034cef93f7a2ff5510c22a5e889af3ec308105b9ce956c55c4069790fd9ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.12.0-cp312-cp312-win_amd64.whl:

Publisher: ci.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.12.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.12.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygfried-0.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f62dfa23547a7e2f7c2efd6896920d3b479656962de75d2d9b1e5d0433d173e3
MD5 329626eb42c40870728091711946f162
BLAKE2b-256 1ca3e3ef534b2e96d00ccdd054669fcd6459c0a55d5a03950c911ecd390c244b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.12.0-cp311-cp311-win_amd64.whl:

Publisher: ci.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.12.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.12.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygfried-0.12.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 55651aefb1d96b2fef14214bda3c3de8d32301a5e36ac0970c73db9c4ec66c48
MD5 40a615c685839335fe7c7c503aaa7e33
BLAKE2b-256 7b81f91e0b9a673e7b9ccc16b5b68bd2426fc2a7960c486d64cf60852cef56b0

See more details on using hashes here.

Provenance

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

Publisher: ci.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.12.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pygfried-0.12.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygfried-0.12.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7acad46bde36d95569b4ee53635d7ae034015e0b9f18b1ea3da51d0037701e69
MD5 ac284a89a3c6a366cc46b45a1c130f6a
BLAKE2b-256 05a57a5efe987e059e0f47489753e26b4add4bfc029db8b758c3cc3697d1ac51

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.12.0-cp39-cp39-win_amd64.whl:

Publisher: ci.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.12.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pygfried-0.12.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6531a848043051cc1d852ddabf938b6494f7c65403b659bfb21d7fbcd320fdeb
MD5 8cf1d811791843060426a6d02ead0867
BLAKE2b-256 c393d15a2e4a21ac04562b96c36ce9d4f24857aa86cf5a8efffca7c2689752bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.12.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl:

Publisher: ci.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.12.0-cp39-abi3-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for pygfried-0.12.0-cp39-abi3-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 bc8c80494f74efd6c241522b7d3c42832f008e3dd4b7c0687fed2c21f0d7c21b
MD5 c4ee725997848bc01ff992486fced7d1
BLAKE2b-256 f3e2d927e95411f5f32fb5d8fa1b0b4a40ee2f45566abdce28a417263e628cf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygfried-0.12.0-cp39-abi3-macosx_14_0_universal2.whl:

Publisher: ci.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