kayjan / bigtree

Tree Implementation and Methods for Python, integrated with list, dictionary, pandas and polars DataFrame.

Home Page:https://bigtree.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bigtree without pandas

zink-chimaera opened this issue · comments

Is there a way to use bigtree without pandas now in the future?

This would help users that:

  • try to keep their dependencies to a minimum, or
  • Are switching away from pandas (e.g. to polars)

This could be done by hiding the pandas behind a feature flag or to have it as an optional import.

Making pandas an optional library has been raised as an issue previously, you can refer to the issue .

Is this on the roadmap? The other issue doesnt give a clear answer.

As far as I've seen @kayjan doesn't intend to.

I've hotfixed this for our use case but if you don't want to have pandas (e.g. because pyinstaller doesn't work with pandas) you need to switch to anytree (https://github.com/c0fec0de/anytree/)

@phil65

One of the main features of bigtree is the integration with Python lists, dictionaries, and pandas DataFrames. Under the hood, the methods are dependent on each other, for example creating tree from dictionary (dict_to_tree) converts it to pandas Dataframe and performs dataframe_to_tree. You can view the dependency graph here. Given the interdependency between methods and the popularity of pandas, I would prefer to leave it as a required library.

It´s fine, I´m just extracting the stuff I need then. But I´m sure having such a super heavy dependency will prohibit a lot of developers from using this package directly (as you can see from the requests popping up). I love pandas, but pandas is HEAVY (and will get even heavier soon by depending on pyarrow), and there should be a good reason to depend on it (which I dont see here).
Anyways, thank you for your efforts. It´s a nice library.

Update: Pandas is now an optional library in v0.12.0!

Thanks for all your support and suggestions in making bigtree better 😄