Prerequisites: a client and a shape that
exists in your project to extract through. List shapes with
pb.shapes.list().Register the source
Register the material so it can be extracted. The returned id is what you
extract and read against.
Extract through a shape (staged)
Extraction coerces the source into entities and relationships that match the
shape. Stage it with The same source can be extracted through different shapes to surface
different structure. The shape is the lens you read the material with.
apply: false so you can review before it lands.Review the delta
Extraction stages a delta. Plan it to see what
applying it would add to the graph.
What you have now
The document is no longer opaque text. It is typed entities in a governed graph, each tracing back to the source it came from. You can search them, check whether they are fit to act on, and project them out to other formats.Sources reference
Every
pb.sources method.Semantic git
How staging, planning, applying, and reverting work.