Use rust infer crate to rewrite python-magic library
Project description
magic-rs
Use rust infer crate to rewrite python-magic library
Installation
pip install magic-rs
Quickstart
from magic_rs import from_path, from_bytes
with open("testdata/sample.png", 'rb') as f:
data = f.read()
py_magic = from_bytes(data)
print(py_magic.extension())
print(py_magic.mime_type())
print(py_magic.is_image())
print(py_magic.is_app())
print(py_magic.is_archive())
print(py_magic.is_audio())
print(py_magic.is_book())
print(py_magic.is_document())
print(py_magic.is_font())
print(py_magic.is_video())
print(py_magic.is_text())
py_magic = from_path("testdata/sample.png")
print(py_magic.extension())
print(py_magic.mime_type())
print(py_magic.is_image())
Benchmarks
For details, see benchmark.
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
magic_rs-0.1.0.tar.gz
(17.8 kB
view hashes)
Built Distributions
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 130bbaf14f28302db466e7630bbef0ad70544c896813ba95e5ae78cba927b561 |
|
MD5 | 23666528ffb599c3673d96f09c0dad1b |
|
BLAKE2b-256 | eccf9466a41e424616e271e39a074d37323ee9180d25e8d2da3e2a7f984d5c12 |
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab3dbc7703a0523c99ac6d1f5ed66655346d6f773da173ff204431e60878bbd6 |
|
MD5 | b22743117549645429a3f49accb817f1 |
|
BLAKE2b-256 | f8aa968dbd1ff11b462fd7a461a2bc84749e34951eb89a00497b51da9abba215 |
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e38262e0c9e4d1eff5656c5404f142cb55632a28c16c00bcadb2137cb346de72 |
|
MD5 | 848cb48f9fa3b7cc888fe816d59daadc |
|
BLAKE2b-256 | 2000a3d7efda716f3777611cccbacf1dbc2120ff11d8b366ae083f76b2065504 |
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85a432c4be6daf15c94079234860689fd483b091088d04c4105f8756eae0e77b |
|
MD5 | afea009f168a088761616769bf4005f9 |
|
BLAKE2b-256 | abe7617b21d64368afe0a4dbb62bdbd6f8dfb140785ff9bd225de96c060d33d4 |
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6caab3e366903f96e9c0a70f260d2f5c1cf5f9ba5c3b8695249f50fd7131db97 |
|
MD5 | 4d47884fb7e4b5dc43939e97fbda8f32 |
|
BLAKE2b-256 | ef4bce441b7a72a5fe7f15e2a6d3c8cbe94371018ed04d76a04c00b177e770a6 |
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 173bf9f042608fe4084a42f40e468c45753b8b2132e1cad5eee2e3a24ec771bd |
|
MD5 | dc742b82bcf4e7451e6fdbecb4cbc617 |
|
BLAKE2b-256 | f24a63a4dfabb0159aef66031cf2a5e1dbc993d7a205ed808651199b74f4fe62 |
Close
Hashes for magic_rs-0.1.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7089d797785541c26453da2745563dca190a802c30b8e5348218234468d6de6f |
|
MD5 | 407224b1a23910ea02cd16e279f02391 |
|
BLAKE2b-256 | d9af9907b7b99e3805289ba3cff456fcd7f690233f49e284a7506288095d0d78 |
Close
Hashes for magic_rs-0.1.0-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb6f977e433529daf586b1800e8a0231cb90d6b6d97c8eb49e36fa11ce4eb93 |
|
MD5 | d59c6394c517e0b41a84374cd8341e68 |
|
BLAKE2b-256 | 80a3463fdac715b6ef821c732dd73fa35e1f40a1fe62667bd7a631b5e49bfbc7 |
Close
Hashes for magic_rs-0.1.0-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c138cd926d674afac5170270a6778765d57bb4a663c3d1c6089beb36bf930c93 |
|
MD5 | 82dd8399a85099cd1784e72d6ba53179 |
|
BLAKE2b-256 | 4c61d3592dee0870c6247bcc9813f9a1f7ac0c46066fb9b04976d77fbd4a7dcc |
Close
Hashes for magic_rs-0.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cfd2e93f1aca616890437e2690477aaa38fec7afd309a6b0f6ad0aaa54cf7f6 |
|
MD5 | 75c4220fa6cd923d0a26d90e4b64d3ac |
|
BLAKE2b-256 | f0d1883a1a35ac558f0a4f4fe10cdbf4bfe83f0893079dd6642e929f3953d310 |
Close
Hashes for magic_rs-0.1.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0d44697b075aec705f3ced5b587f72a27f83eb0fdc04fbaa5c4af49d43d88a4 |
|
MD5 | 9780efd3596477b789dc6e0f67f135a7 |
|
BLAKE2b-256 | 78f1fd2e262e1482bafc0f8b11cb9dea178fda931345c877621f257187356397 |
Close
Hashes for magic_rs-0.1.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c02168c9455959e181b17747954d0be9ff118ed77d76205c165508197ec77e7 |
|
MD5 | 467fbe01d5a5f909c1718bcc456ed3b6 |
|
BLAKE2b-256 | 99307f15cd1ebac46d1a1e7f2f8f06b0048971b8e33e01392172b6cc56047c06 |
Close
Hashes for magic_rs-0.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c67c45fb20de3b3ea934cc96031c9cdbf90607d4ec18e5b4b93a4ba07ac15a7 |
|
MD5 | 6cfec01e3465aea1cc4b083ce4d912bd |
|
BLAKE2b-256 | 5fc57a5878136f184afa74ebddd231a890d665b58878eae5474d0c8fe1df5b08 |
Close
Hashes for magic_rs-0.1.0-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59fe12f4b0acf63cab82bbe378daee5a165c39ceb0f297688f47ebd956bf2f54 |
|
MD5 | 68e9ee059c43af695e350d6c570eef62 |
|
BLAKE2b-256 | a8e1c44767ac97c615c9ee6102f78e5ffc1c5b82489d22f7bcee93f65e502a22 |
Close
Hashes for magic_rs-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4e913b2cb78354123c3b38f7e8b12babc28b7b073543aababe3377801f44cf7 |
|
MD5 | 0fc5cb8b530cd2d822ba210e430962b5 |
|
BLAKE2b-256 | e091981444fdb881d58a7da98d3ec027d78c9849d17047468325f59104d09e7f |
Close
Hashes for magic_rs-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7962a6a0aafbea149f6739d08bbd73c50687b0426d10ca9c7306f923cc92429 |
|
MD5 | aeb64fbe3790219c54c764a1055738eb |
|
BLAKE2b-256 | 2ec2b57956bcfbd5b9943ec049950f6e4a77bebccf6b49fbc92eb66c9039da64 |
Close
Hashes for magic_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a7a2470d390c141eb7c5f38b51d80bd846834947970b1a56b41aeb9014a7bb9 |
|
MD5 | cc679a2c32aec1576ec25764309526b2 |
|
BLAKE2b-256 | bbe0c2ad8a14229af336302a4711fdc93c3c3cb0a8b682781e9ec659627037e4 |
Close
Hashes for magic_rs-0.1.0-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1f75d63952c480261e0a06b8a20f20b52dc1d525436f7d1b90441b378c9ba31 |
|
MD5 | 0663187408ae38a28bc0c8585e110f49 |
|
BLAKE2b-256 | dddbb5075f6a425d1ab999d9b4067c4867626c7746cb30459ed6420215bab868 |
Close
Hashes for magic_rs-0.1.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b19beaeea18e5a78a7e2d76bee19627aceb3def0e1876093f567ceb2ab26e3f |
|
MD5 | 9a2aa66bdd985a16aaa279c0d3b584be |
|
BLAKE2b-256 | 67da1c320a109d509f32fae660e242e8d0e09ce795da5363c6c37c2fbafa8827 |
Close
Hashes for magic_rs-0.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c48fe9f5c7318a3d4c3339ec4846bd56b1c818b701adb46f1ef55472b425faf |
|
MD5 | 202d3ea74ffb23528284c0ba89e82fb9 |
|
BLAKE2b-256 | 3d6c6910967f494b55da1da6c315c06869539e9398866966f0c29692f85bffb5 |
Close
Hashes for magic_rs-0.1.0-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30195dfdac5539692c7d35311c0055d88ff9126174557a2f7cc06169b1c0b930 |
|
MD5 | 249de81efe8d114420678ba4c2c164cd |
|
BLAKE2b-256 | 3a6881a4f02a1ebab6a94564c97a4030ee4c30d892604ff1d1fb9dffb0d6abdb |
Close
Hashes for magic_rs-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e6319c1b05d0ae0195a99cbc22825f18339515d4640f7ef8f8fe3bb4435c4c0 |
|
MD5 | f298f4cf3f2e19db3d788a4ff764d382 |
|
BLAKE2b-256 | c067dfeb14fe4974405ab598f95965450154bf98823e0491315fbbf1aa152ce4 |
Close
Hashes for magic_rs-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3ef20faa211ed7b823116d20d8d540b5e3ecba6630bc3721d2e2b4dd72555fc |
|
MD5 | 62cd104ac61974f02cff1b257d63efb5 |
|
BLAKE2b-256 | 2964b5066fcca451f2493674e13ed7eff43b49e4e09e5ebbac9673d090d14630 |
Close
Hashes for magic_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3cde1065c5a8ada7e1460753ccef886d1e006a69e402f8716a40a8fd4aafb29 |
|
MD5 | 3d98884ad5b723909f26079f3c208014 |
|
BLAKE2b-256 | 69e5625e5a6ec7d82d3ee101b97f149f9cd37f3756ecfeb6dae2fc101c28e7e9 |
Close
Hashes for magic_rs-0.1.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae3655f534c3d2f564debe7ee0e24964fb32ce351304acbd6f835e1d0f40dcb2 |
|
MD5 | 1e768b768a1f09a4839248cfb219d66f |
|
BLAKE2b-256 | 7de7363cd20c6dd0add7a5d861bbf8379304e42a3943b3b084e4f72e3bbb0065 |
Close
Hashes for magic_rs-0.1.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76d7b499da46b5973f383969836883f6c79455234b9e319f2d4c31564b2eda83 |
|
MD5 | 468d571e169a6ab755d44ffde09c844e |
|
BLAKE2b-256 | b7a4aea3e1c2a52275e092c934eda9a36660b3c4a88eef1f626a04907796e644 |
Close
Hashes for magic_rs-0.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da33eb37efc69f2f99bd093dbb7feede657b2dc2dc77f976edb469062741402f |
|
MD5 | f8890207767dd3b662406b97767401d6 |
|
BLAKE2b-256 | 17bf12d50f15ad3642e53096b07fbb0959baa3741af7bc4c015fe97a3bdf57bc |
Close
Hashes for magic_rs-0.1.0-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a7cf62bd6c8508040396a0b84ecbe46422d30d51a00fc4370c08b2f11246d03 |
|
MD5 | 331043c55277fc7979bb3d61359c7a9a |
|
BLAKE2b-256 | fec353fa3882779fab809eb04bc0cea6cb3e57fca8a64c002b8165bb920f6133 |
Close
Hashes for magic_rs-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78cc37fba023baff5c988285bfbaee7d7349b626e81e90d7f424400b402d4354 |
|
MD5 | fdd97f88a7a9e54ad54cedf440e17197 |
|
BLAKE2b-256 | b8e0b8a42ba6c8e0d65eaa9a3976fd97b9f221c053739784d81da4c6f0cfddf6 |
Close
Hashes for magic_rs-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a504848bcf49780adb1dcaa4725c8de7dd6b35398e3127376d7b8c1d61e4b6c3 |
|
MD5 | fb0d9c1bed1428d45489afad03a8930c |
|
BLAKE2b-256 | 100e9bf1cbde6328a459069c51ce096337525f2f7379bbe547345f53751a06f3 |
Close
Hashes for magic_rs-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dad81306ad90b0629c3db2e1ab5cfd80244f2b40fb681adf50dab335f2789e69 |
|
MD5 | 20335cc646a1332db03019b1f69859a1 |
|
BLAKE2b-256 | ced6ae52821e335477742fbe76da7b6e261a8412edf2d61fc82ee31de1669cf7 |
Close
Hashes for magic_rs-0.1.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2c6eaf83b5e4d83413c4f771d49e9f30c59dd0dcf7dd6f5f72e1ff8f13ef162 |
|
MD5 | fca9c2efbfe3090275d7966232f27c9c |
|
BLAKE2b-256 | 623239685401a685c86ceeb68c1df42ef5d26ed7ebd551f6e03972299b02bc6d |
Close
Hashes for magic_rs-0.1.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0af5fbb732b387cd3bd17858e5e454272c2b4e452a7ee53785ba09f7205f8100 |
|
MD5 | 194819e83ea472b108e43664d2d7f3c8 |
|
BLAKE2b-256 | 5bdea9c6a802d8799027f0f075d45ea6f7b2d96e78833a930246093736fa4c2c |
Close
Hashes for magic_rs-0.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501a7a287db0b49eb4ebeffab731eaad614f63d6534f9d994c9c29b146321f80 |
|
MD5 | 2509b6ffd783347356602b3826713242 |
|
BLAKE2b-256 | 67c61db86a741da8338ad60f279e6ebc5bcf4736aac06a6dbf9f33a48c6b18ac |
Close
Hashes for magic_rs-0.1.0-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f1643f9732d9f0e092ca90bfa268bd256684e251cdc92a745d9cbff956294a2 |
|
MD5 | 3ed76336fd83b64c27f892e202578c94 |
|
BLAKE2b-256 | b1521b72955f0ca9f57387bc6481c43ff8c3f8d95034b62e7996afa43e9a6cf3 |
Close
Hashes for magic_rs-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ebe98ebc1879c630cf9bc586d4a832dec7c288a43d71f46ba8402ead51ddc68 |
|
MD5 | 4c17fef5d1d0d90e27f4db297b70f387 |
|
BLAKE2b-256 | 7b111aeed4ccf2eeaad9acca35c359f49c2daf5e51f59971c6764e10970f7847 |
Close
Hashes for magic_rs-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 398a1895ae195700ab87791a06f3b30108d19d9d4133c0ec335cec86f19c273a |
|
MD5 | 05d18a41732e56c2caaff8b7cad42a28 |
|
BLAKE2b-256 | e31b31c025f687da2944de150a3a40ca3c4767d9f7b4c8a1f07bf5cf3ff543e1 |
Close
Hashes for magic_rs-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e83d56147c00dc4c7ab7f955cbbd796248ba939f7a7abf716b22dfd8fc97a0d |
|
MD5 | 24e6b224b66472756a22c0d5a112451c |
|
BLAKE2b-256 | 0f65fb889ea7722c25b59983a4fd07ee397ff3490b246d7c9a4a601797ecf788 |
Close
Hashes for magic_rs-0.1.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75261e486a1f0527570bcc8aaadb56ffb439e8e68ec2c4bb57e0447815d954c1 |
|
MD5 | 2b031340337ca8a36e4fda3921f56e17 |
|
BLAKE2b-256 | e3f4dd391aa33b08c820eb78117c69b97e2c29b0c2a666f7002247b8a3871a8c |