From ec8861d01ce6b10fe18446bbcbce677abc0c3a67 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 30 Nov 2025 21:20:17 +0100 Subject: [PATCH] refactor: rename folders to fix N999, INP001, S311 linting rules - Rename PYTHON/ to python_pkg/ (fix N999 uppercase folder) - Rename camelCase folders to snake_case: - randomJPG -> random_jpg - tagDivider -> tag_divider - downloadCats -> download_cats - keyboardCoop -> keyboard_coop - extractLinks -> extract_links - scapeWebsite -> scrape_website - Rename camelCase files: - generateJpeg.py -> generate_jpeg.py - tagDivider.py -> tag_divider.py - Rename poker-modifier-app to poker_modifier_app (fix INP001) - Add __init__.py to poker_modifier_app - Replace random module with secrets.SystemRandom (fix S311) - Fix S110 try-except-pass with contextlib.suppress - Update all imports and config references --- .github/workflows/python-tests.yml | 8 +-- .../README.md | 0 .../README_python.md | 0 poker_modifier_app/__init__.py | 1 + .../index.html | 0 .../poker_modifier_app.py | 11 ++-- .../script.js | 0 .../style.css | 0 pyproject.toml | 52 +++++++------------ {PYTHON => python_pkg}/.gitignore | 0 {PYTHON => python_pkg}/__init__.py | 0 .../download_cats}/__init__.py | 0 .../download_cats}/generate_cats.py | 0 .../download_cats}/requirements.txt | 0 .../extract_links}/main.py | 0 .../extract_links}/pytest.ini | 0 .../extract_links}/run.sh | 0 .../extract_links}/tests/__init__.py | 0 .../extract_links}/tests/sample2.html | 0 .../extract_links}/tests/test_main.py | 0 .../keyboard_coop}/README.md | 0 .../keyboard_coop}/__init__.py | 0 .../keyboard_coop}/main.py | 7 ++- .../keyboard_coop}/requirements.txt | 0 .../keyboard_coop}/run_game.sh | 0 .../keyboard_coop}/words_dictionary.json | 0 .../lichess_bot/.bot_version | 0 {PYTHON => python_pkg}/lichess_bot/README.md | 0 .../lichess_bot/__init__.py | 0 {PYTHON => python_pkg}/lichess_bot/engine.py | 9 ++-- .../lichess_bot/lichess_api.py | 0 {PYTHON => python_pkg}/lichess_bot/main.py | 24 ++++----- .../lichess_bot/requirements.txt | 0 {PYTHON => python_pkg}/lichess_bot/run.sh | 0 .../lichess_bot/run_tests.sh | 0 .../lichess_bot/tests/__init__.py | 0 .../lichess_bot/tests/conftest.py | 2 +- .../lichess_bot/tests/test_puzzles.py | 2 +- .../lichess_bot/tests/test_utils.py | 2 +- .../lichess_bot/tests/test_versioning.py | 2 +- .../tools/generate_blunder_tests.py | 10 ++-- {PYTHON => python_pkg}/lichess_bot/utils.py | 0 {PYTHON => python_pkg}/mock_server/README.md | 0 .../mock_server/__init__.py | 0 .../mock_server/mock_server.py | 0 .../mock_server/requirements.txt | 0 {PYTHON => python_pkg}/mock_server/run.sh | 0 {PYTHON => python_pkg}/pdfCentered/.gitignore | 0 .../pdfCentered/.python-version | 0 {PYTHON => python_pkg}/pdfCentered/pytest.ini | 0 .../random_jpg}/.gitignore | 0 .../random_jpg}/Readme.md | 0 .../random_jpg}/__init__.py | 0 .../random_jpg/generate_jpeg.py | 7 ++- .../random_jpg}/requirements.txt | 0 .../randomize_numbers/__init__.py | 0 .../randomize_numbers/random_digits.py | 28 +++++----- .../scrape_website}/.gitignore | 0 .../scrape_website}/__init__.py | 0 .../scrape_website}/requirements.txt | 0 .../scrape_website}/scrape_comics.py | 0 .../screen_locker/install_autostart.sh | 0 .../screen_locker/install_systemd.sh | 0 .../screen_locker/remove_autostart.sh | 0 .../screen_locker/remove_systemd.sh | 0 .../screen_locker/screen_lock.py | 0 .../screen_locker/workout-locker.service | 0 .../screen_locker/workout_log.json | 0 {PYTHON => python_pkg}/split/__init__.py | 0 .../split/split_x_into_n_symmetrically.py | 0 .../stockfish_analysis/README.md | 0 .../stockfish_analysis/analyze_chess_game.py | 38 +++++++------- .../stockfish_analysis/requirements.txt | 0 .../stockfish_analysis/run.sh | 0 .../tag_divider}/LICENSE | 0 .../tag_divider}/README.md | 0 .../tag_divider}/__init__.py | 0 .../tag_divider/tag_divider.py | 0 78 files changed, 96 insertions(+), 107 deletions(-) rename {poker-modifier-app => poker_modifier_app}/README.md (100%) rename {poker-modifier-app => poker_modifier_app}/README_python.md (100%) create mode 100644 poker_modifier_app/__init__.py rename {poker-modifier-app => poker_modifier_app}/index.html (100%) rename {poker-modifier-app => poker_modifier_app}/poker_modifier_app.py (99%) rename {poker-modifier-app => poker_modifier_app}/script.js (100%) rename {poker-modifier-app => poker_modifier_app}/style.css (100%) rename {PYTHON => python_pkg}/.gitignore (100%) rename {PYTHON => python_pkg}/__init__.py (100%) rename {PYTHON/downloadCats => python_pkg/download_cats}/__init__.py (100%) rename {PYTHON/downloadCats => python_pkg/download_cats}/generate_cats.py (100%) rename {PYTHON/downloadCats => python_pkg/download_cats}/requirements.txt (100%) rename {PYTHON/extractLinks => python_pkg/extract_links}/main.py (100%) rename {PYTHON/extractLinks => python_pkg/extract_links}/pytest.ini (100%) rename {PYTHON/extractLinks => python_pkg/extract_links}/run.sh (100%) rename {PYTHON/extractLinks => python_pkg/extract_links}/tests/__init__.py (100%) rename {PYTHON/extractLinks => python_pkg/extract_links}/tests/sample2.html (100%) rename {PYTHON/extractLinks => python_pkg/extract_links}/tests/test_main.py (100%) rename {PYTHON/keyboardCoop => python_pkg/keyboard_coop}/README.md (100%) rename {PYTHON/keyboardCoop => python_pkg/keyboard_coop}/__init__.py (100%) rename {PYTHON/keyboardCoop => python_pkg/keyboard_coop}/main.py (99%) rename {PYTHON/keyboardCoop => python_pkg/keyboard_coop}/requirements.txt (100%) rename {PYTHON/keyboardCoop => python_pkg/keyboard_coop}/run_game.sh (100%) rename {PYTHON/keyboardCoop => python_pkg/keyboard_coop}/words_dictionary.json (100%) rename {PYTHON => python_pkg}/lichess_bot/.bot_version (100%) rename {PYTHON => python_pkg}/lichess_bot/README.md (100%) rename {PYTHON => python_pkg}/lichess_bot/__init__.py (100%) rename {PYTHON => python_pkg}/lichess_bot/engine.py (97%) rename {PYTHON => python_pkg}/lichess_bot/lichess_api.py (100%) rename {PYTHON => python_pkg}/lichess_bot/main.py (96%) rename {PYTHON => python_pkg}/lichess_bot/requirements.txt (100%) rename {PYTHON => python_pkg}/lichess_bot/run.sh (100%) rename {PYTHON => python_pkg}/lichess_bot/run_tests.sh (100%) rename {PYTHON => python_pkg}/lichess_bot/tests/__init__.py (100%) rename {PYTHON => python_pkg}/lichess_bot/tests/conftest.py (88%) rename {PYTHON => python_pkg}/lichess_bot/tests/test_puzzles.py (97%) rename {PYTHON => python_pkg}/lichess_bot/tests/test_utils.py (92%) rename {PYTHON => python_pkg}/lichess_bot/tests/test_versioning.py (89%) rename {PYTHON => python_pkg}/lichess_bot/tools/generate_blunder_tests.py (97%) rename {PYTHON => python_pkg}/lichess_bot/utils.py (100%) rename {PYTHON => python_pkg}/mock_server/README.md (100%) rename {PYTHON => python_pkg}/mock_server/__init__.py (100%) rename {PYTHON => python_pkg}/mock_server/mock_server.py (100%) rename {PYTHON => python_pkg}/mock_server/requirements.txt (100%) rename {PYTHON => python_pkg}/mock_server/run.sh (100%) rename {PYTHON => python_pkg}/pdfCentered/.gitignore (100%) rename {PYTHON => python_pkg}/pdfCentered/.python-version (100%) rename {PYTHON => python_pkg}/pdfCentered/pytest.ini (100%) rename {PYTHON/randomJPG => python_pkg/random_jpg}/.gitignore (100%) rename {PYTHON/randomJPG => python_pkg/random_jpg}/Readme.md (100%) rename {PYTHON/randomJPG => python_pkg/random_jpg}/__init__.py (100%) rename PYTHON/randomJPG/generateJpeg.py => python_pkg/random_jpg/generate_jpeg.py (97%) rename {PYTHON/randomJPG => python_pkg/random_jpg}/requirements.txt (100%) rename {PYTHON => python_pkg}/randomize_numbers/__init__.py (100%) rename {PYTHON => python_pkg}/randomize_numbers/random_digits.py (84%) rename {PYTHON/scapeWebsite => python_pkg/scrape_website}/.gitignore (100%) rename {PYTHON/scapeWebsite => python_pkg/scrape_website}/__init__.py (100%) rename {PYTHON/scapeWebsite => python_pkg/scrape_website}/requirements.txt (100%) rename {PYTHON/scapeWebsite => python_pkg/scrape_website}/scrape_comics.py (100%) rename {PYTHON => python_pkg}/screen_locker/install_autostart.sh (100%) rename {PYTHON => python_pkg}/screen_locker/install_systemd.sh (100%) rename {PYTHON => python_pkg}/screen_locker/remove_autostart.sh (100%) rename {PYTHON => python_pkg}/screen_locker/remove_systemd.sh (100%) rename {PYTHON => python_pkg}/screen_locker/screen_lock.py (100%) rename {PYTHON => python_pkg}/screen_locker/workout-locker.service (100%) rename {PYTHON => python_pkg}/screen_locker/workout_log.json (100%) rename {PYTHON => python_pkg}/split/__init__.py (100%) rename {PYTHON => python_pkg}/split/split_x_into_n_symmetrically.py (100%) rename {PYTHON => python_pkg}/stockfish_analysis/README.md (100%) rename {PYTHON => python_pkg}/stockfish_analysis/analyze_chess_game.py (96%) rename {PYTHON => python_pkg}/stockfish_analysis/requirements.txt (100%) rename {PYTHON => python_pkg}/stockfish_analysis/run.sh (100%) rename {PYTHON/tagDivider => python_pkg/tag_divider}/LICENSE (100%) rename {PYTHON/tagDivider => python_pkg/tag_divider}/README.md (100%) rename {PYTHON/tagDivider => python_pkg/tag_divider}/__init__.py (100%) rename PYTHON/tagDivider/tagDivider.py => python_pkg/tag_divider/tag_divider.py (100%) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index d8c1c41..3e36a8e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -4,15 +4,15 @@ on: push: branches: [main] paths: - - "PYTHON/lichess_bot/**" - - "PYTHON/**" + - "python_pkg/lichess_bot/**" + - "python_pkg/**" - "tests/**" - "requirements.txt" pull_request: branches: [main] paths: - - "PYTHON/lichess_bot/**" - - "PYTHON/**" + - "python_pkg/lichess_bot/**" + - "python_pkg/**" - "tests/**" - "requirements.txt" diff --git a/poker-modifier-app/README.md b/poker_modifier_app/README.md similarity index 100% rename from poker-modifier-app/README.md rename to poker_modifier_app/README.md diff --git a/poker-modifier-app/README_python.md b/poker_modifier_app/README_python.md similarity index 100% rename from poker-modifier-app/README_python.md rename to poker_modifier_app/README_python.md diff --git a/poker_modifier_app/__init__.py b/poker_modifier_app/__init__.py new file mode 100644 index 0000000..d544097 --- /dev/null +++ b/poker_modifier_app/__init__.py @@ -0,0 +1 @@ +"""Poker modifier application package.""" diff --git a/poker-modifier-app/index.html b/poker_modifier_app/index.html similarity index 100% rename from poker-modifier-app/index.html rename to poker_modifier_app/index.html diff --git a/poker-modifier-app/poker_modifier_app.py b/poker_modifier_app/poker_modifier_app.py similarity index 99% rename from poker-modifier-app/poker_modifier_app.py rename to poker_modifier_app/poker_modifier_app.py index bd00e05..8877a84 100644 --- a/poker-modifier-app/poker_modifier_app.py +++ b/poker_modifier_app/poker_modifier_app.py @@ -1,12 +1,15 @@ """Texas Hold'em poker game modifier application.""" import logging -import random +import secrets import tkinter as tk from tkinter import ttk logging.basicConfig(level=logging.INFO) +# Use cryptographically secure random number generator +_rng = secrets.SystemRandom() + class PokerModifierApp: """GUI application for poker game modifiers.""" @@ -850,7 +853,7 @@ class PokerModifierApp: modifier_chance = self.prob_var.get() # Determine if modifier should be applied - random_value = random.random() * 100 + random_value = _rng.random() * 100 should_apply_modifier = random_value < modifier_chance if should_apply_modifier: @@ -886,7 +889,7 @@ class PokerModifierApp: bg_color = "#2d4a2d" # Green for normal # Select random modifier from appropriate pool - selected_modifier = random.choice(modifier_pool).copy() + selected_modifier = _rng.choice(modifier_pool).copy() # Special handling for Steel Cards - randomize the rank if selected_modifier["name"] == "Steel Cards": @@ -905,7 +908,7 @@ class PokerModifierApp: "King", "Ace", ] - steel_rank = random.choice(ranks) + steel_rank = _rng.choice(ranks) selected_modifier["description"] = selected_modifier["description"].format( steel_rank=steel_rank ) diff --git a/poker-modifier-app/script.js b/poker_modifier_app/script.js similarity index 100% rename from poker-modifier-app/script.js rename to poker_modifier_app/script.js diff --git a/poker-modifier-app/style.css b/poker_modifier_app/style.css similarity index 100% rename from poker-modifier-app/style.css rename to poker_modifier_app/style.css diff --git a/pyproject.toml b/pyproject.toml index e788b6c..273b6ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,112 +64,96 @@ unfixable = [] "D103", # Allow missing function docstring "PTH", # Allow os.path in conftest ] -# N999 ignores for PYTHON folder naming (uppercase folder) -"PYTHON/**/__init__.py" = [ - "N999", # Invalid module name due to PYTHON folder naming -] -"PYTHON/randomJPG/generateJpeg.py" = [ - "N999", # camelCase filename preserved for compatibility - "S311", # Random for image generation, not crypto +"python_pkg/random_jpg/generate_jpeg.py" = [ "PTH", # os.path patterns in existing code "LOG015", # Root logger in script "G004", # f-strings in logging ] -"PYTHON/tagDivider/tagDivider.py" = [ - "N999", # camelCase filename preserved for compatibility +"python_pkg/tag_divider/tag_divider.py" = [ "PTH", # os.path patterns in existing code "LOG015", # Root logger in script ] -"poker-modifier-app/*.py" = [ - "INP001", # Folder has hyphen, can't be a valid Python package - "S311", # Random for game mechanics, not crypto +"poker_modifier_app/*.py" = [ "LOG015", # Root logger in script "G004", # f-strings in logging ] -"poker-modifier-app/poker_modifier_app.py" = [ - "INP001", # Folder has hyphen, can't be a valid Python package +"poker_modifier_app/poker_modifier_app.py" = [ "FBT003", # Boolean positional values in tkinter API calls - "S311", # Random for game mechanics, not crypto "LOG015", # Root logger in app "G004", # f-strings in logging ] -"PYTHON/downloadCats/generate_cats.py" = [ +"python_pkg/download_cats/generate_cats.py" = [ "PERF203", # Try-except needed for download resilience in loop "PTH", # os.path patterns in existing code "LOG015", # Root logger in script "G004", # f-strings in logging ] -"PYTHON/lichess_bot/main.py" = [ +"python_pkg/lichess_bot/main.py" = [ "C901", # Complex functions handling game lifecycle (run_bot, handle_game) "PERF203", # Try-except needed for stream/move error handling in loops "PLR0912", # Complex nested game event handling with many branches "PLR0915", # Long function handling complete game lifecycle "BLE001", # Blind except for resilient bot operation - "S110", # Try-except-pass for non-critical error handling "S603", # Subprocess call for analysis script "PTH", # os.path patterns in existing code "LOG015", # Root logger in bot "G004", # f-strings in logging - "TRY301", # Raise in try block for null checks on subprocess streams ] -"PYTHON/lichess_bot/engine.py" = [ +"python_pkg/lichess_bot/engine.py" = [ "BLE001", # Blind except for engine error handling - "S110", # Try-except-pass for optional features "S603", # Subprocess for engine communication "PTH", # os.path patterns + "LOG015", # Root logger for debug messages ] -"PYTHON/lichess_bot/lichess_api.py" = [ +"python_pkg/lichess_bot/lichess_api.py" = [ "BLE001", # Blind except for API resilience "LOG015", # Root logger in API client "G004", # f-strings in logging ] -"PYTHON/lichess_bot/utils.py" = [ +"python_pkg/lichess_bot/utils.py" = [ "BLE001", # Blind except for file operations "PTH", # os.path patterns "LOG015", # Root logger "G004", # f-strings in logging ] -"PYTHON/lichess_bot/tools/generate_blunder_tests.py" = [ +"python_pkg/lichess_bot/tools/generate_blunder_tests.py" = [ "BLE001", # Blind except for test generation "PTH", # os.path patterns in tool "LOG015", # Root logger in tool "G004", # f-strings in logging ] -"PYTHON/stockfish_analysis/analyze_chess_game.py" = [ +"python_pkg/stockfish_analysis/analyze_chess_game.py" = [ "C901", # Complex main() with many argument combinations and analysis modes "PLR0912", # Complex main() with many argument combinations and analysis modes "PLR0915", # Long main() handling complete analysis workflow "BLE001", # Blind except for engine configuration - "S110", # Try-except-pass for optional engine features "PTH", # os.path patterns "LOG015", # Root logger in analysis tool "G004", # f-strings in logging ] -"PYTHON/randomize_numbers/random_digits.py" = [ +"python_pkg/randomize_numbers/random_digits.py" = [ "PERF203", # Try-except needed for parsing user input in loop - "S311", # Random for number randomization, not crypto "LOG015", # Root logger in script "G004", # f-strings in logging - "TRY301", # Raise in try block for input validation ] -"PYTHON/keyboardCoop/main.py" = [ +"python_pkg/keyboard_coop/main.py" = [ "FBT003", # Boolean positional values in pygame API calls (e.g., font.render) "PTH", # os.path patterns "LOG015", # Root logger in script ] -"PYTHON/screen_locker/screen_lock.py" = [ +"python_pkg/screen_locker/screen_lock.py" = [ "FBT003", # Boolean positional values in tkinter API calls "PTH", # os.path patterns "LOG015", # Root logger in app "G004", # f-strings in logging ] -"PYTHON/scapeWebsite/scrape_comics.py" = [ +"python_pkg/scrape_website/scrape_comics.py" = [ "BLE001", # Blind except for web scraping resilience "PTH", # os.path patterns "LOG015", # Root logger in script "G004", # f-strings in logging ] -"PYTHON/extractLinks/main.py" = [ +"python_pkg/extract_links/main.py" = [ "PTH", # os.path patterns "LOG015", # Root logger in script "G004", # f-strings in logging @@ -181,7 +165,7 @@ convention = "google" # Use Google docstring convention [tool.ruff.lint.isort] force-single-line = false force-sort-within-sections = true -known-first-party = ["PYTHON"] +known-first-party = ["python_pkg"] [tool.ruff.lint.flake8-quotes] docstring-quotes = "double" diff --git a/PYTHON/.gitignore b/python_pkg/.gitignore similarity index 100% rename from PYTHON/.gitignore rename to python_pkg/.gitignore diff --git a/PYTHON/__init__.py b/python_pkg/__init__.py similarity index 100% rename from PYTHON/__init__.py rename to python_pkg/__init__.py diff --git a/PYTHON/downloadCats/__init__.py b/python_pkg/download_cats/__init__.py similarity index 100% rename from PYTHON/downloadCats/__init__.py rename to python_pkg/download_cats/__init__.py diff --git a/PYTHON/downloadCats/generate_cats.py b/python_pkg/download_cats/generate_cats.py similarity index 100% rename from PYTHON/downloadCats/generate_cats.py rename to python_pkg/download_cats/generate_cats.py diff --git a/PYTHON/downloadCats/requirements.txt b/python_pkg/download_cats/requirements.txt similarity index 100% rename from PYTHON/downloadCats/requirements.txt rename to python_pkg/download_cats/requirements.txt diff --git a/PYTHON/extractLinks/main.py b/python_pkg/extract_links/main.py similarity index 100% rename from PYTHON/extractLinks/main.py rename to python_pkg/extract_links/main.py diff --git a/PYTHON/extractLinks/pytest.ini b/python_pkg/extract_links/pytest.ini similarity index 100% rename from PYTHON/extractLinks/pytest.ini rename to python_pkg/extract_links/pytest.ini diff --git a/PYTHON/extractLinks/run.sh b/python_pkg/extract_links/run.sh similarity index 100% rename from PYTHON/extractLinks/run.sh rename to python_pkg/extract_links/run.sh diff --git a/PYTHON/extractLinks/tests/__init__.py b/python_pkg/extract_links/tests/__init__.py similarity index 100% rename from PYTHON/extractLinks/tests/__init__.py rename to python_pkg/extract_links/tests/__init__.py diff --git a/PYTHON/extractLinks/tests/sample2.html b/python_pkg/extract_links/tests/sample2.html similarity index 100% rename from PYTHON/extractLinks/tests/sample2.html rename to python_pkg/extract_links/tests/sample2.html diff --git a/PYTHON/extractLinks/tests/test_main.py b/python_pkg/extract_links/tests/test_main.py similarity index 100% rename from PYTHON/extractLinks/tests/test_main.py rename to python_pkg/extract_links/tests/test_main.py diff --git a/PYTHON/keyboardCoop/README.md b/python_pkg/keyboard_coop/README.md similarity index 100% rename from PYTHON/keyboardCoop/README.md rename to python_pkg/keyboard_coop/README.md diff --git a/PYTHON/keyboardCoop/__init__.py b/python_pkg/keyboard_coop/__init__.py similarity index 100% rename from PYTHON/keyboardCoop/__init__.py rename to python_pkg/keyboard_coop/__init__.py diff --git a/PYTHON/keyboardCoop/main.py b/python_pkg/keyboard_coop/main.py similarity index 99% rename from PYTHON/keyboardCoop/main.py rename to python_pkg/keyboard_coop/main.py index b3052c3..0e64336 100644 --- a/PYTHON/keyboardCoop/main.py +++ b/python_pkg/keyboard_coop/main.py @@ -6,13 +6,16 @@ Players take turns selecting adjacent keys to form valid English words. import json import logging import os -import random +import secrets import sys import pygame logging.basicConfig(level=logging.INFO) +# Use cryptographically secure random number generator +_rng = secrets.SystemRandom() + # Initialize Pygame pygame.init() @@ -202,7 +205,7 @@ class KeyboardCoopGame: """Generate a random keyboard layout and calculate adjacencies.""" # All 26 letters all_letters = list("abcdefghijklmnopqrstuvwxyz") - random.shuffle(all_letters) + _rng.shuffle(all_letters) # Create random layout with same structure as QWERTY (10-9-7) self.keyboard_layout = [ diff --git a/PYTHON/keyboardCoop/requirements.txt b/python_pkg/keyboard_coop/requirements.txt similarity index 100% rename from PYTHON/keyboardCoop/requirements.txt rename to python_pkg/keyboard_coop/requirements.txt diff --git a/PYTHON/keyboardCoop/run_game.sh b/python_pkg/keyboard_coop/run_game.sh similarity index 100% rename from PYTHON/keyboardCoop/run_game.sh rename to python_pkg/keyboard_coop/run_game.sh diff --git a/PYTHON/keyboardCoop/words_dictionary.json b/python_pkg/keyboard_coop/words_dictionary.json similarity index 100% rename from PYTHON/keyboardCoop/words_dictionary.json rename to python_pkg/keyboard_coop/words_dictionary.json diff --git a/PYTHON/lichess_bot/.bot_version b/python_pkg/lichess_bot/.bot_version similarity index 100% rename from PYTHON/lichess_bot/.bot_version rename to python_pkg/lichess_bot/.bot_version diff --git a/PYTHON/lichess_bot/README.md b/python_pkg/lichess_bot/README.md similarity index 100% rename from PYTHON/lichess_bot/README.md rename to python_pkg/lichess_bot/README.md diff --git a/PYTHON/lichess_bot/__init__.py b/python_pkg/lichess_bot/__init__.py similarity index 100% rename from PYTHON/lichess_bot/__init__.py rename to python_pkg/lichess_bot/__init__.py diff --git a/PYTHON/lichess_bot/engine.py b/python_pkg/lichess_bot/engine.py similarity index 97% rename from PYTHON/lichess_bot/engine.py rename to python_pkg/lichess_bot/engine.py index 840fa4a..d55af24 100644 --- a/PYTHON/lichess_bot/engine.py +++ b/python_pkg/lichess_bot/engine.py @@ -1,6 +1,8 @@ """Chess engine wrapper for the C-based random/scoring engine.""" +import contextlib import json +import logging import os import subprocess @@ -144,12 +146,10 @@ class RandomEngine: # best move chosen = data.get("chosen_move") if isinstance(chosen, str): - try: + with contextlib.suppress(Exception): bm = chess.Move.from_uci(chosen) if bm in board.legal_moves: best_move = bm - except Exception: - best_move = None # Store compact explanations for debugging cand_expl = json.dumps(analyze, ensure_ascii=False) best_expl = json.dumps( @@ -160,7 +160,6 @@ class RandomEngine: ensure_ascii=False, ) except Exception: - # Leave defaults with raw output text - pass + logging.debug("Failed to parse engine JSON output") return cand_score, cand_expl, best_move, best_expl diff --git a/PYTHON/lichess_bot/lichess_api.py b/python_pkg/lichess_bot/lichess_api.py similarity index 100% rename from PYTHON/lichess_bot/lichess_api.py rename to python_pkg/lichess_bot/lichess_api.py diff --git a/PYTHON/lichess_bot/main.py b/python_pkg/lichess_bot/main.py similarity index 96% rename from PYTHON/lichess_bot/main.py rename to python_pkg/lichess_bot/main.py index cf36573..2b3d422 100644 --- a/PYTHON/lichess_bot/main.py +++ b/python_pkg/lichess_bot/main.py @@ -1,6 +1,7 @@ """Main entry point for the Lichess bot.""" import argparse +import contextlib import datetime import json import logging @@ -12,9 +13,9 @@ import threading import chess import chess.pgn -from PYTHON.lichess_bot.engine import RandomEngine -from PYTHON.lichess_bot.lichess_api import LichessAPI -from PYTHON.lichess_bot.utils import backoff_sleep, get_and_increment_version +from python_pkg.lichess_bot.engine import RandomEngine +from python_pkg.lichess_bot.lichess_api import LichessAPI +from python_pkg.lichess_bot.utils import backoff_sleep, get_and_increment_version def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> None: @@ -91,7 +92,7 @@ def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> white_name = event["white"].get("name") or white_id or "?" black_name = event["black"].get("name") or black_id or "?" # Set site and date if available - try: + with contextlib.suppress(Exception): # Lichess event may include 'createdAt' ms epoch created_ms = event.get("createdAt") or event.get( "createdAtDate" @@ -100,8 +101,6 @@ def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> game_date_iso = datetime.datetime.fromtimestamp( int(created_ms) / 1000, tz=datetime.timezone.utc ).strftime("%Y.%m.%d") - except Exception: - pass site_url = f"https://lichess.org/{game_id}" me = api.get_my_user_id() if me == white_id: @@ -241,7 +240,7 @@ def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> if game_log_path: game = chess.pgn.Game.from_board(board) # Record the bot version in the PGN headers - try: + with contextlib.suppress(Exception): game.headers["BotVersion"] = f"v{bot_version}" if site_url: game.headers["Site"] = site_url @@ -251,8 +250,6 @@ def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> game.headers["White"] = white_name if black_name: game.headers["Black"] = black_name - except Exception: - pass with open(game_log_path, "a") as lf: lf.write("\nPGN:\n") exporter = chess.pgn.StringExporter( @@ -293,9 +290,9 @@ def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> lines: list[str] = [] ply_line_re = __import__("re").compile(r"^\s*(\d+)\s") # Read stdout line by line - if proc.stdout is None: - msg = "subprocess stdout is None" - raise RuntimeError(msg) + # stdout/stderr are guaranteed non-None with PIPE + assert proc.stdout is not None # noqa: S101 + assert proc.stderr is not None # noqa: S101 for line in proc.stdout: lines.append(line) m = ply_line_re.match(line) @@ -321,9 +318,6 @@ def run_bot(log_level: str = "INFO", *, decline_correspondence: bool = False) -> ) # Capture any remaining stderr and ensure process ends - if proc.stderr is None: - msg = "subprocess stderr is None" - raise RuntimeError(msg) stderr_text = proc.stderr.read() or "" ret = proc.wait() analysis_text = "".join(lines) diff --git a/PYTHON/lichess_bot/requirements.txt b/python_pkg/lichess_bot/requirements.txt similarity index 100% rename from PYTHON/lichess_bot/requirements.txt rename to python_pkg/lichess_bot/requirements.txt diff --git a/PYTHON/lichess_bot/run.sh b/python_pkg/lichess_bot/run.sh similarity index 100% rename from PYTHON/lichess_bot/run.sh rename to python_pkg/lichess_bot/run.sh diff --git a/PYTHON/lichess_bot/run_tests.sh b/python_pkg/lichess_bot/run_tests.sh similarity index 100% rename from PYTHON/lichess_bot/run_tests.sh rename to python_pkg/lichess_bot/run_tests.sh diff --git a/PYTHON/lichess_bot/tests/__init__.py b/python_pkg/lichess_bot/tests/__init__.py similarity index 100% rename from PYTHON/lichess_bot/tests/__init__.py rename to python_pkg/lichess_bot/tests/__init__.py diff --git a/PYTHON/lichess_bot/tests/conftest.py b/python_pkg/lichess_bot/tests/conftest.py similarity index 88% rename from PYTHON/lichess_bot/tests/conftest.py rename to python_pkg/lichess_bot/tests/conftest.py index cb1522a..b842954 100644 --- a/PYTHON/lichess_bot/tests/conftest.py +++ b/python_pkg/lichess_bot/tests/conftest.py @@ -4,7 +4,7 @@ import sys import pytest -# Add repository root to sys.path so 'import PYTHON.*' works when running +# Add repository root to sys.path so 'import python_pkg.*' works when running # pytest with a subdirectory as rootdir. ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../..")) if ROOT not in sys.path: diff --git a/PYTHON/lichess_bot/tests/test_puzzles.py b/python_pkg/lichess_bot/tests/test_puzzles.py similarity index 97% rename from PYTHON/lichess_bot/tests/test_puzzles.py rename to python_pkg/lichess_bot/tests/test_puzzles.py index 4fa3d1d..c035375 100644 --- a/PYTHON/lichess_bot/tests/test_puzzles.py +++ b/python_pkg/lichess_bot/tests/test_puzzles.py @@ -6,7 +6,7 @@ import os import chess import pytest -from PYTHON.lichess_bot.engine import RandomEngine +from python_pkg.lichess_bot.engine import RandomEngine def _load_top_puzzles(csv_path: str, limit: int = 8) -> list[tuple[str, str]]: diff --git a/PYTHON/lichess_bot/tests/test_utils.py b/python_pkg/lichess_bot/tests/test_utils.py similarity index 92% rename from PYTHON/lichess_bot/tests/test_utils.py rename to python_pkg/lichess_bot/tests/test_utils.py index 8afb8fc..17debb2 100644 --- a/PYTHON/lichess_bot/tests/test_utils.py +++ b/python_pkg/lichess_bot/tests/test_utils.py @@ -2,7 +2,7 @@ import pytest -from PYTHON.lichess_bot.utils import backoff_sleep +from python_pkg.lichess_bot.utils import backoff_sleep def test_backoff_sleep_increments_and_caps(monkeypatch: pytest.MonkeyPatch) -> None: diff --git a/PYTHON/lichess_bot/tests/test_versioning.py b/python_pkg/lichess_bot/tests/test_versioning.py similarity index 89% rename from PYTHON/lichess_bot/tests/test_versioning.py rename to python_pkg/lichess_bot/tests/test_versioning.py index e8a3ecc..3bfd8e8 100644 --- a/PYTHON/lichess_bot/tests/test_versioning.py +++ b/python_pkg/lichess_bot/tests/test_versioning.py @@ -4,7 +4,7 @@ from pathlib import Path import pytest -from PYTHON.lichess_bot.utils import get_and_increment_version +from python_pkg.lichess_bot.utils import get_and_increment_version def test_version_file_increments_and_persists( diff --git a/PYTHON/lichess_bot/tools/generate_blunder_tests.py b/python_pkg/lichess_bot/tools/generate_blunder_tests.py similarity index 97% rename from PYTHON/lichess_bot/tools/generate_blunder_tests.py rename to python_pkg/lichess_bot/tools/generate_blunder_tests.py index 4c63d36..cfd524f 100755 --- a/PYTHON/lichess_bot/tools/generate_blunder_tests.py +++ b/python_pkg/lichess_bot/tools/generate_blunder_tests.py @@ -16,17 +16,17 @@ Where logs are loaded from: Usage examples: # Process all logs in tools/past_games - python PYTHON/lichess_bot/tools/generate_blunder_tests.py + python python_pkg/lichess_bot/tools/generate_blunder_tests.py # Process a specific game by id from tools/past_games - python PYTHON/lichess_bot/tools/generate_blunder_tests.py OVmR29MI + python python_pkg/lichess_bot/tools/generate_blunder_tests.py OVmR29MI # Process an explicit file path - python PYTHON/lichess_bot/tools/generate_blunder_tests.py \ + python python_pkg/lichess_bot/tools/generate_blunder_tests.py \ /path/to/lichess_bot_game_xxxxx.log It will create files like: - PYTHON/lichess_bot/tests/test_blunders_.py + python_pkg/lichess_bot/tests/test_blunders_.py Dependencies: python-chess, pytest (already in requirements.txt) """ @@ -203,7 +203,7 @@ REPO_ROOT = os.path.dirname( if REPO_ROOT not in sys.path: sys.path.insert(0, REPO_ROOT) -from PYTHON.lichess_bot.engine import RandomEngine # noqa: E402 +from python_pkg.lichess_bot.engine import RandomEngine # noqa: E402 BLUNDER_CASES = [ ] diff --git a/PYTHON/lichess_bot/utils.py b/python_pkg/lichess_bot/utils.py similarity index 100% rename from PYTHON/lichess_bot/utils.py rename to python_pkg/lichess_bot/utils.py diff --git a/PYTHON/mock_server/README.md b/python_pkg/mock_server/README.md similarity index 100% rename from PYTHON/mock_server/README.md rename to python_pkg/mock_server/README.md diff --git a/PYTHON/mock_server/__init__.py b/python_pkg/mock_server/__init__.py similarity index 100% rename from PYTHON/mock_server/__init__.py rename to python_pkg/mock_server/__init__.py diff --git a/PYTHON/mock_server/mock_server.py b/python_pkg/mock_server/mock_server.py similarity index 100% rename from PYTHON/mock_server/mock_server.py rename to python_pkg/mock_server/mock_server.py diff --git a/PYTHON/mock_server/requirements.txt b/python_pkg/mock_server/requirements.txt similarity index 100% rename from PYTHON/mock_server/requirements.txt rename to python_pkg/mock_server/requirements.txt diff --git a/PYTHON/mock_server/run.sh b/python_pkg/mock_server/run.sh similarity index 100% rename from PYTHON/mock_server/run.sh rename to python_pkg/mock_server/run.sh diff --git a/PYTHON/pdfCentered/.gitignore b/python_pkg/pdfCentered/.gitignore similarity index 100% rename from PYTHON/pdfCentered/.gitignore rename to python_pkg/pdfCentered/.gitignore diff --git a/PYTHON/pdfCentered/.python-version b/python_pkg/pdfCentered/.python-version similarity index 100% rename from PYTHON/pdfCentered/.python-version rename to python_pkg/pdfCentered/.python-version diff --git a/PYTHON/pdfCentered/pytest.ini b/python_pkg/pdfCentered/pytest.ini similarity index 100% rename from PYTHON/pdfCentered/pytest.ini rename to python_pkg/pdfCentered/pytest.ini diff --git a/PYTHON/randomJPG/.gitignore b/python_pkg/random_jpg/.gitignore similarity index 100% rename from PYTHON/randomJPG/.gitignore rename to python_pkg/random_jpg/.gitignore diff --git a/PYTHON/randomJPG/Readme.md b/python_pkg/random_jpg/Readme.md similarity index 100% rename from PYTHON/randomJPG/Readme.md rename to python_pkg/random_jpg/Readme.md diff --git a/PYTHON/randomJPG/__init__.py b/python_pkg/random_jpg/__init__.py similarity index 100% rename from PYTHON/randomJPG/__init__.py rename to python_pkg/random_jpg/__init__.py diff --git a/PYTHON/randomJPG/generateJpeg.py b/python_pkg/random_jpg/generate_jpeg.py similarity index 97% rename from PYTHON/randomJPG/generateJpeg.py rename to python_pkg/random_jpg/generate_jpeg.py index c207ef8..ccd3f3b 100644 --- a/PYTHON/randomJPG/generateJpeg.py +++ b/python_pkg/random_jpg/generate_jpeg.py @@ -5,12 +5,15 @@ from dataclasses import dataclass from datetime import datetime, timezone import logging import os -import random +import secrets from PIL import Image logging.basicConfig(level=logging.INFO) +# Use cryptographically secure random number generator +_rng = secrets.SystemRandom() + MAX_IMAGE_SIZE = 1000 @@ -57,7 +60,7 @@ def generate_bloated_jpeg(config: ImageConfig, image_index: int, folder: str) -> # of random colors from the list for y in range(0, config.size, config.block_size): for x in range(0, config.size, config.block_size): - color = random.choice(rgb_colors) + color = _rng.choice(rgb_colors) for i in range(config.block_size): for j in range(config.block_size): pixels[x + i, y + j] = color diff --git a/PYTHON/randomJPG/requirements.txt b/python_pkg/random_jpg/requirements.txt similarity index 100% rename from PYTHON/randomJPG/requirements.txt rename to python_pkg/random_jpg/requirements.txt diff --git a/PYTHON/randomize_numbers/__init__.py b/python_pkg/randomize_numbers/__init__.py similarity index 100% rename from PYTHON/randomize_numbers/__init__.py rename to python_pkg/randomize_numbers/__init__.py diff --git a/PYTHON/randomize_numbers/random_digits.py b/python_pkg/randomize_numbers/random_digits.py similarity index 84% rename from PYTHON/randomize_numbers/random_digits.py rename to python_pkg/randomize_numbers/random_digits.py index 0b20f6a..079b5a1 100644 --- a/PYTHON/randomize_numbers/random_digits.py +++ b/python_pkg/randomize_numbers/random_digits.py @@ -2,12 +2,15 @@ import contextlib import logging -import random import re +import secrets import sys logging.basicConfig(level=logging.INFO) +# Use cryptographically secure random number generator +_rng = secrets.SystemRandom() + DEFAULT_MIN_PERCENTAGE = 1 DEFAULT_MAX_PERCENTAGE = 20 @@ -20,8 +23,8 @@ def randomize_numbers( """Apply random percentage variation to a list of numbers.""" randomized_numbers = [] for number in numbers: - percentage = random.uniform(min_percentage, max_percentage) / 100 - if random.choice([True, False]): + percentage = _rng.uniform(min_percentage, max_percentage) / 100 + if _rng.choice([True, False]): new_number = number + (number * percentage) else: new_number = number - (number * percentage) @@ -60,16 +63,17 @@ if __name__ == "__main__": ) sys.exit(1) + input_string = " ".join(sys.argv[1:]) + numbers, decimal_counts = parse_input(input_string) + + if len(numbers) == 0: + logging.error("No valid numbers provided.") + sys.exit(1) + + min_percentage = DEFAULT_MIN_PERCENTAGE + max_percentage = DEFAULT_MAX_PERCENTAGE + try: - input_string = " ".join(sys.argv[1:]) - numbers, decimal_counts = parse_input(input_string) - min_percentage = DEFAULT_MIN_PERCENTAGE - max_percentage = DEFAULT_MAX_PERCENTAGE - - if len(numbers) == 0: - msg = "No valid numbers provided." - raise ValueError(msg) - if len(sys.argv) > len(numbers) + 1: with contextlib.suppress(ValueError): min_percentage = float(sys.argv[len(numbers) + 1]) diff --git a/PYTHON/scapeWebsite/.gitignore b/python_pkg/scrape_website/.gitignore similarity index 100% rename from PYTHON/scapeWebsite/.gitignore rename to python_pkg/scrape_website/.gitignore diff --git a/PYTHON/scapeWebsite/__init__.py b/python_pkg/scrape_website/__init__.py similarity index 100% rename from PYTHON/scapeWebsite/__init__.py rename to python_pkg/scrape_website/__init__.py diff --git a/PYTHON/scapeWebsite/requirements.txt b/python_pkg/scrape_website/requirements.txt similarity index 100% rename from PYTHON/scapeWebsite/requirements.txt rename to python_pkg/scrape_website/requirements.txt diff --git a/PYTHON/scapeWebsite/scrape_comics.py b/python_pkg/scrape_website/scrape_comics.py similarity index 100% rename from PYTHON/scapeWebsite/scrape_comics.py rename to python_pkg/scrape_website/scrape_comics.py diff --git a/PYTHON/screen_locker/install_autostart.sh b/python_pkg/screen_locker/install_autostart.sh similarity index 100% rename from PYTHON/screen_locker/install_autostart.sh rename to python_pkg/screen_locker/install_autostart.sh diff --git a/PYTHON/screen_locker/install_systemd.sh b/python_pkg/screen_locker/install_systemd.sh similarity index 100% rename from PYTHON/screen_locker/install_systemd.sh rename to python_pkg/screen_locker/install_systemd.sh diff --git a/PYTHON/screen_locker/remove_autostart.sh b/python_pkg/screen_locker/remove_autostart.sh similarity index 100% rename from PYTHON/screen_locker/remove_autostart.sh rename to python_pkg/screen_locker/remove_autostart.sh diff --git a/PYTHON/screen_locker/remove_systemd.sh b/python_pkg/screen_locker/remove_systemd.sh similarity index 100% rename from PYTHON/screen_locker/remove_systemd.sh rename to python_pkg/screen_locker/remove_systemd.sh diff --git a/PYTHON/screen_locker/screen_lock.py b/python_pkg/screen_locker/screen_lock.py similarity index 100% rename from PYTHON/screen_locker/screen_lock.py rename to python_pkg/screen_locker/screen_lock.py diff --git a/PYTHON/screen_locker/workout-locker.service b/python_pkg/screen_locker/workout-locker.service similarity index 100% rename from PYTHON/screen_locker/workout-locker.service rename to python_pkg/screen_locker/workout-locker.service diff --git a/PYTHON/screen_locker/workout_log.json b/python_pkg/screen_locker/workout_log.json similarity index 100% rename from PYTHON/screen_locker/workout_log.json rename to python_pkg/screen_locker/workout_log.json diff --git a/PYTHON/split/__init__.py b/python_pkg/split/__init__.py similarity index 100% rename from PYTHON/split/__init__.py rename to python_pkg/split/__init__.py diff --git a/PYTHON/split/split_x_into_n_symmetrically.py b/python_pkg/split/split_x_into_n_symmetrically.py similarity index 100% rename from PYTHON/split/split_x_into_n_symmetrically.py rename to python_pkg/split/split_x_into_n_symmetrically.py diff --git a/PYTHON/stockfish_analysis/README.md b/python_pkg/stockfish_analysis/README.md similarity index 100% rename from PYTHON/stockfish_analysis/README.md rename to python_pkg/stockfish_analysis/README.md diff --git a/PYTHON/stockfish_analysis/analyze_chess_game.py b/python_pkg/stockfish_analysis/analyze_chess_game.py similarity index 96% rename from PYTHON/stockfish_analysis/analyze_chess_game.py rename to python_pkg/stockfish_analysis/analyze_chess_game.py index b13b034..67c38dd 100755 --- a/PYTHON/stockfish_analysis/analyze_chess_game.py +++ b/python_pkg/stockfish_analysis/analyze_chess_game.py @@ -2,7 +2,7 @@ """Analyze a chess game's moves using a local Stockfish engine and rate each move. Usage: - python3 PYTHON/analyze_chess_game.py + python3 python_pkg/analyze_chess_game.py [--engine stockfish] [--time 0.5 | --depth 20] [--threads auto|N] @@ -11,7 +11,7 @@ Usage: [--last-move-only] Notes: - - Requires python-chess. Install from PYTHON/stockfish_analysis/requirements.txt + - Requires python-chess. Install from python_pkg/stockfish_analysis/requirements.txt - The input file can be a pure PGN or a log file containing a PGN section. - The script tries to locate the PGN by looking for a 'PGN:' marker, PGN tags '[...]', or a move list starting with '1.'. @@ -41,7 +41,7 @@ try: import chess.pgn except Exception: # pragma: no cover logging.exception("Missing dependency. Please install python-chess:") - logging.exception(" pip install -r PYTHON/stockfish_analysis/requirements.txt") + logging.exception(" pip install -r python_pkg/stockfish_analysis/requirements.txt") raise # Memory configuration constants @@ -177,22 +177,20 @@ def _parse_hash_mb(value: str) -> int | None: def _detect_total_mem_mb() -> int | None: # Prefer psutil if available if psutil is not None: - try: + with contextlib.suppress(Exception): return int(psutil.virtual_memory().total // (1024 * 1024)) - except Exception: - pass # Fallback approach for Linux systems using proc meminfo. - try: - with open("/proc/meminfo", encoding="utf-8", errors="ignore") as f: - for line in f: - if line.startswith("MemTotal:"): - parts = line.split() - if len(parts) >= MEMINFO_PARTS_MIN and parts[1].isdigit(): - # Value is in kB - kb = int(parts[1]) - return kb // 1024 - except Exception: - pass + with ( + contextlib.suppress(Exception), + open("/proc/meminfo", encoding="utf-8", errors="ignore") as f, + ): + for line in f: + if line.startswith("MemTotal:"): + parts = line.split() + if len(parts) >= MEMINFO_PARTS_MIN and parts[1].isdigit(): + # Value is in kB + kb = int(parts[1]) + return kb // 1024 return None @@ -320,7 +318,7 @@ def main() -> None: wanted_threads = max(wanted_threads, min_thr) engine.configure({"Threads": int(wanted_threads)}) except Exception: - pass + logging.debug("Failed to configure Threads option") # Configure hash table size in MB. if "Hash" in options: @@ -338,7 +336,7 @@ def main() -> None: target_hash = max(target_hash, min_hash) engine.configure({"Hash": int(target_hash)}) except Exception: - pass + logging.debug("Failed to configure Hash option") # MultiPV effective_mpv = max(1, int(args.multipv)) @@ -349,7 +347,7 @@ def main() -> None: effective_mpv = min(effective_mpv, max_mpv) engine.configure({"MultiPV": int(effective_mpv)}) except Exception: - pass + logging.debug("Failed to configure MultiPV option") # Enable NNUE if the option exists for nnue_key in ("Use NNUE", "UseNNUE"): diff --git a/PYTHON/stockfish_analysis/requirements.txt b/python_pkg/stockfish_analysis/requirements.txt similarity index 100% rename from PYTHON/stockfish_analysis/requirements.txt rename to python_pkg/stockfish_analysis/requirements.txt diff --git a/PYTHON/stockfish_analysis/run.sh b/python_pkg/stockfish_analysis/run.sh similarity index 100% rename from PYTHON/stockfish_analysis/run.sh rename to python_pkg/stockfish_analysis/run.sh diff --git a/PYTHON/tagDivider/LICENSE b/python_pkg/tag_divider/LICENSE similarity index 100% rename from PYTHON/tagDivider/LICENSE rename to python_pkg/tag_divider/LICENSE diff --git a/PYTHON/tagDivider/README.md b/python_pkg/tag_divider/README.md similarity index 100% rename from PYTHON/tagDivider/README.md rename to python_pkg/tag_divider/README.md diff --git a/PYTHON/tagDivider/__init__.py b/python_pkg/tag_divider/__init__.py similarity index 100% rename from PYTHON/tagDivider/__init__.py rename to python_pkg/tag_divider/__init__.py diff --git a/PYTHON/tagDivider/tagDivider.py b/python_pkg/tag_divider/tag_divider.py similarity index 100% rename from PYTHON/tagDivider/tagDivider.py rename to python_pkg/tag_divider/tag_divider.py