This commit is contained in:
16
docs/snippets/python/getting-started/extract_file.md
Normal file
16
docs/snippets/python/getting-started/extract_file.md
Normal file
@@ -0,0 +1,16 @@
|
||||
```python title="Python"
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from kreuzberg import extract_file
|
||||
|
||||
async def main() -> None:
|
||||
file_path: Path = Path("document.pdf")
|
||||
|
||||
result = await extract_file(file_path)
|
||||
|
||||
print(f"Content: {result.content}")
|
||||
print(f"Format: {result.metadata.format.format_type if result.metadata.format else None}")
|
||||
print(f"Tables: {len(result.tables)}")
|
||||
|
||||
asyncio.run(main())
|
||||
```
|
||||
Reference in New Issue
Block a user