# Code / Python style - tabs, 3.11+, closed dependency list, streaming **Purpose + scope.** Baseline style and dependency policy for every Python file in this repository (pipeline tasks 01-11, query implementations, helper tools). Binding for all contributors. --- ## 1. Language and formatting - **Python 3.11+.** Use modern stdlib freely (`pathlib`, `dataclasses`, `tomllib` if needed); no compatibility shims for older versions. - **Indentation: TABS.** Set by the project owner and repeated in the specs (00_PLAN, 03, 09). Every Python file in this repository indents with tab characters, never spaces. Configure the editor per file type; do not "fix" tab-indented files to spaces. - `from __future__ import annotations` at the top of every module. - Type hints on public function signatures; internal helpers at author's discretion. - English for all identifiers, docstrings, and comments (see [meta-language-style.md](meta-language-style.md) - Russian is the conversation language, not the code language). - Comments follow [code-comments-policy.md](code-comments-policy.md): default to none, keep only non-obvious WHY. ## 2. Dependencies - a closed list The stdlib is the default. The ONLY permitted third-party packages: | Package | Used by | For | |---|---|---| | `numpy` | 03 | vectorized generation, seeded RNG | | `PyYAML` | 01, 03, 10, 11 | reading/writing the YAML configs | | `rdflib` | 04, 07 | JSON-LD validation, RDF serialization | | `oxigraph` | 07, 09 | embedded queryable triplestore | | `ijson` | 08, 09 | streaming JSON parsing | | `psycopg` (v3) | 06, 08, 09 | PostgreSQL COPY and queries | | `psutil` | 04-07, 09 | RSS / CPU / IO measurement; converters record their own peak RSS / CPU time into their `.done` markers for the task 10 sizing model | | `matplotlib` | 11 | report charts | | `pandas` | 08 (optional) | ONLY as the separately-measured second CSV query variant; never in the pipeline itself | Adding any other package requires updating this table first. In particular forbidden: ORMs, logging frameworks ([obs-python-logging.md](obs-python-logging.md)), CLI frameworks (argparse suffices), `requests`/HTTP clients (nothing to call). Task 03 (data generation) is stricter by spec: **stdlib + numpy only.** ## 3. Script shape - every task is a self-contained CLI - One entry script per pipeline task, runnable as `python