cclgroupltd / ccl_chromium_reader

(Sometimes partial) Python re-implementations of the technologies involved in reading various data sources in Chrome-esque applications.
MIT License
134 stars 34 forks source link

feat: restructure code as Python package 📦 #22

Closed lxndrblz closed 3 months ago

lxndrblz commented 8 months ago

Hello Alex,

in this PR I propose a slight refactoring of the project setup that allows to use the code as a Python module.

This has two main benefits:

  1. The library could be distributed through the Python Package Index (PyPi).
  2. Otherwise, it's possible to add your repo as a dependency to an existing project and simply update it whenever something changes in the CCL library.

For option 2, the git repo could simply be added as a dependency in the pyproject.toml:

dependencies = [
"chromedb @ git+https://github.com/cclgroupltd/ccl_chrome_indexeddb/@master",
]

Please let me know what you think.

cclgroupltd commented 8 months ago

Hi, thanks for this. Let me sit with this for a couple of days because I'm wondering if this is an opportunity to fix a "problem" with this module - i.e. the level_db support (and its dependencies) probably should live outside of what is otherwise a specifically Chrome focussed module, given that it is used much more widely than just Chrome.

My concern there is that might be a breaking change too far for folks who are already using the libraries in other projects (although this change will require at least some changes to other users' code I suppose).

As this is your PR, I'd welcome your views of course.

lxndrblz commented 8 months ago

@cclgroupltd That makes perfect sense.

The reason why I had proposed this change, was because I found it rather hard to integrate the repo in one of my projects, without copying the code. However, I also understand your point that it would inadvertently lead to some breaking changes for current users. Unfortunately, I don't have a solution for that problem yet, but I'll give it some thought.

cclgroupltd commented 3 months ago

@lxndrblz - just letting you know that I'm revisiting the idea of packaging this module. I'm going to start fresh as I'm doing it on a branch where I've added a bunch of additional functionality and resolving the conflicts is probably not worth the pain (I'm also aiming to put some module-level convenience functions), but I'll be referring to your work here and wanted to thank you for the effort you put in.