ahupp / python-magic

A python wrapper for libmagic
Other
2.64k stars 283 forks source link

🐑 Create basic stub file for magic.py #220

Closed coiax closed 4 years ago

coiax commented 4 years ago

A stubfile was initially generated using stubgen, and then refined in order to increase the accuracy of the core API methods.

Both from_file and from_path, both as independent functions and class instace methods, have been annotated appropriately (taking Union[str, bytes] and returning Text.

Resolves #174.

ahupp commented 4 years ago

This is great, thank you!

RJPercival commented 3 years ago

@coiax, for this to actually work, you need to include a file named py.typed in the package. See PEP-561.