from shapely.geometry import MultiPolygon, Polygon, LineString
Polygon
square=Polygon(((4, 4), (50, 4), (50, 61), (4, 60)))
square
Polygon with holes
square_with_hole = Polygon([(4, 4), (50, 4), (50, 61), (4, 61)], [[(5, 10), (8, 40), (14, 30.02)],[(13, 6), (15, 8), (19, 9)]])
square_with_hole
line
line = LineString([(2, 22), (50, 50)])
Intersect line and face
line.intersection(square_with_hole)
Polygon boundary
square_with_hole.boundary
Line intersects with polygon boundary
line.intersection(square_with_hole.boundary)