Skip to content

Commit 7d88a66

Browse files
authored
Document environment variables for PyThaiNLP
Added environment variables section with descriptions and statuses.
1 parent da0eeb7 commit 7d88a66

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,17 @@ To see the specific libraries included in each extra,
7272
please inspect the `[project.optional-dependencies]` section of
7373
[`pyproject.toml`](https://github.com/PyThaiNLP/pythainlp/blob/dev/pyproject.toml).
7474

75-
## Data directory
75+
## Environment variables
76+
77+
| Variable | Description | Status |
78+
|---|---|---|
79+
| `PYTHAINLP_DATA` | Path to the data directory (default: `~/pythainlp-data`). | Current |
80+
| `PYTHAINLP_DATA_DIR` | Legacy alias for `PYTHAINLP_DATA`. Emits a `DeprecationWarning`. Setting both raises `ValueError`. | Deprecated; use `PYTHAINLP_DATA` |
81+
| `PYTHAINLP_OFFLINE` | Set to `1` to disable automatic corpus downloads. Explicit `download()` calls still work. | Current |
82+
| `PYTHAINLP_READ_ONLY` | Set to `1` to enable read-only mode, which prevents implicit background writes to PyThaiNLP's internal data directory (corpus downloads, catalog updates, directory creation). Explicit user-initiated saves to user-specified paths are unaffected. | Current |
83+
| `PYTHAINLP_READ_MODE` | Legacy alias for `PYTHAINLP_READ_ONLY`. Emits a `DeprecationWarning`. Setting both raises `ValueError`. | Deprecated; use `PYTHAINLP_READ_ONLY` |
84+
85+
### Data directory
7686

7787
PyThaiNLP downloads data (see the data catalog `db.json` at
7888
[pythainlp-corpus](https://github.com/PyThaiNLP/pythainlp-corpus))
@@ -86,16 +96,6 @@ inside the function that will be distributed to worker nodes.
8696
See details in
8797
[the documentation](https://pythainlp.org/dev-docs/notes/installation.html).
8898

89-
## Environment variables
90-
91-
| Variable | Description | Status |
92-
|---|---|---|
93-
| `PYTHAINLP_DATA` | Path to the data directory (default: `~/pythainlp-data`). | Current |
94-
| `PYTHAINLP_DATA_DIR` | Legacy alias for `PYTHAINLP_DATA`. Emits a `DeprecationWarning`. Setting both raises `ValueError`. | Deprecated; use `PYTHAINLP_DATA` |
95-
| `PYTHAINLP_OFFLINE` | Set to `1` to disable automatic corpus downloads. Explicit `download()` calls still work. | Current |
96-
| `PYTHAINLP_READ_ONLY` | Set to `1` to enable read-only mode, which prevents implicit background writes to PyThaiNLP's internal data directory (corpus downloads, catalog updates, directory creation). Explicit user-initiated saves to user-specified paths are unaffected. | Current |
97-
| `PYTHAINLP_READ_MODE` | Legacy alias for `PYTHAINLP_READ_ONLY`. Emits a `DeprecationWarning`. Setting both raises `ValueError`. | Deprecated; use `PYTHAINLP_READ_ONLY` |
98-
9999
### Offline mode
100100

101101
Set `PYTHAINLP_OFFLINE=1` to disable **automatic** corpus downloads.

0 commit comments

Comments
 (0)