simplibs-guide 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simplibs_guide-0.1.0/LICENSE +21 -0
- simplibs_guide-0.1.0/PKG-INFO +465 -0
- simplibs_guide-0.1.0/README.md +435 -0
- simplibs_guide-0.1.0/pyproject.toml +117 -0
- simplibs_guide-0.1.0/setup.cfg +4 -0
- simplibs_guide-0.1.0/src/simplibs/guide/__init__.py +72 -0
- simplibs_guide-0.1.0/src/simplibs/guide/__main__.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/__init__.py +22 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/__init__.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/__init__.py +26 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/__init__.py +25 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/ask_for_confirmation.py +29 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/format_archive_report.py +35 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/format_batch_build_report.py +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/format_batch_report.py +42 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/format_findings.py +35 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/_tools/format_scaffold_report.py +46 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/run_check_command.py +46 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/run_create_bare_batch_command.py +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/run_create_batch_command.py +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/run_create_files_command.py +44 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/run_new_command.py +64 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/_runners/run_zip_command.py +44 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/build_parser.py +119 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/_helpers/silence_closed_stdout.py +32 -0
- simplibs_guide-0.1.0/src/simplibs/guide/cli/run_cli.py +54 -0
- simplibs_guide-0.1.0/src/simplibs/guide/exceptions/GuideError.py +72 -0
- simplibs_guide-0.1.0/src/simplibs/guide/exceptions/__init__.py +20 -0
- simplibs_guide-0.1.0/src/simplibs/guide/exceptions/_helpers/__init__.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/exceptions/_helpers/build_error_message.py +47 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/__init__.py +22 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/__init__.py +28 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/__init__.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/EXCLUDED_FILE_PATTERNS.py +13 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/EXCLUDED_FOLDERS.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/EXCLUDED_FOLDER_PATTERNS.py +13 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/EXCLUDED_ROOT_FILES.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/EXCLUDED_ROOT_FILE_PATTERNS.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/EXCLUDED_ROOT_FOLDERS.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/_constants/__init__.py +25 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/is_excluded_file.py +35 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_helpers/is_excluded_folder.py +36 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_validations/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_validations/validate_archive_folder_exists.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/_validations/validate_archive_output.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/archive_folder.py +71 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/collect_archive_files.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/types/ArchiveReport.py +28 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/archive_library/types/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/__init__.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/__init__.py +20 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/_constants/WORKING_ROOT_FILES.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/_constants/WORKING_ROOT_FILE_PATTERNS.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/_constants/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/is_working_file.py +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/make_finding.py +31 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/_commons/read_pyproject.py +33 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/__init__.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/CHECKED_DOCUMENTS.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/COMMENT_PATTERN.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/LICENSE_YEAR_PATTERN.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/PLACEHOLDER_PATTERN.py +22 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/PYTHON_PATTERNS.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/RELEASE_HEADING_PATTERN.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/TODO_PATTERN.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/TOKEN_LEFT_PATTERN.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_constants/__init__.py +29 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/__init__.py +25 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/_read_prose_lines.py +43 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/_slugify_heading.py +41 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/get_project_table.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/read_heading_anchors.py +45 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/read_markdown_links.py +45 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/resolve_link.py +45 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/_tools/scan_texts.py +54 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_files_exist.py +35 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_files_match_template.py +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_license_year_agrees.py +46 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_links_resolve.py +81 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_namespace_has_no_init.py +31 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_no_comments_left.py +34 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_no_placeholders_left.py +34 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_no_todo_left.py +30 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_no_tokens_left.py +30 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_python_agrees.py +69 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/checks/check_version_agrees.py +50 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/__init__.py +23 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_constants/DEFAULT_IGNORED_CHECKS.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_constants/IGNORABLE_CHECKS.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_constants/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_tools/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_tools/matches_glob.py +43 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_types/IgnoreRule.py +28 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_types/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_validations/__init__.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_validations/_raise_check_ignore_invalid_error.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/_validations/validate_ignore_rules.py +60 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/apply_ignore_rules.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/find_unused_ignore_rules.py +43 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/ignore_rules/read_ignore_rules.py +63 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/repository/__init__.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/repository/_constants/IGNORED_FOLDERS.py +22 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/repository/_constants/IGNORED_ROOT_FOLDERS.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/repository/_constants/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/repository/iter_repository_files.py +53 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_helpers/repository/read_repository_texts.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_validations/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/_validations/validate_library_folder_exists.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/check_library.py +78 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/constants/MANUAL_CHECKS.py +25 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/constants/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/types/Finding.py +26 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/check_library/types/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/__init__.py +20 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_constants/LIBRARY_PREFIX.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_constants/NAME_PATTERN.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_constants/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_validations/__init__.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_validations/_raise_invalid_name_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_validations/_raise_keyword_name_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_validations/_raise_missing_prefix_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/_validations/validate_library_folder_name.py +44 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/derive_library_names/derive_name_tokens.py +55 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/__init__.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_constants/PENDING_STATUS.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_constants/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_helpers/__init__.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_helpers/_validations/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_helpers/_validations/raise_manifest_missing_error.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_helpers/_validations/raise_manifest_unreadable_error.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_helpers/read_manifest_file.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/__init__.py +21 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_constants/TEMPLATE_KINDS.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_constants/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_raise_manifest_entry_error.py +41 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_raise_template_missing_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_validate_folder_entry.py +31 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_validate_relative_path.py +42 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/_validate_template_entry.py +67 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/_validations/validate_manifest_data.py +60 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/find_templates_root.py +25 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/load_manifest.py +53 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/types/Manifest.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/load_manifest/types/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/__init__.py +42 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/__init__.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/MARKER_PATTERN.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/__init__.py +20 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_constants/MARKER_LINE_REASON.py +13 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_constants/NOT_PYTHON_REASON.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_constants/NOT_TEXT_REASON.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_constants/__init__.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_tools/__init__.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_tools/is_within_depth.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_tools/make_batch_block.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_tools/read_batch_source.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_validations/__init__.py +21 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_validations/raise_batch_nothing_to_pack_error.py +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_validations/validate_batch_folder_exists.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_validations/validate_batch_max_depth.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/_validations/validate_batch_output.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/commons/pack_batch.py +131 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/__init__.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/_tools/__init__.py +21 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/_tools/find_comment_lines.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/_tools/find_python_docstrings.py +34 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/_tools/find_string_lines.py +31 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/_tools/layout_python_code.py +59 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_bare_batch/strip_python_source.py +75 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_files/__init__.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_files/_validations/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_files/_validations/raise_batch_missing_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_files/_validations/raise_batch_unreadable_error.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/create_files/read_batch_text.py +44 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/plan_batch/__init__.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/plan_batch/_validations/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/plan_batch/_validations/raise_batch_empty_error.py +30 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/plan_batch/_validations/raise_batch_root_not_allowed_error.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/plan_batch/parse_batch_path.py +55 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/plan_batch/split_batch.py +46 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/write_batch/__init__.py +15 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_helpers/write_batch/encode_content.py +23 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_validations/__init__.py +21 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_validations/raise_batch_duplicate_path_error.py +35 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_validations/raise_batch_path_invalid_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_validations/raise_batch_write_failed_error.py +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/_validations/validate_batch_destination.py +44 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/create_bare_batch.py +53 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/create_batch.py +43 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/create_files.py +52 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/plan_batch.py +46 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/types/BatchBuildReport.py +30 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/types/BatchReport.py +27 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/types/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/pack_and_unpack_batches/write_batch.py +65 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/__init__.py +31 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/__init__.py +21 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/_constants/ABOUT_SOURCE.py +14 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/_constants/TOKEN_PATTERN.py +16 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/_constants/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/_validations/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/_validations/raise_about_missing_error.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/_validations/raise_unknown_token_error.py +41 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/build_file_content.py +45 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/fill_tokens.py +42 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_helpers/read_about_text.py +37 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_validations/__init__.py +18 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_validations/_raise_target_conflict_error.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_validations/raise_write_failed_error.py +39 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/_validations/validate_no_target_conflicts.py +55 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/plan_scaffold.py +58 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/scaffold_library.py +49 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/types/ScaffoldPlan.py +26 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/types/ScaffoldReport.py +26 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/types/__init__.py +17 -0
- simplibs_guide-0.1.0/src/simplibs/guide/logic/scaffold_library/write_scaffold.py +79 -0
- simplibs_guide-0.1.0/src/simplibs/guide/py.typed +0 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/MANIFEST.toml +109 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/__init__.py +19 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/.gitattributes.tmpl +7 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/.gitignore.tmpl +57 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/ABOUT_SIMPLIBS.md.tmpl +40 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/CHANGELOG.md.tmpl +56 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/LICENSE.tmpl +21 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/README_MAIN.md.tmpl +243 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/__init__.py.tmpl +28 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/pyproject.toml.tmpl +78 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/test_architecture.py.tmpl +146 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/test_public_api.py.tmpl +91 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/files/tests.yml.tmpl +38 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/scripts/create_bare_batch.py.tmpl +228 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/scripts/create_batch.py.tmpl +120 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/scripts/create_code_zip.py.tmpl +77 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/scripts/create_files.py.tmpl +88 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/scripts/create_files_batch.txt.tmpl +12 -0
- simplibs_guide-0.1.0/src/simplibs/guide/templates/scripts/fix_line_endings.py.tmpl +96 -0
- simplibs_guide-0.1.0/src/simplibs_guide.egg-info/PKG-INFO +465 -0
- simplibs_guide-0.1.0/src/simplibs_guide.egg-info/SOURCES.txt +244 -0
- simplibs_guide-0.1.0/src/simplibs_guide.egg-info/dependency_links.txt +1 -0
- simplibs_guide-0.1.0/src/simplibs_guide.egg-info/entry_points.txt +2 -0
- simplibs_guide-0.1.0/src/simplibs_guide.egg-info/requires.txt +4 -0
- simplibs_guide-0.1.0/src/simplibs_guide.egg-info/top_level.txt +1 -0
- simplibs_guide-0.1.0/tests/test___main__.py +52 -0
- simplibs_guide-0.1.0/tests/test_architecture.py +145 -0
- simplibs_guide-0.1.0/tests/test_public_api.py +141 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dalibor Sova (Sudip2708)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simplibs-guide
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The guides, templates and tools for building a library of the simplibs system: set up a new library and check it before the upload.
|
|
5
|
+
Author-email: "Dalibor Sova (Sudip2708)" <daliborsova@seznam.cz>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/simplibs/simplibs-guide
|
|
8
|
+
Project-URL: Repository, https://github.com/simplibs/simplibs-guide
|
|
9
|
+
Project-URL: Issues, https://github.com/simplibs/simplibs-guide/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/simplibs/simplibs-guide/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: library-template,project-scaffold,project-structure,code-style,documentation,checks,simplibs,simplibs-guide,developer-tools
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=9.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# 🏗️ `simplibs-guide`
|
|
32
|
+
|
|
33
|
+
[](https://pypi.org/project/simplibs-guide/)
|
|
34
|
+
[](https://www.python.org/downloads/)
|
|
35
|
+
[](https://github.com/simplibs/simplibs-guide/blob/main/LICENSE)
|
|
36
|
+
[](https://github.com/simplibs/simplibs-guide/actions)
|
|
37
|
+
|
|
38
|
+
**One command makes the files of a new library, and one command lists what is not ready for the upload.**
|
|
39
|
+
|
|
40
|
+
`simplibs-guide` is the ground of the simplibs system, level 00. It holds the guides that say how a
|
|
41
|
+
library of the system is made, and the tools that apply them: a generator that makes the files of a new
|
|
42
|
+
library from the templates, a check that compares a folder with those templates and with the facts of the
|
|
43
|
+
checklist, and small helpers for handing files over (a zip, a batch of files written as one text, and a folder packed into a batch).
|
|
44
|
+
The guides, the templates and the tools read the same `MANIFEST.toml`, so what a guide says is what the
|
|
45
|
+
generator makes and what the check looks for. No other library imports it: it is used at the command
|
|
46
|
+
line, and the functions behind the commands are there for scripts.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
simplibs-guide new simplibs-text # the files of a new library, made from the templates
|
|
50
|
+
simplibs-guide check simplibs-text # what is not ready for the upload, and where
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from pathlib import Path
|
|
55
|
+
from simplibs.guide import check_library
|
|
56
|
+
|
|
57
|
+
findings = check_library(Path("simplibs-text"))
|
|
58
|
+
findings[0]["id"] # -> 'todo-left:CHANGELOG.md'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> `simplibs-guide` stands before [`simplibs-exception`](https://pypi.org/project/simplibs-exception/) and has
|
|
62
|
+
> no dependency, so its one error, `GuideError`, is a plain error with the same shape of message and not a
|
|
63
|
+
> card of that library.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🧭 The Core Philosophy
|
|
68
|
+
|
|
69
|
+
A guide for building libraries usually lives in a wiki or in the history of a chat, and a template lives in a
|
|
70
|
+
copy of the last library. Both drift: the guide says one thing, the last library did another, and nobody knows
|
|
71
|
+
which is right until the upload fails. `simplibs-guide` takes those traps seriously:
|
|
72
|
+
|
|
73
|
+
* **One source for the guide, the generator and the check.** `MANIFEST.toml` lists every file of the skeleton.
|
|
74
|
+
The generator makes them, the check compares them, and the guide describes them, so none of the three can
|
|
75
|
+
drift away from the others unnoticed.
|
|
76
|
+
* **A tool that only looks, changes nothing.** `check` reads and reports. `new` and `zip` say what they would
|
|
77
|
+
do with `--dry-run`, and `new` skips a file that exists unless `--force` is given.
|
|
78
|
+
* **Nothing is written before everything is valid.** A batch with one wrong path writes no file, and a plan
|
|
79
|
+
that clashes with the disk writes none.
|
|
80
|
+
* **An exception is a rule with a reason.** What the author leaves out of the checks is written in
|
|
81
|
+
`pyproject.toml` with its reason, and a rule that matches no file is itself a finding.
|
|
82
|
+
* **Every failure advises.** A `GuideError` says what happened, which value failed, what was expected and what
|
|
83
|
+
to do next.
|
|
84
|
+
* **Everything is also a function.** Each command is a function of the root. The command prints the result and
|
|
85
|
+
turns an error into the exit code `1`.
|
|
86
|
+
* **Layers that only look left.** `exceptions` ← `derive_library_names`, `load_manifest`, `archive_library` ← `pack_and_unpack_batches`
|
|
87
|
+
← `scaffold_library` ← `check_library` ← `cli` — every layer imports only from those before it.
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from simplibs.guide import plan_batch
|
|
91
|
+
|
|
92
|
+
plan_batch("# >>> ../outside.txt\nx\n") # -> raises: GUIDE_BATCH_PATH_INVALID_ERROR, the path leaves the folder
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 📦 Installation
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install simplibs-guide
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Requires Python 3.11+. The library has no runtime dependency. It installs the command `simplibs-guide`,
|
|
104
|
+
which `python -m simplibs.guide` starts as well.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 🚀 Quick Start in 60 Seconds
|
|
109
|
+
|
|
110
|
+
### Level 1: Make a new library
|
|
111
|
+
|
|
112
|
+
The command and the function do the same; use one of them, because the second run skips every file that exists.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
simplibs-guide new simplibs-text # asks once; --yes does not, --dry-run only lists
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from pathlib import Path
|
|
120
|
+
from simplibs.guide import scaffold_library
|
|
121
|
+
|
|
122
|
+
report = scaffold_library(Path("simplibs-text")) # the name of the folder is the name of the library
|
|
123
|
+
"README.md" in report["created"] # -> True
|
|
124
|
+
report["skipped"] # -> [] (a file that exists is skipped, unless force=True)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Level 2: List what is not ready
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
simplibs-guide check simplibs-text # nothing is changed; exit code 1 when something is found
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from pathlib import Path
|
|
135
|
+
from simplibs.guide import check_library
|
|
136
|
+
|
|
137
|
+
findings = check_library(Path("simplibs-text"))
|
|
138
|
+
sorted({finding["check"] for finding in findings}) # -> ['comment-left', 'placeholder-left', 'todo-left']
|
|
139
|
+
findings[0]["id"] # -> 'todo-left:CHANGELOG.md'
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Level 3: Hand files over
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
simplibs-guide zip simplibs-text # the zip without what git leaves out
|
|
146
|
+
simplibs-guide create-batch simplibs-text # simplibs-text_batch.txt: the whole folder as one text
|
|
147
|
+
simplibs-guide create-bare-batch simplibs-text # only the Python code, without comments, to be read
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
from pathlib import Path
|
|
152
|
+
from simplibs.guide import archive_folder, plan_batch, write_batch
|
|
153
|
+
|
|
154
|
+
report = archive_folder(Path("simplibs-text"), dry_run=True) # the zip without what git leaves out
|
|
155
|
+
report["written"], ".gitignore" in report["files"] # -> (False, True)
|
|
156
|
+
|
|
157
|
+
plan = plan_batch("# >>> notes/a.txt\nhello\n# >>> b.txt\nworld\n") # one text, two files
|
|
158
|
+
plan # -> {'notes/a.txt': 'hello', 'b.txt': 'world'}
|
|
159
|
+
write_batch(Path("out"), plan, dry_run=True)["files"] # -> ['notes/a.txt', 'b.txt']
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The other way round, a folder becomes one batch, whole or only its Python code:
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
from pathlib import Path
|
|
166
|
+
from simplibs.guide import create_batch, create_bare_batch
|
|
167
|
+
|
|
168
|
+
report = create_batch(Path("simplibs-text"), dry_run=True) # the whole folder as one text
|
|
169
|
+
len(report["files"]), report["skipped"] # -> (11, {})
|
|
170
|
+
create_bare_batch(Path("simplibs-text"), dry_run=True)["files"] # -> ['src/simplibs/text/__init__.py', 'tests/test_architecture.py', 'tests/test_public_api.py']
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Level 4: Names and safety
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from simplibs.guide import GuideError, derive_name_tokens, plan_batch
|
|
177
|
+
|
|
178
|
+
derive_name_tokens("simplibs-text-case") # -> {'NAME': 'text-case', 'IMPORT': 'text_case', 'UPPER': 'TEXT_CASE'}
|
|
179
|
+
|
|
180
|
+
try:
|
|
181
|
+
plan_batch("no marker line, so no file")
|
|
182
|
+
except GuideError as error:
|
|
183
|
+
error.error_name # -> 'GUIDE_BATCH_EMPTY_ERROR'
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 🛠️ Architecture & Package Structure
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
src/simplibs/guide/
|
|
192
|
+
├── __init__.py ◄── the functions and the types of the tools
|
|
193
|
+
├── __main__.py ◄── python -m simplibs.guide
|
|
194
|
+
├── cli/ ◄── the command line: new, check, zip, create-files, create-batch, create-bare-batch
|
|
195
|
+
├── exceptions/ ◄── GuideError, the one error
|
|
196
|
+
├── logic/ ◄── what the tools do; each folder is named by what it does
|
|
197
|
+
│ ├── archive_library/ ◄── pack a folder into a zip
|
|
198
|
+
│ ├── check_library/ ◄── list what is not ready for the upload
|
|
199
|
+
│ ├── derive_library_names/ ◄── the shapes of the name of a library
|
|
200
|
+
│ ├── load_manifest/ ◄── read MANIFEST.toml (internal)
|
|
201
|
+
│ ├── pack_and_unpack_batches/ ◄── make the files of a batch, and pack a folder into one
|
|
202
|
+
│ └── scaffold_library/ ◄── make the files of a new library
|
|
203
|
+
└── templates/ ◄── MANIFEST.toml, the templates and the scripts (data)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The root exports the functions and the types that appear in their signatures. The command line is started by
|
|
207
|
+
the command, not imported, and the manifest is the file of the tools themselves, so neither is exported:
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
from simplibs.guide import check_library, scaffold_library, GuideError # functions and the error
|
|
211
|
+
from simplibs.guide import Finding, ScaffoldReport # types of the answers
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 🖥️ `cli/` — The command `simplibs-guide`
|
|
217
|
+
|
|
218
|
+
One command with six subcommands. Each prints what it did, asks before it writes when a whole library is made,
|
|
219
|
+
and ends with the exit code `0`, or `1` for an error, for a finding of `check` and for a closed pipe.
|
|
220
|
+
|
|
221
|
+
| Command | Description / Parameters |
|
|
222
|
+
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
223
|
+
| `new` | Makes the files of a new library; the name of the folder is the name of the library (`folder`, `--yes`, `--dry-run`, `--force`). |
|
|
224
|
+
| `check` | Lists what is not ready for the upload; nothing is changed (`folder`). |
|
|
225
|
+
| `zip` | Packs a folder into a zip without what git leaves out (`folder`, `--output`, `--dry-run`). |
|
|
226
|
+
| `create-files` | Makes the files of a batch; the batch is always named (`batch`, `--folder`, `--only`, `--dry-run`). |
|
|
227
|
+
| `create-batch` | Packs the text files of a folder into one batch (`folder`, `--output`, `--max-depth`, `--dry-run`). |
|
|
228
|
+
| `create-bare-batch` | Packs only the Python code of a folder into one batch, without comments, docstrings and design notes, to be read (`folder`, `--output`, `--max-depth`, `--dry-run`). |
|
|
229
|
+
|
|
230
|
+
➡️ [README_GUIDE_CLI](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/README_GUIDE_CLI.md)
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 🔧 `logic/` — What the tools do
|
|
235
|
+
|
|
236
|
+
Each tool has a folder of its own, and each folder has a section below. A function plans first and writes
|
|
237
|
+
second, so that a mistake is found before a file is touched.
|
|
238
|
+
|
|
239
|
+
| Folder | What it does |
|
|
240
|
+
|----------------------------|---------------------------------------------------------------------------------------|
|
|
241
|
+
| `scaffold_library/` | Makes the files of a new library from the templates. |
|
|
242
|
+
| `check_library/` | Lists what is not ready for the upload. |
|
|
243
|
+
| `archive_library/` | Packs a folder into a zip. |
|
|
244
|
+
| `pack_and_unpack_batches/` | Makes the files of a batch, and packs a folder into one. |
|
|
245
|
+
| `derive_library_names/` | Turns the name of a library folder into the shapes of its name. |
|
|
246
|
+
| `load_manifest/` | Reads `MANIFEST.toml`, the list of the files of the skeleton; internal, not exported. |
|
|
247
|
+
|
|
248
|
+
-------------|---------------------------------------------------------------------------------------|
|
|
249
|
+
| `scaffold/` | Makes the files of a new library from the templates. |
|
|
250
|
+
| `check/` | Lists what is not ready for the upload. |
|
|
251
|
+
| `archive/` | Packs a folder into a zip. |
|
|
252
|
+
| `batch/` | Makes the files of a batch, and packs a folder into one. |
|
|
253
|
+
| `names/` | Turns the name of a library folder into the shapes of its name. |
|
|
254
|
+
| `manifest/` | Reads `MANIFEST.toml`, the list of the files of the skeleton; internal, not exported. |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 🏭 `logic/scaffold_library/` — Make a new library
|
|
259
|
+
|
|
260
|
+
The name of the folder is the name of the library (`simplibs-` and its name), and the files are made from
|
|
261
|
+
the templates that `MANIFEST.toml` lists. A file that exists is skipped, unless `force` is given.
|
|
262
|
+
|
|
263
|
+
| Function | Description / Parameters |
|
|
264
|
+
|--------------------|------------------------------------------------------------------------------------------------|
|
|
265
|
+
| `plan_scaffold` | Builds the plan of a new library: its folders and the content of its files (`folder_name`, `year`, `templates_root=None`). |
|
|
266
|
+
| `scaffold_library` | Makes the files of a new library in a folder (`folder`, keyword-only: `force=False`, `dry_run=False`, `year=None`, `templates_root=None`). |
|
|
267
|
+
| `write_scaffold` | Writes a plan into a folder (`root`, `plan`, keyword-only: `force=False`, `dry_run=False`). |
|
|
268
|
+
|
|
269
|
+
| Type | Description |
|
|
270
|
+
|------------------|--------------------------------------------------------------------------|
|
|
271
|
+
| `ScaffoldPlan` | The folders and the content of the files that are going to be made. |
|
|
272
|
+
| `ScaffoldReport` | The folders and the files that were created, overwritten or skipped. |
|
|
273
|
+
|
|
274
|
+
➡️ [README_GUIDE_SCAFFOLD_LIBRARY](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/logic/README_GUIDE_SCAFFOLD_LIBRARY.md)
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 🔍 `logic/check_library/` — List what is not ready
|
|
279
|
+
|
|
280
|
+
Eleven checks run on a folder: the files of the skeleton that are missing or changed, a token, a `TODO`
|
|
281
|
+
marker, a comment or a placeholder that was left in a file, facts that two files say differently (the
|
|
282
|
+
version, the Python, the year of the licence), and a Markdown link that leads nowhere. The author leaves a
|
|
283
|
+
file out of a check with a rule and a reason in `pyproject.toml`; a rule that matches no file is a finding too.
|
|
284
|
+
|
|
285
|
+
| Function | Description / Parameters |
|
|
286
|
+
|-----------------|---------------------------------------------------------------------------------------|
|
|
287
|
+
| `check_library` | Runs every check on the folder of a library (`folder`, keyword-only: `templates_root=None`). |
|
|
288
|
+
|
|
289
|
+
| Type | Description |
|
|
290
|
+
|-----------|-------------------------------------------------------------------------|
|
|
291
|
+
| `Finding` | One thing that is not ready: its `id`, its `check`, its `path` and a `message`. |
|
|
292
|
+
|
|
293
|
+
➡️ [README_GUIDE_CHECK_LIBRARY](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/logic/README_GUIDE_CHECK_LIBRARY.md)
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## 🗜️ `logic/archive_library/` — Pack a folder
|
|
298
|
+
|
|
299
|
+
The zip holds what git would keep: the folders that are not part of the repository (`.git`, `.venv`, the
|
|
300
|
+
caches) and the working files are left out. The paths in the zip start in the folder itself.
|
|
301
|
+
|
|
302
|
+
| Function | Description / Parameters |
|
|
303
|
+
|------------------|------------------------------------------------------------------------------------------|
|
|
304
|
+
| `archive_folder` | Packs a folder into a zip, or only lists what would be packed (`folder`, keyword-only: `output=None`, `dry_run=False`). |
|
|
305
|
+
|
|
306
|
+
| Type | Description |
|
|
307
|
+
|-----------------|----------------------------------------------------------------------------|
|
|
308
|
+
| `ArchiveReport` | The folder, the zip, the files, whether it was written and its size in KB. |
|
|
309
|
+
|
|
310
|
+
➡️ [README_GUIDE_ARCHIVE_LIBRARY](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/logic/README_GUIDE_ARCHIVE_LIBRARY.md)
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 🗂️ `logic/pack_and_unpack_batches/` — Make the files of a batch
|
|
315
|
+
|
|
316
|
+
A batch is one text in which every file starts with a line `# >>> relative/path`. Every path is checked
|
|
317
|
+
before the first file is written, so one wrong path stops everything.
|
|
318
|
+
The other way round, a folder is packed into a batch, whole or only its Python code; what is left out is named with its reason.
|
|
319
|
+
|
|
320
|
+
| Function | Description / Parameters |
|
|
321
|
+
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
322
|
+
| `plan_batch` | Cuts a batch into the files it holds (`text`, keyword-only: `allowed_roots=()`). |
|
|
323
|
+
| `write_batch` | Writes the files of a plan into a folder (`root`, `plan`, keyword-only: `dry_run=False`). |
|
|
324
|
+
| `create_files` | Reads a batch file and makes its files in a folder (`folder`, `batch`, keyword-only: `dry_run=False`, `allowed_roots=()`). |
|
|
325
|
+
| `create_batch` | Packs the text files of a folder into one batch, or only lists them (`folder`, keyword-only: `output=None`, `dry_run=False`, `max_depth=None`). |
|
|
326
|
+
| `create_bare_batch` | Packs only the Python code of a folder into one batch, without comments, docstrings and design notes, to be read (`folder`, keyword-only: `output=None`, `dry_run=False`, `max_depth=None`). |
|
|
327
|
+
|
|
328
|
+
| Type | Description |
|
|
329
|
+
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|
|
330
|
+
| `BatchReport` | The folder, the files, which of them were overwritten, and whether they were written. |
|
|
331
|
+
| `BatchBuildReport` | The folder, the batch, the packed files, the files that were left out with the reason, whether it was written and its size in KB. |
|
|
332
|
+
|
|
333
|
+
➡️ [README_GUIDE_PACK_AND_UNPACK_BATCHES](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/logic/README_GUIDE_PACK_AND_UNPACK_BATCHES.md)
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## 🔤 `logic/derive_library_names/` — The shapes of a name
|
|
338
|
+
|
|
339
|
+
One name has three shapes: the name of the folder (`simplibs-text-case`), the name that stands after the prefix
|
|
340
|
+
(`text-case`) and the name of the import (`text_case`).
|
|
341
|
+
|
|
342
|
+
| Function | Description / Parameters |
|
|
343
|
+
|----------------------|-------------------------------------------------------------------------------------------|
|
|
344
|
+
| `derive_name_tokens` | Turns the name of a library folder into the three shapes of its name (`folder_name`). |
|
|
345
|
+
|
|
346
|
+
➡️ [README_GUIDE_DERIVE_LIBRARY_NAMES](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/logic/README_GUIDE_DERIVE_LIBRARY_NAMES.md)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 📚 The Guides
|
|
351
|
+
|
|
352
|
+
The texts of the guides are the other half of the library. They are in the repository, in `docs/`, and
|
|
353
|
+
they are not part of the package.
|
|
354
|
+
|
|
355
|
+
| Guide | What it answers |
|
|
356
|
+
|----------------------------|---------------------------------------------------------------------------|
|
|
357
|
+
| [Index](https://github.com/simplibs/simplibs-guide/blob/main/docs/README_GUIDE.md) | where to start, the levels of the libraries, and how a library is made in three threads |
|
|
358
|
+
| [Code](https://github.com/simplibs/simplibs-guide/blob/main/docs/code/README_GUIDE_CODE.md) | how the code of a library is written: files, imports, functions, classes, errors |
|
|
359
|
+
| [Tests](https://github.com/simplibs/simplibs-guide/blob/main/docs/tests/README_GUIDE_TESTS.md) | what the tests of a library hold and when they are done |
|
|
360
|
+
| [README](https://github.com/simplibs/simplibs-guide/blob/main/docs/readme/README_GUIDE_MAIN_README.md) | how the main README and the helper READMEs are written |
|
|
361
|
+
| [Structure](https://github.com/simplibs/simplibs-guide/blob/main/docs/structure/README_GUIDE_STRUCTURE.md) | which files a library has, how they are named and filled in |
|
|
362
|
+
| [Release](https://github.com/simplibs/simplibs-guide/blob/main/docs/structure/README_GUIDE_RELEASE.md) | how a library gets to GitHub and PyPI |
|
|
363
|
+
| [Workflow](https://github.com/simplibs/simplibs-guide/blob/main/docs/collaboration/README_GUIDE_WORKFLOW.md) | how files are handed over and changed |
|
|
364
|
+
| [Sets](https://github.com/simplibs/simplibs-guide/blob/main/docs/zips/README_ZIPS.md) | three ready zips of the guide, one for each thread of a library: code, tests and documentation |
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## 🌍 Pipes, Windows and Line Endings
|
|
369
|
+
|
|
370
|
+
* **A closed pipe is not a crash.** `simplibs-guide check | head` ends with the exit code `1` and without a
|
|
371
|
+
traceback.
|
|
372
|
+
* **Paths are written with `/`.** The scripts that `new` leaves in `__DOC__/_tools/` print them so on Windows too.
|
|
373
|
+
* **The repository is kept on LF.** `new` makes `.gitattributes` for it. A folder that already holds files with
|
|
374
|
+
CRLF needs `git add --renormalize .` once, after the file is there, in a commit of its own; `_fix_line_endings.py`
|
|
375
|
+
in `__DOC__/_tools/` turns the CRLF of the files on the disk into LF.
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## ⚠️ Exceptions
|
|
380
|
+
|
|
381
|
+
The library defines one error, `GuideError`, and no other. It carries the parts of the failure
|
|
382
|
+
(`error_name`, `what`, `value`, `expected`, `how_to_fix`) and the commands print its text as it is. The name
|
|
383
|
+
of an error is `GUIDE_`, the folder it comes from, what happened, and `_ERROR`; a test compares the name
|
|
384
|
+
and not the sentence.
|
|
385
|
+
|
|
386
|
+
| Error name | Raised by | Raised when |
|
|
387
|
+
|------------|-----------|-------------|
|
|
388
|
+
| `GUIDE_ARCHIVE_FOLDER_MISSING_ERROR` | `archive_folder` | The folder to pack does not exist or is not a folder |
|
|
389
|
+
| `GUIDE_ARCHIVE_OUTPUT_IS_FOLDER_ERROR` | `archive_folder` | The path of the zip to write is a folder |
|
|
390
|
+
| `GUIDE_BATCH_MISSING_ERROR` | `create_files` | The batch file does not exist |
|
|
391
|
+
| `GUIDE_BATCH_UNREADABLE_ERROR` | `create_files` | The batch file cannot be read, or is not UTF-8 |
|
|
392
|
+
| `GUIDE_BATCH_EMPTY_ERROR` | `plan_batch` | The text has no marker line, so it holds no file |
|
|
393
|
+
| `GUIDE_BATCH_PATH_INVALID_ERROR` | `plan_batch`, `write_batch` | A path cannot be used: it leaves the folder, names no file, or clashes with the disk |
|
|
394
|
+
| `GUIDE_BATCH_ROOT_NOT_ALLOWED_ERROR` | `plan_batch` | A path does not start in an allowed folder |
|
|
395
|
+
| `GUIDE_BATCH_DUPLICATE_PATH_ERROR` | `plan_batch` | One path is listed twice |
|
|
396
|
+
| `GUIDE_BATCH_WRITE_FAILED_ERROR` | `write_batch`, `create_batch`, `create_bare_batch` | The disk does not let the files or the batch be written |
|
|
397
|
+
| `GUIDE_BATCH_FOLDER_MISSING_ERROR` | `create_batch`, `create_bare_batch` | The folder to pack does not exist or is not a folder |
|
|
398
|
+
| `GUIDE_BATCH_OUTPUT_IS_FOLDER_ERROR` | `create_batch`, `create_bare_batch` | The path of the batch to write is a folder |
|
|
399
|
+
| `GUIDE_BATCH_MAX_DEPTH_INVALID_ERROR` | `create_batch`, `create_bare_batch` | The depth is below zero |
|
|
400
|
+
| `GUIDE_BATCH_NOTHING_TO_PACK_ERROR` | `create_batch`, `create_bare_batch` | No file is left to pack (a real run; a preview lists what was left out) |
|
|
401
|
+
| `GUIDE_CHECK_FOLDER_MISSING_ERROR` | `check_library` | The folder to check does not exist or is not a folder |
|
|
402
|
+
| `GUIDE_CHECK_IGNORE_INVALID_ERROR` | `check_library` | The rules of `[tool.simplibs-guide.check]` in `pyproject.toml` are not valid |
|
|
403
|
+
| `GUIDE_MANIFEST_MISSING_ERROR` | `load_manifest` | `MANIFEST.toml` of the templates does not exist |
|
|
404
|
+
| `GUIDE_MANIFEST_UNREADABLE_ERROR` | `load_manifest` | `MANIFEST.toml` cannot be read: it is not UTF-8 or not valid TOML |
|
|
405
|
+
| `GUIDE_MANIFEST_ENTRY_ERROR` | `load_manifest` | `MANIFEST.toml` breaks a rule; the message names the entry and the rule |
|
|
406
|
+
| `GUIDE_MANIFEST_TEMPLATE_MISSING_ERROR` | `load_manifest` | A template that `MANIFEST.toml` lists is not in the package |
|
|
407
|
+
| `GUIDE_NAMES_MISSING_PREFIX_ERROR` | `derive_name_tokens` | The value is not a text, or does not start with `simplibs-` |
|
|
408
|
+
| `GUIDE_NAMES_INVALID_NAME_ERROR` | `derive_name_tokens` | The part after the prefix is empty or breaks the rules of the name |
|
|
409
|
+
| `GUIDE_NAMES_KEYWORD_NAME_ERROR` | `derive_name_tokens` | The import name is a Python keyword |
|
|
410
|
+
| `GUIDE_SCAFFOLD_UNKNOWN_TOKEN_ERROR` | `plan_scaffold` | A template or a target uses a token that is not on the list |
|
|
411
|
+
| `GUIDE_SCAFFOLD_ABOUT_MISSING_ERROR` | `plan_scaffold` | The template of the token `ABOUT` does not exist |
|
|
412
|
+
| `GUIDE_SCAFFOLD_TARGET_CONFLICT_ERROR` | `write_scaffold` | A path of the plan clashes with something on the disk |
|
|
413
|
+
| `GUIDE_SCAFFOLD_WRITE_FAILED_ERROR` | `write_scaffold` | The disk does not let the library be written |
|
|
414
|
+
|
|
415
|
+
➡️ [README_GUIDE_EXCEPTIONS](https://github.com/simplibs/simplibs-guide/blob/main/docs/src/README_GUIDE_EXCEPTIONS.md)
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## 🔗 Related libraries
|
|
420
|
+
|
|
421
|
+
* **[`simplibs-exception`](https://pypi.org/project/simplibs-exception/)** — the error cards of the system.
|
|
422
|
+
`GuideError` has the same parts but stands before it, so it does not import it.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## ☯️ About simplibs
|
|
427
|
+
|
|
428
|
+
All libraries in the **simplibs** (Simple Libraries) ecosystem share a common
|
|
429
|
+
engineering philosophy:
|
|
430
|
+
|
|
431
|
+
* **Dyslexia-friendly:**
|
|
432
|
+
We actively minimize cognitive load. Code is atomized into small, self-contained units,
|
|
433
|
+
files are named directly after the logical task they perform, and explanations describe
|
|
434
|
+
*why* something is designed, not just *what* it is.
|
|
435
|
+
* **Programmer's Zen:**
|
|
436
|
+
Nothing should be missing, and nothing should be superfluous. We value clean execution
|
|
437
|
+
paths and robust, understandable code architectures over rushed, messy feature sets.
|
|
438
|
+
* **Defensive Style:**
|
|
439
|
+
We actively anticipate edge cases and failure modes so that only safe operational paths
|
|
440
|
+
remain. Our code is built to degrade gracefully rather than crash unexpectedly.
|
|
441
|
+
* **Minimalism:**
|
|
442
|
+
Find the most direct path to the goal in as few operational steps as possible without
|
|
443
|
+
taking shortcuts on safety, readability, or completeness.
|
|
444
|
+
* **Code as Craft:**
|
|
445
|
+
Code should be pleasant to look at, readable at a glance, and evoke structural harmony.
|
|
446
|
+
We treat software engineering as a precision trade.
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
### 🤝 Contributing & Community
|
|
451
|
+
|
|
452
|
+
This is an **open-source project** built with love and care. We strongly believe in
|
|
453
|
+
community collaboration and welcome any feedback, bug reports, or feature ideas!
|
|
454
|
+
|
|
455
|
+
* **Want to contribute?** Feel free to open an Issue or submit a Pull Request.
|
|
456
|
+
* **Want to get in touch?** If you'd like to discuss the project further, collaborate,
|
|
457
|
+
or just say hello, feel free to open a GitHub Issue or start a Discussion.
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
### 📝 License
|
|
462
|
+
|
|
463
|
+
This library is released under the **MIT License**. Build great things!
|
|
464
|
+
|
|
465
|
+
---
|