libyal / libpff

Library and tools to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format
GNU Lesser General Public License v3.0
286 stars 74 forks source link

Add Python bindings #2

Open joachimmetz opened 9 years ago

joachimmetz commented 9 years ago

Complete work on Python bindings

kevthehermit commented 7 years ago

I appreciate this is still WIP. Im writing a native PST Parser for a DFIR Platform. I have most of the library working the way i need it to. See Gist here - https://gist.github.com/kevthehermit/40ff03e3adc524ece04f735e68be43c2

With the exception of Extracting attachments. I see this partially exists - https://github.com/libyal/libpff/blob/3aefe76793d03d538e48f99436e4aada9ed9eedb/pypff/pypff_message.c#L159

Any timeline on this feature and anything i can do to help?

Just trying to avoid OS calls.

Appreciate all the work you have done.

kujenga commented 7 years ago

I'm also curious about support for attachments. I'd be happy to take a look at implementing support for it and opening a PR if you could give me some pointers as to what needs to be done @joachimmetz

joachimmetz commented 7 years ago

Sorry for the slower response, quite busy at the moment. What needs to be done is adding attachment support to the Python bindings. Which is largely a wrapper around the API. Unless you're very familiar with writing Python bindings, it is likely faster for me to implement it than explain it. But if you want you have a look at the current code.

kujenga commented 7 years ago

No worries, and fair enough! I don't have any prior experience with writing Python bindings unfortunately. Do you have a sense of when you may have the time to tackle this?

I see this commented out code: https://github.com/libyal/libpff/blob/32229298f2721fd329cb318d1fe4f55f81397fdf/pypff/pypff_message.h#L105-L118

And at first glance what look like the necessary implementations here: https://github.com/libyal/libpff/blob/32229298f2721fd329cb318d1fe4f55f81397fdf/pypff/pypff_message.c#L2089-L2274

Is there much left to do beyond uncommenting the headers and other definitions?

0x6e69636f commented 7 years ago

I'm also interested in this binding, but have no experience writing this kind of things Should I write a program in C instead or is the C lib dedicated to be used with Python ?

joachimmetz commented 7 years ago

@nicolasbd the Python binding uses the library, either compiled into it or as a separate shared library

xvolte commented 6 years ago

Hello @joachimmetz,

did you had the time to implement the python bindings for msg attachments ?

it seems that @kujenga saw the code implemented somewhere but i can't use it so far.

i'm using the pip package (pip install pypff) which works well for parsing PST files and reading each msg one by one, but i also need to have access to attachements ...

thanks in advance,

joachimmetz commented 6 years ago

did you had the time to implement the python bindings for msg attachments ?

Unfortunately no, I have a very busy schedule, and numerous things consume the little available time I have.

it seems that @kujenga saw the code implemented somewhere but i can't use it so far.

I'm unfamiliar with this work, nor has there been a PR from this person. There was https://github.com/libyal/libpff/pull/56 however that was closed by the author without any explanation.

xvolte commented 6 years ago

Looks like it is already written in your code ? https://github.com/libyal/libpff/blob/32229298f2721fd329cb318d1fe4f55f81397fdf/pypff/pypff_message.c#L2089-L2274

Thanks in advance, and thanks already for all the great work!

joachimmetz commented 6 years ago

Looks like it is already written in your code ?

I made a start, but this needs to be finalized and tested

cdeil commented 4 years ago

Is there a way to get at the attachment by now?

I'm working for the first time with Outlook PST files, and thanks to your library got to a list of messages and see this:

>>> msg.number_of_attachments
1

Is there any other way to extract all the attachments (Excel files in my case) from the emails in the PST?

joachimmetz commented 4 years ago

Is there a way to get at the attachment by now?

Yes, but currently not with the Python bindings. Use pffexport

RaulArtigues commented 1 year ago

Hello,

It would be nice to be able to get the categorization of the emails that are in the .PST file.

joachimmetz commented 1 year ago

It would be nice to be able to get the categorization of the emails that are in the .PST file.

Raul first of all don't hijack this issue. Second per side conversation please read up what a PST files is (a MAPI database).