freeports_analysis.formats.utils_pdf_filter

Functions

filter_page_if(condition)

get_lines_with_font(blk, font)

Return all the line with a certain font in a tree

is_positioned(blk)

is_present_positioned(blk)

is_present_txt_font(blk, txt, font)

Return if a certain pdf block with a specific text and font is present in the tree

one_pdf_blk(_)

standard_header_font_filter(header_txt, ...)

Classes

one_PdfBlockType(*values)

freeports_analysis.formats.utils_pdf_filter.get_lines_with_font(blk: <module 'lxml.etree' from '/home/giuly/Desktop/Progetti/freeports-AMUNDI/venv/freeports-dev/lib/python3.13/site-packages/lxml/etree.cpython-313-x86_64-linux-gnu.so'>, font: str) so'>]

Return all the line with a certain font in a tree

Parameters:
  • blk (etree) – tree from which extract lines

  • font (str) – font to extract

Returns:

list of relevant blocks

Return type:

List[etree]

freeports_analysis.formats.utils_pdf_filter.is_present_txt_font(blk: <module 'lxml.etree' from '/home/giuly/Desktop/Progetti/freeports-AMUNDI/venv/freeports-dev/lib/python3.13/site-packages/lxml/etree.cpython-313-x86_64-linux-gnu.so'>, txt: str, font: str) bool

Return if a certain pdf block with a specific text and font is present in the tree

Parameters:
  • blk (etree) – tree to search in

  • txt (str) – text to search

  • font (str) – font to search

Returns:

boolean describing if the block is present or not

Return type:

bool

class freeports_analysis.formats.utils_pdf_filter.one_PdfBlockType(*values)