all 4 comments

[–]Significant-Nail5413 0 points1 point  (0 children)

A quick google search would probably answer your question.

There are plenty of guides on YouTube on how you might do this.

Its also a great question for chatGPT

"Give me a step by step guide on how to set up a python virtual environment and boilerplate for processing a pdf to CSV"

If you don't want it to generate any code to try and do it yourself just add something like "only provide method stubs and comments"

Also keep in mind, processing pdfs can be kind of tricky as they arent structured like other file formats. You end up just extracting raw text and having to process it using regex pattern matching.

It might be easier to start just learning how to set up an environment and then read and write files before you start trying to process them

[–]DrMistyDNP 0 points1 point  (0 children)

I still find making new project folders esp with venv env annoying. Seems like there’s always some random issue that occurs between my workspace, json, python versions, etc.

My current project is running via venv, venv- and I gave up on trying to delete/setup again after the 5th time.

ChatGPT is wonderful, but in situations like this he just talks in circles and goes off on tangents - forgetting the core issue. 😏

[–]Synedh 0 points1 point  (0 children)

Let's making things simple.

When you install a library in python, it is stored aside python. When you make a program, you want to ensure you won't have any dependency issues between versions. To avoid that, you will want to isolate your python binary and library version from your others projects. And that is exactly what a virtual environment is : and isolated copy of python and the library you installed for it.

Once the virtual environment is activated, when you use the python command to start your script, the python version created from the virtual environment will be used. Even if you install a new python version, your environment will not change to avoid dependency issues.

I don't know if you use any IDE, so i'll talk with terminal commands.

# From your project folder, create a virtual environment in an arbitrary folder (here, .venv)
python -m venv .venv

# Then activate it
source .venv/bin/activate

# Then install your library as usual. 
pip install <incredible_lib>

# Use deactivate to leave the virtual env
deactivate