dtrx-py / dtrx

Do The Right Extraction
GNU General Public License v3.0
223 stars 10 forks source link

[FR] CLIs are nice but APIs are better #31

Open brianthelion opened 2 years ago

brianthelion commented 2 years ago

First, thanks for taking this project over! Great effort.

My feature request: I would love to see the monolithic ExtractorApplication broken down into smaller pieces. Ideally, I would be able to do something like this instead of calling ExtractorApplication.run(...) in my code:

archive = dtrx.Archive.from_path(...)
for path in archive:
  print(path)
archive.extract(dst=...)

Cheers!

noahp commented 2 years ago

Ah, nice idea! Definitely open to a PR if you're motivated, otherwise I'll take a look at this when I have some time.

Thanks for filing this issue!

brianthelion commented 2 years ago

After spending some time with the dtrx source code, I'm a little unsure about how to best implement the feature. Probably worth discussing a bit. The "tricky" logic is here: https://github.com/moonpyk/dtrx/blob/f8140a1ce64120d631e23af9b1525959d1095434/scripts/dtrx#L1275

I'm not entirely sure I follow what's supposed to be happening here, beyond the obvious.

Any insight?