Installation and setup
The open-source unstructured library comes from PyPI, with an extra for each file format. It runs locally and needs no API key.
pip install with format extras
The base package reads plain text, HTML, XML, JSON and email. Everything else is an extra, named after the format it adds. These seven extras cover the six handbook documents and a few more; the version is pinned because a different version prints different results.
pip install "unstructured[csv,docx,md,msg,pptx,tsv,xlsx]==0.27.6"from importlib.metadata import version
print(version("unstructured"))The first time you run the library it may download a small English language model for spaCy, about twelve megabytes, which it uses to decide whether a piece of text is a sentence or a heading. Lesson 12 shows which formats this install can read, and lesson 13 covers the PDF and image extra this course skips.
No key for the library
Partitioning, cleaning and chunking all run in your own process, so the course needs no account and no key. The hosted Unstructured platform, covered in lesson 27, has its own API key and different arguments.
- Run
pip show unstructuredand read the version and location.
Little by little, you're building something great.