% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{setup_python_env}
\alias{setup_python_env}
\title{Setup Python Environment}
\usage{
setup_python_env(envname = "textanalysisr-env", tier = "core", force = FALSE)
}
\arguments{
\item{envname}{Character string name for the virtual environment
(default: "textanalysisr-env")}

\item{tier}{Which feature tier to install. One or more of:
\code{"core"} (spacy + pdfplumber, ~200 MB; default),
\code{"embeddings"} (adds sentence-transformers + transformers + torch, ~1 GB),
\code{"topics"} (adds BERTopic + UMAP + HDBSCAN, ~300 MB on top of embeddings).}

\item{force}{Logical, whether to recreate environment if it exists
(default: FALSE)}
}
\value{
Invisible TRUE if successful, stops with error message if failed
}
\description{
Sets up a tiered Python virtual environment.
}
\details{
Default \code{tier = "core"} keeps the install light -- spaCy NLP and PDF text
extraction only. Add \code{"embeddings"} for sentence-transformers-based
similarity/sentiment, and \code{"topics"} for BERTopic.

The virtual environment is isolated; system Python is not modified.
}
\examples{
if (interactive()) {
  setup_python_env()                              # core only (~200 MB)
  setup_python_env(tier = c("core", "embeddings"))  # +1 GB
  setup_python_env(tier = c("core", "embeddings", "topics"))  # full stack
}
}
