From a5c96dcb87f72702e90b26ad3342e63216c914f2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 18:04:55 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/tox-dev/pyproject-fmt: v2.11.1 → v2.12.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.11.1...v2.12.1) - [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/25.12.0...26.1.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d31c53b..e21f150 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: check-added-large-files args: ['--maxkb=1024'] - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.11.1 + rev: v2.12.1 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject @@ -35,7 +35,7 @@ repos: entry: isort --profile=black name: isort (python) - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.12.0 + rev: 26.1.0 hooks: - id: black - repo: https://github.com/adamchainz/blacken-docs From 0333971b025fdd46e8ea0e39c5c1ae30ebb9b8f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 18:05:17 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/save-data/sqlite/create_data.py | 6 ++-- docs/save-data/sqlite/create_db.py | 6 ++-- docs/save-data/sqlite/normalise.py | 42 ++++++++--------------- docs/save-data/sqlite/query_normalised.py | 6 ++-- docs/save-data/sqlite/test_sqlite.py | 12 +++---- 5 files changed, 24 insertions(+), 48 deletions(-) diff --git a/docs/save-data/sqlite/create_data.py b/docs/save-data/sqlite/create_data.py index 9167e20..8469d07 100644 --- a/docs/save-data/sqlite/create_data.py +++ b/docs/save-data/sqlite/create_data.py @@ -4,11 +4,9 @@ cursor = conn.cursor() # insert a record into the database -cursor.execute( - """INSERT INTO books +cursor.execute("""INSERT INTO books VALUES ('Python basics', 'en', 'Veit Schiele', 'BSD', - '2021-10-28')""" -) + '2021-10-28')""") # save data to database conn.commit() diff --git a/docs/save-data/sqlite/create_db.py b/docs/save-data/sqlite/create_db.py index 6353636..229470f 100644 --- a/docs/save-data/sqlite/create_db.py +++ b/docs/save-data/sqlite/create_db.py @@ -6,9 +6,7 @@ cursor = conn.cursor() # create books table -cursor.execute( - """CREATE TABLE books +cursor.execute("""CREATE TABLE books (title text, language text, author text, license text, release_date text) - """ -) + """) diff --git a/docs/save-data/sqlite/normalise.py b/docs/save-data/sqlite/normalise.py index 72ea100..dd08d15 100644 --- a/docs/save-data/sqlite/normalise.py +++ b/docs/save-data/sqlite/normalise.py @@ -3,24 +3,17 @@ conn = sqlite3.connect("library.db") cursor = conn.cursor() -cursor.execute( - """CREATE TABLE languages +cursor.execute("""CREATE TABLE languages (id INTEGER PRIMARY KEY AUTOINCREMENT, - language_code VARCHAR(2))""" -) + language_code VARCHAR(2))""") -cursor.execute( - """INSERT INTO languages (language_code) - VALUES ('de')""" -) +cursor.execute("""INSERT INTO languages (language_code) + VALUES ('de')""") -cursor.execute( - """INSERT INTO languages (language_code) - VALUES ('en')""" -) +cursor.execute("""INSERT INTO languages (language_code) + VALUES ('en')""") -cursor.execute( - """CREATE TABLE "temp" ( +cursor.execute("""CREATE TABLE "temp" ( "id" INTEGER, "title" TEXT, "language_code" INTEGER REFERENCES languages(id), @@ -29,25 +22,18 @@ "license" TEXT, "release_date" DATE, PRIMARY KEY("id" AUTOINCREMENT) - )""" -) + )""") -cursor.execute( - """INSERT INTO temp (title,language,author,license,release_date) - SELECT title,language,author,license,release_date FROM books""" -) +cursor.execute("""INSERT INTO temp (title,language,author,license,release_date) + SELECT title,language,author,license,release_date FROM books""") -cursor.execute( - """UPDATE temp +cursor.execute("""UPDATE temp SET language_code = 1 - WHERE language = 'de'""" -) + WHERE language = 'de'""") -cursor.execute( - """UPDATE temp +cursor.execute("""UPDATE temp SET language_code = 2 - WHERE language = 'en'""" -) + WHERE language = 'en'""") # Only SQLite ≥ 3.35.0 allows DROP COLUMN; # Only Python versions ≥ 3.8 released after 27 April 2021 will receive these or diff --git a/docs/save-data/sqlite/query_normalised.py b/docs/save-data/sqlite/query_normalised.py index aa0cb0c..c012fcf 100644 --- a/docs/save-data/sqlite/query_normalised.py +++ b/docs/save-data/sqlite/query_normalised.py @@ -6,10 +6,8 @@ def select_all_records_ordered_by_language_number(cursor): print("All books ordered by language id and title:") - for row in cursor.execute( - """SELECT language_code, author, title FROM books - ORDER BY language_code,title""" - ): + for row in cursor.execute("""SELECT language_code, author, title FROM books + ORDER BY language_code,title"""): print(row) diff --git a/docs/save-data/sqlite/test_sqlite.py b/docs/save-data/sqlite/test_sqlite.py index 1839245..c8d7030 100644 --- a/docs/save-data/sqlite/test_sqlite.py +++ b/docs/save-data/sqlite/test_sqlite.py @@ -19,18 +19,14 @@ def setUp(self): self.conn = sqlite3.connect(":memory:") cursor = self.conn.cursor() - cursor.execute( - """CREATE TABLE books + cursor.execute("""CREATE TABLE books (title text, language text, author text, license text, release_date text) - """ - ) + """) - cursor.execute( - """INSERT INTO books + cursor.execute("""INSERT INTO books VALUES ('Python basics', 'en', 'Veit Schiele', 'BSD', - '2021-10-28')""" - ) + '2021-10-28')""") def test_func_like(self): self.conn = sqlite3.connect(":memory:")