-
Notifications
You must be signed in to change notification settings - Fork 0
The .pdf format
Серафим edited this page Dec 31, 2020
·
7 revisions
Call the functions of this format:
import pulling.Pdf as pdf
pdf.function(arguments)
get_text( path ) is a function that returns text from a file as a list, where list elements are sentences in the file.
- path - the path to the desired file.
find_text( path, pattern_list ) - a function that returns matches from a file text as a dictionary, where the key is a search pattern and the value is a list of found matches.
-
path - is the path to the required file.
-
pattern_list - a list with templates, where each template is a separate list element.
import pulling.Pdf as pdf
path = 'path\file.pdf'
result_text = pdf.get_text(path)
print(result_text)
[ 'Hello World', 'It is the ItYaS' ]
found_text = pdf.find_text(path, [ 'ItYaS' ])
print(found_text)
{ 'ItYaS': [ 'It is the ItYaS' ] }