From 25d7e8fa16232ea0035351869b18f7a18f4ac03f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Apr 2026 13:00:16 +0000 Subject: [PATCH] release: bump version to 2.3.2 Fixes since v2.3.1: - fix: mask rank and PIB in lines with section numbering (20.1.2.1.) - fix: preserve trailing punctuation when extracting PIB words https://claude.ai/code/session_01KownKVoEBudRVp7npQ1idz --- .gitignore | 4 ++-- config_example.py | 8 ++++---- config_example.yaml | 6 +++--- data_masking.py | 6 +++--- diagnose_mapping.py | 2 +- docs/README.md | 4 ++-- modules/__init__.py | 2 +- modules/config.py | 4 ++-- modules/masking_logger.py | 4 ++-- modules/password_generator.py | 6 +++--- modules/re_mask.py | 8 ++++---- modules/security.py | 4 ++-- modules/selective.py | 4 ++-- modules/tools.py | 4 ++-- requirements.txt | 2 +- tests/test_case_preservation.py | 2 +- tests/test_diagnose.py | 2 +- tests/test_helpers.py | 2 +- tests/test_integration.py | 32 ++++++++++++++++---------------- tests/test_patronymic.py | 2 +- tests/test_rank_data.py | 2 +- tests/test_unmask.py | 2 +- unmask_data.py | 6 +++--- 23 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.gitignore b/.gitignore index 2e63760..24e300d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # ============================================================================= -# Data Masking System v2.3.0 - .gitignore +# Data Masking System v2.3.2 - .gitignore # ============================================================================= # ----------------------------------------------------------------------------- @@ -190,7 +190,7 @@ Desktop.ini .directory # ----------------------------------------------------------------------------- -# Data Masking System v2.3.0 - Специфічні файли +# Data Masking System v2.3.2 - Специфічні файли # ----------------------------------------------------------------------------- # Вхідні файли (опціонально) diff --git a/config_example.py b/config_example.py index 6bd45c0..77970d4 100644 --- a/config_example.py +++ b/config_example.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Configuration example for data_masking.py v2.3.1 +Configuration example for data_masking.py v2.3.2 Demonstrates all available configuration options using dataclasses. No external dependencies required — uses only Python standard library. @@ -9,7 +9,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 """ @@ -25,7 +25,7 @@ @dataclass class SystemConfig: """Системні налаштування.""" - version: str = "v2.3.1" + version: str = "v2.3.2" hash_algorithm: str = "blake2b" hash_digest_size: int = 8 encoding: str = "utf-8" @@ -172,7 +172,7 @@ def to_dict(self) -> dict: data = config.to_dict() print("=" * 70) - print(" Data Masking Configuration Example v2.3.1") + print(" Data Masking Configuration Example v2.3.2") print("=" * 70) for section_name, section_data in data.items(): diff --git a/config_example.yaml b/config_example.yaml index 3dc15cc..35b00a9 100644 --- a/config_example.yaml +++ b/config_example.yaml @@ -1,5 +1,5 @@ # ========================================================================== -# Приклад конфігурації для системи маскування даних v2.3.1 +# Приклад конфігурації для системи маскування даних v2.3.2 # # Скопіюйте цей файл як config.yaml та налаштуйте під свої потреби. # Згенерувати конфігурацію за замовчуванням: @@ -8,7 +8,7 @@ # Author: Vladyslav V. Prodan # Contact: github.com/click0 # Phone: +38(099)6053340 -# Version: 2.3.1 +# Version: 2.3.2 # License: BSD 3-Clause "New" or "Revised" License # Year: 2025-2026 # ========================================================================== @@ -18,7 +18,7 @@ # -------------------------------------------------------------------------- system: # Версія конфігурації (для сумісності) - version: "v2.3.1" + version: "v2.3.2" # Алгоритм хешування для детерміністичного маскування. # Той самий вхід завжди дає той самий замаскований результат. diff --git a/data_masking.py b/data_masking.py index 88fe398..f220bd6 100644 --- a/data_masking.py +++ b/data_masking.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Data Masking Script v2.3.1 +Data Masking Script v2.3.2 Локально узгоджене маскування конфіденційних даних з INSTANCE TRACKING ОНОВЛЕНО В v2.3.0: @@ -46,7 +46,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 """ @@ -122,7 +122,7 @@ # ============================================================================ # МЕТАДАНІ # ============================================================================ -__version__ = "2.3.1" +__version__ = "2.3.2" __author__ = "Vladyslav V. Prodan" __contact__ = "github.com/click0" __phone__ = "+38(099)6053340" diff --git a/diagnose_mapping.py b/diagnose_mapping.py index 00e9a3a..66af4d2 100644 --- a/diagnose_mapping.py +++ b/diagnose_mapping.py @@ -6,7 +6,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 diff --git a/docs/README.md b/docs/README.md index 3edd2df..42e6250 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# Data Masking & Unmasking Scripts v2.3.1 +# Data Masking & Unmasking Scripts v2.3.2 Скрипти для **узгодженого маскування** конфіденційних даних у військових документах з можливістю точного відновлення. @@ -501,6 +501,6 @@ BSD 3-Clause "New" or "Revised" License ## 📅 Версії -Поточна версія: **v2.3.1** (2026) +Поточна версія: **v2.3.2** (2026) Детальну історію змін див. у [CHANGELOG.md](CHANGELOG.md) diff --git a/modules/__init__.py b/modules/__init__.py index 1a9b753..4760f7c 100644 --- a/modules/__init__.py +++ b/modules/__init__.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Data Masking Modules Package v2.3.1 +Data Masking Modules Package v2.3.2 Модулі системи маскування даних. """ diff --git a/modules/config.py b/modules/config.py index 79fc703..8b0acd3 100644 --- a/modules/config.py +++ b/modules/config.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Configuration Module v2.3.1 for data_masking.py +Configuration Module v2.3.2 for data_masking.py Provides YAML + ENV + CLI configuration loading with priority resolution: CLI > ENV > config.yaml > config.py > Default @@ -16,7 +16,7 @@ Year: 2025-2026 """ -__version__ = "2.3.1" +__version__ = "2.3.2" import os import logging diff --git a/modules/masking_logger.py b/modules/masking_logger.py index 50c2ae1..214e6ba 100644 --- a/modules/masking_logger.py +++ b/modules/masking_logger.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Logging Module v2.3.1 for data_masking.py +Logging Module v2.3.2 for data_masking.py Provides structured logging with JSON and colored console output for masking operations. @@ -22,7 +22,7 @@ from typing import Any, Dict, Optional -__version__ = "2.3.1" +__version__ = "2.3.2" class JsonFormatter(logging.Formatter): diff --git a/modules/password_generator.py b/modules/password_generator.py index dea5840..18bb102 100644 --- a/modules/password_generator.py +++ b/modules/password_generator.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Password Generator Module v2.3.1 +Password Generator Module v2.3.2 Генератор паролів з підтримкою ASCII, кирилиці та кастомних символів. Використання як модуль: from password_generator import generate_password, PasswordConfig @@ -25,7 +25,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 """ @@ -34,7 +34,7 @@ import argparse from dataclasses import dataclass from typing import Optional, List, Dict, Any, Union -__version__ = "2.3.1" +__version__ = "2.3.2" __author__ = "Vladyslav V. Prodan" # ============================================================================= # КОНСТАНТИ diff --git a/modules/re_mask.py b/modules/re_mask.py index efee554..0e825fb 100644 --- a/modules/re_mask.py +++ b/modules/re_mask.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Re-Masking Module v2.3.1 +Re-Masking Module v2.3.2 Multi-pass masking with chain tracking for data_masking.py Provides: @@ -12,7 +12,7 @@ Chain JSON format: { - "version": "2.3.1", + "version": "2.3.2", "chain_id": "", "chain_version": 2, "created_at": "ISO-8601", @@ -38,7 +38,7 @@ from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Tuple -__version__ = "2.3.1" +__version__ = "2.3.2" # Standard mapping categories used by data_masking.py MAPPING_CATEGORIES = [ @@ -49,7 +49,7 @@ ] -def make_empty_masking_dict(version: str = "2.3.1") -> Dict: +def make_empty_masking_dict(version: str = "2.3.2") -> Dict: """Create a fresh empty masking dict with all required category keys. Args: diff --git a/modules/security.py b/modules/security.py index aa4959e..aefd812 100644 --- a/modules/security.py +++ b/modules/security.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Security Module v2.3.1 +Security Module v2.3.2 Provides AES-256-GCM encryption/decryption of mapping files for data_masking.py. @@ -15,7 +15,7 @@ Year: 2025-2026 """ -__version__ = "2.3.1" +__version__ = "2.3.2" import json import os diff --git a/modules/selective.py b/modules/selective.py index 9fb0480..db86083 100644 --- a/modules/selective.py +++ b/modules/selective.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Selective Masking Module v2.3.1 +Selective Masking Module v2.3.2 Provides --only / --exclude support: mask only selected data types. Supports type aliases (plural forms, Ukrainian names), type groups, @@ -19,7 +19,7 @@ from dataclasses import dataclass, field from typing import Dict, List, Optional, Set -__version__ = "2.3.1" +__version__ = "2.3.2" # ============================================================================ # AVAILABLE TYPES diff --git a/modules/tools.py b/modules/tools.py index 1962421..f3a3b66 100644 --- a/modules/tools.py +++ b/modules/tools.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Tools API Module v2.3.1 +Tools API Module v2.3.2 Provides atomic masking functions for programmatic use (without CLI). Each function is self-contained and operates on a single value, updating @@ -52,7 +52,7 @@ # ============================================================================ # METADATA # ============================================================================ -__version__ = "2.3.1" +__version__ = "2.3.2" __author__ = "Vladyslav V. Prodan" __contact__ = "github.com/click0" __license__ = "BSD 3-Clause" diff --git a/requirements.txt b/requirements.txt index 40cbde0..525694a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -# Data Masking System v2.3.0 +# Data Masking System v2.3.2 # Python 3.9+ # Генерація реалістичних українських імен diff --git a/tests/test_case_preservation.py b/tests/test_case_preservation.py index 6bcc427..baf7b39 100644 --- a/tests/test_case_preservation.py +++ b/tests/test_case_preservation.py @@ -5,7 +5,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 diff --git a/tests/test_diagnose.py b/tests/test_diagnose.py index ae14db8..fd66625 100644 --- a/tests/test_diagnose.py +++ b/tests/test_diagnose.py @@ -6,7 +6,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 """ diff --git a/tests/test_helpers.py b/tests/test_helpers.py index fafa787..bb25a13 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -5,7 +5,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 diff --git a/tests/test_integration.py b/tests/test_integration.py index 1899f34..7fa12e5 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Інтеграційні тести для data_masking.py v2.3.1 +Інтеграційні тести для data_masking.py v2.3.2 Тестує нові функції: - --init-config - --encrypt / --password @@ -11,7 +11,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 """ @@ -58,7 +58,7 @@ class TestVersion: def test_version(self): """Тест: версія модуля.""" import data_masking - assert data_masking.__version__ == "2.3.1" + assert data_masking.__version__ == "2.3.2" # ============================================================================ # ТЕСТИ --init-config # ============================================================================ @@ -104,7 +104,7 @@ def test_init_config_content(self, temp_dir): assert "router_rules:" in content # Перевіряємо версію - assert "v2.3.1" in content + assert "v2.3.2" in content # Перевіряємо параметри безпеки assert "encrypt_output:" in content @@ -387,7 +387,7 @@ def test_version_in_help(self): """Тест: версія доступна.""" from data_masking import __version__ - assert __version__ == "2.3.1" + assert __version__ == "2.3.2" # Спробуємо subprocess try: @@ -404,7 +404,7 @@ def test_version_in_help(self): stdout = result.stdout or "" if result.returncode == 0 and stdout.strip(): - assert "2.3.1" in stdout + assert "2.3.2" in stdout return except Exception: pass @@ -450,12 +450,12 @@ def test_version_flag(self, run_cli): result = run_cli("-V", expect_success=False) # --version може повернути 0 або інший код output = (result.stdout or "") + (result.stderr or "") - if "2.3.1" in output: + if "2.3.2" in output: assert True else: # Fallback from data_masking import __version__ - assert __version__ == "2.3.1" + assert __version__ == "2.3.2" def test_list_types(self, run_cli): """Тест: --list-types показує доступні типи.""" @@ -542,7 +542,7 @@ def test_basic_masking(self, sample_input_file, temp_dir, run_masking): text = sample_input_file.read_text(encoding="utf-8") masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {k: {} for k in [ "ipn", "passport_id", "military_id", "surname", "name", "military_unit", "order_number", "order_number_with_letters", @@ -576,7 +576,7 @@ def test_masking_with_only_flag(self, sample_input_file, temp_dir): # Симуляція --only ipn (маскуємо тільки ІПН) masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {k: {} for k in [ "ipn", "passport_id", "military_id", "surname", "name", "military_unit", "order_number", "rank", "date", "date_text", "patronymic" @@ -616,7 +616,7 @@ def test_masking_with_remask(self, sample_input_file, temp_dir, run_masking): text = sample_input_file.read_text(encoding="utf-8") masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {k: {} for k in [ "ipn", "passport_id", "military_id", "surname", "name", "military_unit", "order_number", "order_number_with_letters", @@ -669,7 +669,7 @@ def test_text_date_masking(self, temp_dir): text = 'від "06" жовтня 2025 року №292' masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {k: {} for k in [ "ipn", "passport_id", "military_id", "surname", "name", "order_number", "rank", "date", "date_text", "patronymic" @@ -692,7 +692,7 @@ def test_numeric_date_masking(self, temp_dir): text = "Дата: 15.03.2024" masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {k: {} for k in [ "ipn", "passport_id", "military_id", "surname", "name", "order_number", "rank", "date", "date_text", "patronymic" @@ -733,7 +733,7 @@ def test_no_report_flag(self, temp_dir): # Симулюємо --no-report text = "Тестовий текст" masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {"surname": {}, "name": {}}, "statistics": {}, "instance_tracking": {} @@ -768,7 +768,7 @@ def test_json_output(self, temp_dir): } masking_dict = { - "version": "2.3.1", + "version": "2.3.2", "mappings": {k: {} for k in [ "ipn", "passport_id", "surname", "name", "rank", "patronymic" ]}, @@ -849,7 +849,7 @@ class TestChainRoundtrip: def _make_masking_dict(self): """Create a fresh masking dict.""" from re_mask import make_empty_masking_dict - return make_empty_masking_dict("2.3.1") + return make_empty_masking_dict("2.3.2") def test_chain_roundtrip_2_passes(self): """Тест: маскування у 2 проходи, потім відновлення через ланцюг.""" diff --git a/tests/test_patronymic.py b/tests/test_patronymic.py index fa87782..eb2a689 100644 --- a/tests/test_patronymic.py +++ b/tests/test_patronymic.py @@ -5,7 +5,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 diff --git a/tests/test_rank_data.py b/tests/test_rank_data.py index 9fa9fc7..4610946 100644 --- a/tests/test_rank_data.py +++ b/tests/test_rank_data.py @@ -7,7 +7,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 diff --git a/tests/test_unmask.py b/tests/test_unmask.py index 148a289..08f565f 100644 --- a/tests/test_unmask.py +++ b/tests/test_unmask.py @@ -6,7 +6,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 Phone: +38(099)6053340 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause "New" or "Revised" License Year: 2025-2026 diff --git a/unmask_data.py b/unmask_data.py index 8cc1c79..d64aaa5 100644 --- a/unmask_data.py +++ b/unmask_data.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Data Unmasking Script v2.3.1 +Data Unmasking Script v2.3.2 Відновлення оригінальних даних з замаскованого файлу Цей скрипт виконує зворотну операцію до data_masking.py: відновлює оригінальні @@ -41,7 +41,7 @@ Author: Vladyslav V. Prodan Contact: github.com/click0 -Version: 2.3.1 +Version: 2.3.2 License: BSD 3-Clause Year: 2025-2026 """ @@ -121,7 +121,7 @@ # ============================================================================ # МЕТАДАНІ # ============================================================================ -__version__ = "2.3.1" +__version__ = "2.3.2" __author__ = "Vladyslav V. Prodan" __contact__ = "github.com/click0" __phone__ = "+38(099)6053340"