JohnDoee / magnet2torrent

Turn a bittorrent magnet link into a .torrent file
MIT License
60 stars 9 forks source link

Separate CLI tool from module #2

Open rndusr opened 4 years ago

rndusr commented 4 years ago

I'm the author of torf, a module for dealing with torrent files and magnet URIs.

I'd like to add the ability to create torrent files from magnet URIs. I've been looking for something that makes this as straight-forward as possible and magnet2torrent seems to be the best solution by far. It's also the only one that looks active.

What really bugs me, though, is that it comes with a CLI tool. I don't want to pull in unnecessary executables with my dependencies, especially if I'm developing a module for developers, not for users.

So my question is if you would consider splitting magent2torrent into two separate projects, one for developers and one for users?

I could give it a try if you want. It looks like all the CLI stuff is in main.py so it should be easy enough.

JohnDoee commented 4 years ago

I'm using it as a library myself which is why it's all in main. The stuff in main is basically usage of its own library.

I do understand not wanting the magnet2torrent command installed but I am unable to find any projects that actually splits this up in any way so you can skip the cli. Something like magnet2torrent[nocli] might be possible though.

rndusr commented 4 years ago

I don't think "magnet2torrent[nocli]" can work. "nocli" means "also install the packages defined by the handle 'nocli'". You would have to make a weird "magnet2torrent-nocli" package that somehow removes the CLI parts from the "magnet2torrent" package.

https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies

I just made two projects: torf and torf-cli. I can pull in as many dependencies and add fancy features in torf-cli without bloating torf. It's a little bit more work, but it's worth it in my opinion.