8080labs / pyforest

pyforest - feel the bliss of automated imports
https://8080labs.com
MIT License
1.09k stars 196 forks source link

pyforest - feel the bliss of automated imports

From the makers of bamboolib

Writing the same imports over and over again is below your capacity. Let pyforest do the job for you.

With pyforest you can use all your favorite Python libraries without importing them before. If you use a package that is not imported yet, pyforest imports the package for you and adds the code to the first Jupyter cell. If you don't use a library, it won't be imported.

Demo in Jupyter Notebook

demo

Scenario

You are a Data Scientist who works with Python. Every day you start multiple new Jupyter notebooks because you want to explore some data or validate a hypothesis.

During your work, you use many different libraries like pandas, matplotlib, seaborn, numpy or sklearn. However, before you can start with the actual work, you always need to import your libraries.

There are several problems with this. Admittedly, they are small but they add up over time.

What if you could just focus on using the libraries?

pyforest offers the following solution:

Using pyforest

After you installed pyforest and its Jupyter extension, you can use your favorite Python Data Science commands like you normally would - just without writing imports.

For example, if you want to read a CSV with pandas:

df = pd.read_csv("titanic.csv")

pyforest will automatically import pandas for you and add the import statement to the first cell:

import pandas as pd

Which libraries are available?

In order to gather all the most important names, we need your help. Please open a pull request and add the imports that we are still missing.

Installation

You need Python 3.6 or above because we love f-strings.

From the terminal (or Anaconda prompt in Windows), enter:

pip install --upgrade pyforest
python -m pyforest install_extensions

Please make sure to restart any running Jupyter server so that the javascript extension can be loaded properly.

Also, please note that this will add pyforest to your IPython default startup settings. If you do not want this, you can disable the auto_import as described in the FAQs below.

Frequently Asked Questions

Contributing

If you'd like to contribute, a great place to look is the issues marked with help-wanted.

In order to gather all the most important names, we need your help. Please open a pull request and add the imports that we are still missing to the pyforest imports. You can also find the guidelines in the pyforest imports file

About

pyforest is developed by 8080 Labs. Our goal is to make Python Data Scientists 10x faster. If you like the speedup to your workflow, you might also be interested in our other project bamboolib