cs-image-system-gcs-state-plugin
The gcs state backend plugin: a Google Cloud Storage bucket
as a terraform state backend. It registers one model,
GcsStateBuilderModel, for entries with type: gcs under state_backends:
in cfg/state-*.yml. Like the S3 and local plugins it emits no files and
runs no commands of its own: a root that binds to it gets an empty
backend "gcs" {} block, a partial configuration file, and consumers reading
its state get a terraform_remote_state data source with the same settings.
Declaring the type binds nothing. The standing decision keeps every live
root -- the GCE roots included -- on the S3 backend; the family's fixture
declares a gcs backend as its default and binds its GCE roots to it, so
the type loads, renders and is bound, and the golden carries what a bound
root emits.
Installing
This package is one of the Google Cloud family's three distributions,
which release together under one number. An operator installs the family
through the system's gcloud extra:
uv tool install 'cs-image-system[gcloud]'
The system's operations guide says which extra carries which provider: OPERATIONS.md, "Installing a release".
What it registers
[project.entry-points."cs_image_system.plugins.state"]
gcs_state_plugin = "cs_image_system.gcs_state_plugin.main:initialize"
initialize() in main.py
returns a GcsStateTypes metadata object (plugin metadata version 1,
Python 3.13) that pairs the model with its builder. The package depends
on cs-image-system-contract and cs-image-system-base at its own
version, and on pydantic (pyproject.toml); the
collector the kind renders for lives in cs-image-system-hashicorp-utils,
which the base reaches on its own and the plugin neither declares nor
imports.
Service name (type: of a backend entry) |
Model class | Builder class | Classifications (VCT) |
|---|---|---|---|
gcs |
GcsStateBuilderModel |
GcsStateBuilder |
STATE_BACKEND_MODEL, STATE_BACKEND |
The model
GcsStateBuilderModel in
gcs_state_models.py
extends StateBuilderModel
(state_builder.py),
which adds nothing over BuilderModel
(builder_model.py)
except the classification. A state backend has no runtime field. Every
field, with its type and default, is in the configuration reference below.
GcsStateBuilder in
gcs_state_builder.py
extends StateBuilderBase and implements no hooks: it exists so the
registry can pair the model with a builder class.
The kind
GcsBackendKind in
gcs_state_models.py
renders the type for the collector (the contract the S3 plugin's README
describes under "Adding a backend type"). OpenTofu's gcs backend stores a
root's state as <prefix>/<terraform workspace>.tfstate, and the terraform
workspace is default for every root this system emits, so the root's own
prefix is the declared prefix with the root's safe name appended -- two
roots never share an object:
location(settings, workspace) |
backend_settings(...) |
remote_state_settings(...) |
|---|---|---|
gcs://<bucket>/<prefix>/<super_safe_name(workspace)>/default.tfstate |
bucket, prefix = "<prefix>/<root>", then credentials, impersonate_service_account, encryption_key, kms_encryption_key when set |
bucket, prefix, then credentials and impersonate_service_account when set |
super_safe_name lowercases the root's name and turns -, ., :, +,
/, \, @ and spaces into _, so the root gcp-pd under the declared
prefix statefiles/csia keeps its state at
gcs://csis-sandbox-tfstate/statefiles/csia/gcp_pd/default.tfstate, and
its partial configuration file reads:
# Backend 'gcs-east1' (gcs) partial configuration for workspace gcp-pd
bucket = "csis-sandbox-tfstate"
prefix = "statefiles/csia/gcp_pd"
The root's prefix is normalised before it is rendered or compared
(repeated slashes collapsed, leading and trailing ones stripped, case
kept), so //a//b/ and a/b are one place. An empty declared prefix puts
every root directly under the bucket (gcs://<bucket>/<root>/default.tfstate).
Example configuration
cfg/state-backends.yml in the
fixture, its gcs entry, declared as the default backend:
---
state_backends:
- name: gcs-east1
type: gcs
bucket: csis-sandbox-tfstate
prefix: statefiles/csia
is_default: true
The live configuration carries the same file with every line commented out: a placeholder for the day the GCE roots move, which is a decision, not a declaration. A file of comments loads as no declaration at all (tests/pipeline/test_state_locations_gce.py proves both shapes).
A root binds with state_configuration: gcs-east1 on the builder
(or on its runtime, so that everything on that runtime keeps its state
there); the fixture's GCE builders name it, and no live root does.
Prerequisites and integration
Everything below is what a root BOUND to a gcs backend needs; a declared
and unbound backend needs nothing beyond the core, and a dry run never
reaches the bucket.
- The core, and the gate.
cs-image-system-contractandcs-image-system-base, each pinned as WRITING_A_PROVIDER.md describes: each by the range of its compatible series (the package's declared dependencies), withcs-image-system-hashicorp-utilsinstalled beside them for the collector. The whole state-backend mechanism is gated byconfig.use_state_backendsincfg/_config.yml: when it is false or absent, nothing this plugin registers is rendered, recorded or checked (the collector answers "no backend" for every workspace), and none of what follows applies. Off is itself refused byvalidatewhen any root would read another's outputs through remote state, so it is a shape only for a tree where nothing reads anything. - A bucket that exists. The system creates no state bucket: the
bucketfield names one the operator made beforehand, in a project the identity below can write to. Nothing in the system checks that it exists; the first realtofu init -backend-config=...against it does, and refuses with tofu's own message when it does not. - A Google identity for tofu. This plugin reads no environment
variable and no credential file. It passes three declarations through
to tofu, in the root's
.tfbackend.hcland in every consumer'sterraform_remote_statedata source:credentials(a PATH to a credentials file -- the emission is committed, so never a value),impersonate_service_account(the service account tofu impersonates), or neither, in which case OpenTofu'sgcsbackend finds its identity the way OpenTofu documents (Application Default Credentials, or its ownGOOGLE_*backend variables in the environment of whoever runsinit/plan/apply). The live convention for GCE is ADC obtained bygcloud auth application-default login --impersonate-service-account=csis-runner@<project>.iam.gserviceaccount.com(docs/OPERATIONS.md, "Credentials contract").preflight,state queryand every run report whether ADC exist (GOOGLE_APPLICATION_CREDENTIALS, else~/.config/gcloud/application_default_credentials.json) as onesession:line, for this backend as well as for the GCE runtimes: the builder'ssession_statushook reaches the gcloud runtime plugin's reading by its type key (gcloud) in the run's runtime builder classes, which the preflight hands a state builder as the hook's third argument (runtime_classes; the kit'sStateBuilderBaseadds it to the contract's two), importing nothing of that package, so a tree with the backend alone is preflighted too. When that plugin is not installed (or the hook is called with the contract's two arguments alone) the backend's line is present and NOT JUDGED, and says so. - Encryption keys, when declared.
encryption_key(a customer-supplied key) andkms_encryption_key(a Cloud KMS key name) are written verbatim into the root's.tfbackend.hclwhen set. That file is part of the committed emission, so a raw encryption key does not belong in the field: leave it unset and supply it through tofu's environment, or name a KMS key (a name, not a secret). - The tofu binary. The consumer root's, not this plugin's: a root's
executablenames an entry ofcfg/executables.yml(the fixture'sopen-tofu-1, typetofu,>1,<2), and that entry is whatvalidateand every run check. The model's ownexecutablefield is a checked declaration as well: unset by default, and when set it must name an entry ofcfg/executables.yml, which is then version-checked like every entry. It does not choose the binary a root runs; see the reference below. - Network. Whoever runs a real
init,planorapplymust reach Google Cloud Storage. A dry run initialises withinit -backend=falseand never touches the bucket, so CI's dry records, an operator's preview andvalidateneed no reachability at all. - An AWS session, today. Not for this plugin -- but because every live root, the GCE roots included, keeps its state on the S3 backend, any GCE lifecycle still needs a live AWS session until the move is decided.
Configuration reference
An entry under state_backends: in any cfg/state-*.yml (the fixture's
is cfg/state-backends.yml) with type: gcs. Unknown keys are refused at load
by pydantic (naming the key); a parameters: key is refused with a message
naming variables:. Field names are exact: type in YAML is the model's
type_.
| Field | Type | Default | Meaning |
|---|---|---|---|
name |
str | required | what a root's or runtime's state_configuration names; normalised (lowercase, spaces to _); / and \ are refused, and so are the reserved words default, self, none, the empty name and null, in any case |
type |
str | required | gcs; also the terraform backend type written into consumers' backend "gcs" {} block |
description |
str or null | null | free text; not read |
aliases |
set[str] | {} |
other names the backend answers to: they travel on the BackendRegistration, and resolve_backend tries the backend names first and then every backend's aliases, so a root's or runtime's state_configuration may name an alias and validate accepts it |
is_default |
bool | false |
the backend default resolves to (a root that names none, whose runtime names none); more than one default across all backend types is refused when anything resolves it |
bucket |
str | required, non-empty | the state bucket; whitespace is trimmed |
prefix |
str | statefiles |
the prefix inside the bucket; leading and trailing / and whitespace are trimmed; each root gets <prefix>/<root safe name> beneath it; may be empty, must be a string (null is refused) |
credentials |
str or null | null | a PATH to a credentials file, never a value; written as-is into the backend file and every consumer's data source when set |
impersonate_service_account |
str or null | null | the service account tofu impersonates; written into the backend file and every consumer's data source when set |
encryption_key |
str or null | null | a customer-supplied encryption key; written into the backend file (never a data source) when set -- in clear when declared in clear, as its ENC[age:...] ciphertext when declared encrypted (see Variations) |
kms_encryption_key |
str or null | null | a Cloud KMS key name; written into the backend file only, when set |
executable |
str or null | null | the cfg/executables.yml entry the tofu for the roots on this backend comes from. Unset: nothing is checked on the backend's behalf. Declared: validate and every run refuse a name that is not an entry of cfg/executables.yml (check_state_backend_executables in validate.py), and the entry is version-checked like every executables entry. This plugin still runs no commands under it |
config |
mapping | {} |
accepted, not read |
gitignore |
list[str] | [] |
accepted, not read |
tags |
mapping[str, str] | {} |
accepted, not read |
There is no required_plugins field: the gcs backend is built into
OpenTofu, so there are no plugins to declare. Declaring it is an
unknown-key refusal at load; delete the key.
What reaches the emission is exactly what to_backend_registration()
registers: bucket, prefix, credentials, impersonate_service_account,
encryption_key, kms_encryption_key, plus name, type, is_default
and aliases on the registration itself. executable is
read by validate, not by the plugin. Two other declarations, owned by
other plugins, decide whether any of it is used:
| Declared where | Field | Effect on this plugin |
|---|---|---|
cfg/_config.yml |
config.use_state_backends (bool, default false) |
off: no backend block, no .tfbackend.hcl, no remote-state data source, no location record, no location check -- the declaration is validated at load and then ignored |
| an instance, storage or identity builder; a runtime builder | state_configuration (default default) |
the binding: the root's own value when it names a backend, else its runtime's, else the single is_default backend; gcs-east1 binds a root here |
Variations
- Bound or unbound. When a root's
state_configuration(or its runtime's, or the default) resolves to agcsentry, the root gets the emptybackend "gcs" {}block, the.tfbackend.hclabove, aninit -reconfigure -backend-config=<file>on real runs, a# state: workspace <root> -> gcs://...line in its lifecycle's runner header, and a record inmeta-state/state-locations.yaml; every consumer that reads the root's outputs gets adata "terraform_remote_state"withbackend = "gcs"and theremote_state_settingsabove. When no root resolves to it the entry is loaded, validated and registered, and nothing else happens. The fixture's GCE roots resolve to it, so the golden carries theirgcsfiles. use_state_backendson or off. Off, the plugin's registration is inert:validateskips the location rules, no file or record names the bucket, andinitruns bare.- Dry run or real run. A dry run's generation-time init is
init -backend=false: providers are installed and the emission is validated, and the bucket is never contacted (there is no state to read, and nothing after it needs one). A real run's generation-time init and the committed runner script's own init areinit -input=false -reconfigure -backend-config=<root>-<phase>.tfbackend.hcl(the bare file name; tofu runs inside the phase directory). Both forms record the root's location in meta-state; the record is not a claim of reality, only of resolution. - Identity declared or not. With
credentialsand/orimpersonate_service_accountset, both the backend file and every consumer's data source carry them, so a consumer reads the producer's state with the same identity the producer wrote it with. With neither, the files carrybucketandprefixalone and tofu resolves the identity from its own environment. - Encryption keys declared or not.
encryption_keyandkms_encryption_keygo into the backend file only; a remote-state data source never carries them (the test tests/test_gcs_backend.py pins this). Set neither and the objects are stored with the bucket's own settings. - Declared prefix empty or set. Empty (
prefix: ""), a root's object isgcs://<bucket>/<root>/default.tfstate; set, it is<prefix>/<root>/default.tfstate. Either way no two roots share an object, because the root's own safe name is always a segment. - Encrypted or clear values. Any value in the tree may be an
ENC[age:...]marker and decrypts at load. The partial configuration file (.tfbackend.hcl) writes such a setting as the ciphertext it was read from:render_backend_valuein collector.py callsemit, and execution's materialise step puts the plaintext back in the_private/copy tofu runs from. So anencryption_keydeclared encrypted is committed as ciphertext in the backend file. That covers the backend file only. The kind registers nothing as sensitive, and the other places the settings reach -- the consumers' data sources (bucket,prefix,credentials,impersonate_service_account), the runner header's location line, and thestate-locations.yamlrecord (which repeats the backend-file settings) -- write the value as read; wherever one of them would carry a plaintext, the plaintext guard refuses the write or the commit, naming the file and line. So the safe practice: keep these values public (the bucket name is public by decision) or out of the tree (a key in tofu's environment).nameandtypemay not be markers at all. --migrate-state <root>. A root moving onto or off agcsbackend goes through the migration operation like any other: the record of the previous location (backend,type,locationand the settings above) is whatstate-migration beginwrites back as<root>.tfbackend.previous.hcl; the kind renders it, the operation is type-agnostic. No such move has been made.- Fixture or live tree. The fixture declares
gcs-east1as its default backend and binds its GCE roots to it (so the type is loaded, registered, rendered and bound in every test run); the live tree carries the same declaration entirely commented out, which loads as nothing. The live tree's CI therefore never sees agcsregistration.
What it tests and verifies
- At load (pydantic, then
__post_init__).bucketpresent and non-empty after trimming;prefixa string (trimmed of/and whitespace); unknown keys andparameters:refused;namefree of/and\and not a reserved word (default,self,none, empty; refused where the file is read, naming it). A failure is aValidationErrornaming the field, raised while the configuration loads, sovalidateand every run stop with exit 1 before anything is generated. Once the state backends are loaded the core hands the model'sto_backend_registration(), aBackendRegistration, to the collector; the same name registered twice with different settings is anHclConfigConflictError(State backend '<name>' registered twice with different configurations). - At
validate, and again at the start of every run (gated byuse_state_backends;check_state_locationsin validate.py): every terraform root's backend is resolved through the chain from the declarations alone (by name, or by one of a backend'saliases); a root naming an undeclared backend, a prefix whose rendered key carries a.or..segment, more than oneis_default, two roots that would share one object (same bucket and normalised prefix under two names, or two root names that collapse undersuper_safe_name), and a root whose resolved location differs from the one recorded inmeta-state/state-locations.yamlwhile the records show live resources in it, are each one line in the validation errors; exit 1, nothing generated. A root with nothing deployed moves with one INFO line. Note the timing of the..rule: the model acceptsprefix: a/../bat load, and the refusal comes when a location is asked for. - At generation. The collector's
validate_for(<workspace>)(the constraints on the providers that workspace declares, plus the collision rule) runs before every terraform block, provider block, variable block and remote-state data source is rendered; a conflict is anHclConfigConflictErrorand the run fails. Each bound root's location is written tometa-state/state-locations.yaml(backend,type,location, the backend-file settings,run) and named in the runner header. The GCS type's tests here are the four in tests/test_gcs_backend.py (the per-root prefix and its normalisation, identity as a path or an impersonation never a value, the model's trimming and registration, and agcslocation as a kind of place of its own beside the core'slocalin the collision rule) and the family's fixture-level test in tests/pipeline/test_state_locations_gce.py (in the family's fixture: the default backend, bound to every GCE root; its commented twin loads as nothing). The system's tests/test_state_encryption.py requires every declared and emitteds3backend to encrypt and countss3andlocalfiles; it asks nothing ofgcs, and the shared golden carries nogcsfile. - At apply. Nothing of its own. The plugin runs no command; whether
the bucket exists, is reachable and is writable by the identity is
established by tofu's
initagainst the backend file, and its verdict is tofu's output in the run log (and a non-zero exit for the lifecycle). - After apply (post-finalize hooks) and in the state query. Nothing. The state query asks runtimes and identity providers, never a state backend; the location record is the only memory of where a root's state was resolved to, and it is compared, not verified against the bucket.
- Executable versions. When the entry declares
executable,check_state_backend_executablesin validate.py requires it to name an entry ofcfg/executables.yml, atvalidateand at the head of every run, and the tool-version checks version-check that entry with the others. Unset, nothing is checked.
When it fails
Incidents that have happened, with their cause and fix, are recorded on INCIDENTS.md; what follows keeps each failure's symptom, its meaning and what to do.
No live root is bound to a gcs backend (only the fixture's are), so
what follows is what the code raises, in the order an operator would
meet it: the symptom, what it means, and what to do.
1 validation error for GcsStateBuilderModel / bucket / Field requiredorTerraform state backend 'bucket' cannot be empty for 'gcs' type.-- the entry lacks a bucket, or it is blank. Raised at load (the log names the file's plugin key and the item that failed to structure); exit 1. Add the bucket.prefix / Input should be a valid string--prefix: nullor a non-string. The field is a string; omit it for the defaultstatefilesor write""for none.<key> / Unexpected keyword argument(or pydantic's extra-input refusal naming the key) -- a field this model does not have, a typo (impersonate_service_acount), an S3 field (key,region,profile) on agcsentry, orrequired_plugins(not a field: the backend is built into OpenTofu). Remove or rename it; the table above is the whole set.<name>:parameterswas retired ...-- delete the key.Name '<name>' contains invalid characters/Name cannot be in '['default', None, '', 'self']'-- rename the backend.state backend type 'gcs' is registered by no installed plugin: install the extra: uv tool install 'cs-image-system[gcloud]'(one line underValidation failed with 1 error(s).) -- the plugin is not installed in the environment that loaded the tree: it comes with the umbrella's[gcloud]extra, never with the bare install (it is a workspace member here, so this means a foreign or partial install).State backend '<name>' registered twice with different configurations-- two files declare the same name with different settings (an uncommented livestate-gcm.ymlbeside a second copy, for instance). Keep one.workspace '<root>' names state backend '<name>', which is not declared-- a root's or runtime'sstate_configurationnames a backend no file declares, by name or by alias; the live tree'sgcs-east1is commented out, so binding a live root to it fails exactly here. Declare it, or change the binding. Exit 1 fromvalidateor the run.Executable <x> specified for state backend <name> not found in executables list.-- the entry'sexecutablenames nothing incfg/executables.yml. Fix the spelling, declare the entry, or remove the key (unset means unchecked). Exit 1 fromvalidateor the run.workspace '<root>': state key '<prefix>/<root>' carries a '..' segment-- the declared prefix contains.or... Write a plain prefix.Multiple default state backends registered: [...]-- two backends, of any types, carryis_default: true. Keep one.state location collision: workspaces <a>, <b> would share the state object gcs://<bucket>/<prefix>/<name>/default.tfstate-- two root names that collapse undersuper_safe_name(Gcp-PDandgcp_pd) on onegcsbackend, or twogcsbackends naming the same bucket and prefix bound to same-named roots. The same bucket name unders3and undergcsis two places, not a collision. Rename a root or separate the prefixes.workspace '<root>' would move its state from <old> to gcs://... while <resources> stand(s) in it: the new location is empty, so the next plan would create everything again and strand the old state. To MOVE the state: run --no-dry-run ... --migrate-state <root> ...-- the guard that makes moving the GCE roots onto agcsbackend an operation. The record ismeta-state/state-locations.yaml; the way through is the migration operation (docs/OPERATIONS.md, "Where state lives"), never a rebinding. A root with nothing deployed logsmoves its state from ... nothing is deployed from itand proceeds.State backend '<name>' (type 'gcs') was registered without a kind-- cannot happen through this model (it always registersGCS_KIND); it would mean a hand-builtBackendRegistrationin a test.- tofu refuses at
init-- the bucket does not exist, the identity cannot read or write it,credentialsnames a file that is not there where tofu runs (the real run's commands execute in the_private/mirror besidegenerated/, so give an absolute path), or the network is not there. The message is tofu's, in the run log under the root's init, and the lifecycle exits non-zero; the plugin makes no claim of its own. Only a real run gets here; a dry run's init is-backend=false. meta-state/<file>: <line>from the plaintext guard, or a refused commit -- a backend field was declared as anENC[age:...]value and its plaintext now stands in a record or in a part of the emission that does not write ciphertext. The.tfbackend.hclitself carries the ciphertext, so the backend file is never where the plaintext stands; the data sources, the runner header and the location record write the value as read (see Variations). Look at the file and line the guard names, then write the value in clear or move it out of the tree.
Related
- tf-s3-state-plugin: the S3 type, and the recipe for adding a type.
- local-state-plugin: the type that needs nothing.
- contract state.py:
BackendRegistration,StateLocationand theBackendKindProtocolthis plugin's kind implements. - hashicorp-utils collector.py:
TerraformCollector, to which the core hands the registrations at load. - The family's docs/CONFIGURATION.md
(the
gcsfields), the system's docs/CONFIGURATION.md section 10 and docs/OPERATIONS.md "Where state lives".
Metadata
Release files for cs-image-system-gcs-state-plugin 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cs_image_system_gcs_state_plugin-0.2.1.tar.gz | 27.6 kB | Without provenance | Details for cs_image_system_gcs_state_plugin-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cs_image_system_gcs_state_plugin-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for cs_image_system_gcs_state_plugin-0.2.1-py3-none-any.whl |
Total release size: 47.6 kB
Release files / cs_image_system_gcs_state_plugin-0.2.1.tar.gz
| Download URL | cs_image_system_gcs_state_plugin-0.2.1.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83fb155ba1984ddb6da68d26dc21196ae7638393376c6f5bf22c906a97d492c2
|
|
BLAKE2b-256 checksum How to use checksums |
2fe5fd042ac7d893081244a8d8751b547709ce4674312ea0478c276fc5817d47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cs_image_system_gcs_state_plugin-0.2.1-py3-none-any.whl
| Download URL | cs_image_system_gcs_state_plugin-0.2.1-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd39c5f8d04a25cb640e9b34cc76f083ee01b5595311fb5c00cacb8245fccbf2
|
|
BLAKE2b-256 checksum How to use checksums |
11d4f13a0cfea8156d6b63d5a0d4c99a614c9576a6104c092dd84f76ef8cc4a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for cs-image-system-gcs-state-plugin 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.