Skip to main content

Download and load spaCy models on-the-fly

A tiny drop-in replacement for spacy.load() that automatically downloads a model when it is not currently installed.

pip install spacy_download

Usage is identical to spacy.load(), meaning that you can also exclude or disable pipeline components. Example:

from spacy_download import load_spacy

# Will download the model if it isn't installed yet
nlp = load_spacy("en_core_web_sm", exclude=["parser", "tagger"])  

Under the hood, the package makes use of spaCy's capability to import models as modules, rather than using spaCy's built-in loader. This allows us to first download a model with pip and then load it as a module.

Note: if you are using transformer models, you still need to install spacy-transformers yourself!

WARNING: loading models on the fly can be useful, but it is not an officially supported feature. It should work fine with the official models at the time of writing, but I cannot guarantee that this will always be the case. Use at your own risk.

Metadata

Release files for spacy-download 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spacy-download 1.1.0
File Size Uploaded
spacy_download-1.1.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spacy-download 1.1.0
File Interpreter ABI Platform
spacy_download-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / spacy_download-1.1.0.tar.gz

Download URL spacy_download-1.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f87a6a5dad7b6dcdb9ae2e37a05f4aa9275a99db8ce019ce4af5661d4278d2d
BLAKE2b-256 checksum
How to use checksums
643f86e45af63cbde24ff05bb08d39e787da49a21828cb2518605b661a4d8ca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / spacy_download-1.1.0-py3-none-any.whl

Download URL spacy_download-1.1.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9981af7d59449faec1ca762b8c2fbb4227f978f6bf4cd8151fc698247dea7dad
BLAKE2b-256 checksum
How to use checksums
2ef0fd7478790171274fdb697a9d306981b59c9781d96aee3bb41368eeecd4db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page