The only package this thing needs is this one called typer
(same as argparse) just it makes passing arguments to variables easier.
pip install -U typer
To run the script it's fairly easy, you just need to run python main.py
in your terminal (you should be in the root of the url-cleaner
directory) e.g. cd url-cleaner
.
Then it only accepts two arguments:
-
- Path to the CSV you want to read in.
-
- The name of the URL column that you want to tidy up.
python main.py data/social-media.csv link
Alternatively, you can use it in your regular python code with the following:
cleaner = URLCleaner(
df=df,
url_col='link'
)
data_df = cleaner.main()
data_df.head(5)
Otherwise, that should be it!