Extracting data from PDF files using Python

Опубликовано: 11 Февраль 2022
на канале: YUNIKARN
45k
574

【Online Courses】
Getting Started with Stata: (24 lectures + 4 assignments = 5.5 hours content): available on Udemy:

Applied Time Series using Stata (29 lectures + 4 assignments = 6.5 hours content): available on Udemy:

This is a detailed step-by-step guide that develops a Python code to extract information from PDF files. This is very useful if you have to handle a large number of files. The Python code returns the number of all search term occurrences in the document and identifies the page numbers. All material including the code is on GitHub

I introduce the PyPDF2 package, which we need to install.

Installation on Anaconda:
conda install -c conda-forge pypdf2

Installation using the pip installer:
pip install PyPDF2

I show you how to create and activate a virtual environment (which is optional – but useful to do). Then we develop the code step-by-step. This will enable you to learn how to modify the code to suit your specific requirements. Please leave a comment if you have any questions.

Finally, we will refactor the code. We define a function that takes a search term and filename and returns a tuple containing the total number of occurrences and the number of pages that contain the search term at least once.

*Chapters*
0:00 Welcome
0:15 Return all occurrences & page numbers
0:44 Example PDF
2:23 Python setup
3:55 Virtual environment
6:16 Coding fun
28:05 Refactoring

*The channel*
YUNIKARN focuses on publishing educational content in applied statistics, mathematics, and data science. In these fields, programming skills have become essential. Hence, we cover various programming languages including Python, Stata, and C++ to tackle problems and for fun.

*Stay in touch*
Please leave comments or follow us on Twitter ( DMs are open.

*Hashtags*


Смотрите видео Extracting data from PDF files using Python онлайн без регистрации, длительностью 35 минут 35 секунд в хорошем hd качестве. Это видео добавил пользователь YUNIKARN 11 Февраль 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 45 тысяч раз и оно понравилось 574 людям.