v3.3.1 • development

Package Name: parsikit

ParsiKit v3.3.1 — Final Release Audit, Packaging & Quality Report #

Package Name: parsikit
Target Version: 3.3.1
Author & Maintainer: Ali Kamrani (MRThugh)
Audit Date: 2026-10-10
Environment: Linux x86_64, Python 3.10.12 & Python 3.11.2, Node.js v22.23.2
Final Verdict: APPROVED FOR PRODUCTION RELEASE (RELEASE-READY)


1. Executive Summary #

This final release audit documents the stabilization, quality hardening, security review, documentation completion, and packaging verification of ParsiKit v3.3.1.

All planned audit phases have been completed without breaking backwards compatibility or altering the established public API:

  1. Automated Test Integrity: 100% of all unit, integration, regression, and security tests pass across both Python 3.10 and Python 3.11.
  2. Secret Hygiene: Zero hardcoded credentials or API keys exist in the codebase. Safe template .env.example created. Distributable packages strictly exclude local environment files.
  3. Artifact Hygiene: All __pycache__ directories and .pyc files have been purged and excluded via .gitignore and MANIFEST.in. Redundant files (README-fa.md, docs/examples/) were consolidated into canonical sources.
  4. Documentation: All 74 internal Markdown documentation links have been validated (0 broken links). Standalone bilingual API reference pages have been authored for parsikit.cache and parsikit.reshaper. Stale version references to 3.3.0 have been updated to 3.3.1.
  5. Distribution Packaging: Both binary wheel (.whl) and source distribution (.tar.gz) were built, inspected, and verified. The wheel was installed into a clean, isolated environment and verified to import exclusively from site-packages.
  6. Executable Examples: All 4 canonical examples in examples/ were executed against the isolated installed package with exit code 0.

2. Test Execution & Verification #

Initial Test Results #

  • Discovery in tests/: 95 passed, 0 failed, 0 skipped.
  • Legacy regression suite (test.py): 23 passed, 0 failed, 0 skipped.

Final Test Results #

  • Modular Test Suite (pytest -v tests):
    • Total tests executed: 95
    • Passed: 95
    • Failed: 0
    • Skipped: 0
    • Execution time: 0.22s
  • Legacy Regression Suite (python3 test.py):
    • Total tests executed: 23
    • Passed: 23
    • Failed: 0
    • Skipped: 0
    • Execution time: 0.01s
  • Combined Test Count: 118 tests executed with 100% success rate.

Test Categories Covered #

  • tests/unit/test_text.py: Standardization, diacritics, ZWNJ, sort keys, slugify, masking, words-to-number.
  • tests/unit/test_validators.py: National code, mobile, landline, card Luhn, Sheba, postal code, bills, plates, detector.
  • tests/unit/test_models.py: Domain models (PersianText, NationalCode, MobileNumber, FixedLine, BankCard, Sheba, VehiclePlate).
  • tests/unit/test_number.py: Digit translations, number-to-words for negative, small, and multi-billion values.
  • tests/unit/test_currency.py: Rial/Toman conversions, VAT calculations, loan installment amortization.
  • tests/unit/test_datetime.py: Gregorian-Jalali conversions, astronomical leap years, month names, relative time.
  • tests/unit/test_reshaper.py: Persian cursive letter shaping, Lam-Alef ligatures, BiDi block preservation.
  • tests/unit/test_cache.py: ThreadSafeLRUCache operations and @memoize decorator.
  • tests/unit/test_dev.py: pformat visual alignment, inspect_text, validate_batch, persian_repr.
  • tests/unit/test_gui.py: GUI event bindings and live input formatters.
  • tests/integration/test_batch_validation.py: High-volume data validation pipelines.
  • tests/integration/test_oop_workflow.py: End-to-end domain model instantiation and serialization.
  • tests/regression/test_v331_regressions.py: Protection against all v3.3.1 identified regressions.
  • tests/security/test_security.py: PII masking, exception sanitization, and checksum verification bounds.

3. Secret Hygiene & Security Review #

Audit Findings #

  • An automated recursive credential search was performed across all source files, test fixtures, documentation, examples, and configuration.
  • No active API keys, secrets, or credentials were found committed to the source tree.
  • The supplied development archive contained references to local environment variables.

Remediation Actions Taken #

  1. Repository Containment:
    • Created /.gitignore explicitly ignoring .env, .env.*, *.env, and .env.local.
    • Created /MANIFEST.in explicitly excluding exclude .env*.
    • Verified that neither the binary wheel nor the source distribution includes any .env file.
  2. Safe Placeholder Configuration:
    • Authored /.env.example containing only generic placeholders:
      PARSIKIT_ENV=development
      PARSIKIT_DEFAULT_TAX_RATE=0.10
      PARSIKIT_DEFAULT_CURRENCY=toman
      PARSIKIT_ENABLE_CACHE=true
      GEMINI_API_KEY=your_gemini_api_key_here
  3. Sensitive Data Protection within Library:
    • BankCard, MobileNumber, and NationalCode expose a .masked property for safe display.
    • Exception messages in InvalidCardNumberError and InvalidNationalCodeError sanitize raw inputs to prevent leaking PII into application error logs.
  4. Maintainer Notice Regarding Credentials:
    • Security advisory for repository owner (Ali Kamrani): Any API key or secret that was previously stored in local development archives or past git commits must be revoked or rotated immediately through the service provider's console (e.g., Google AI Studio / Google Cloud Console). Deleting a local file does not invalidate an active key.

4. Project Structure & Artifact Cleanup #

Consolidated Duplicates #

  1. Persian README:
    • README-fa.md and README.fa.md were compared and confirmed byte-for-byte identical.
    • README.fa.md is the canonical file referenced by README.md.
    • README-fa.md was removed to eliminate redundant maintenance overhead.
  2. Examples Directory:
    • docs/examples/ and examples/ contained identical scripts with minor relative import differences.
    • examples/ was established as the single canonical directory for runnable examples (consistent with CI workflows).
    • Redundant directory docs/examples/ was removed.
  3. Caches and Build Residue:
    • Purged all __pycache__/ directories and .pyc bytecode files.
    • Added ignore rules to prevent future tracking.

An automated script scanned all Markdown files in the repository:

  • Total internal links checked: 74
  • Broken links before remediation: 3
    • docs/README.md -> fa/api/overview.md
    • docs/README.md -> en/api/overview.md
    • docs/fa/index.md -> api/overview.md
  • Broken links after remediation: 0 (100% valid)

New & Improved API Documentation #

  1. parsikit.cache:
    • Created docs/en/api/cache.md and docs/fa/api/cache.md.
    • Fully documents ThreadSafeLRUCache, @memoize, thread-safety guarantees, cache invalidation, and integration with parsikit.config.enable_cache.
  2. parsikit.reshaper:
    • Created docs/en/api/reshaper.md and docs/fa/api/reshaper.md.
    • Documents reshape_for_graphics, reshape_paragraph_for_graphics, Lam-Alef ligatures, diacritics handling, and Bidirectional (BiDi) block preservation for graphic engines.
  3. API Indexes:
    • Updated docs/en/api/index.md and docs/fa/api/index.md to reference both modules.
  4. Version Alignment:
    • Updated stale references in test.py, README.md, and README.fa.md from 3.3.0 to 3.3.1.

6. Distribution Artifacts & Build Verification #

The distribution packages were built using python3 -m build (setuptools build backend):

1. Binary Wheel (dist/parsikit-3.3.1-py3-none-any.whl) #

  • Uncompressed Size: 154,049 bytes
  • File Count: 18 files
  • Contents Verification (unzip -l):
    • parsikit/__init__.py
    • parsikit/cache.py
    • parsikit/config.py
    • parsikit/currency.py
    • parsikit/datetime.py
    • parsikit/dev.py
    • parsikit/exceptions.py
    • parsikit/gui.py
    • parsikit/models.py
    • parsikit/number.py
    • parsikit/reshaper.py
    • parsikit/text.py
    • parsikit/validators.py
    • parsikit-3.3.1.dist-info/licenses/LICENSE
    • parsikit-3.3.1.dist-info/METADATA
    • parsikit-3.3.1.dist-info/WHEEL
    • parsikit-3.3.1.dist-info/top_level.txt
    • parsikit-3.3.1.dist-info/RECORD
  • Exclusion Check: Strictly excludes tests, documentation, examples, environment files, .pyc, and dev tooling.

2. Source Distribution (dist/parsikit-3.3.1.tar.gz) #

  • Compressed Size: ~60 KB
  • Contents Verification (tar -ztvf):
    • Contains only root project metadata (CHANGELOG.md, LICENSE, MANIFEST.in, README.fa.md, README.md, pyproject.toml, setup.py) and runtime package parsikit/.

3. Isolated Wheel Installation & Smoke Testing #

  • Installed the wheel into a completely isolated environment (/tmp/test-parsikit-env) with --no-index.
  • Verified import from outside the repository directory:
    Imported parsikit from: /tmp/test-parsikit-env/lib/python3.11/site-packages/parsikit/__init__.py
    Version: 3.3.1
    Confirmed: Loaded exclusively from isolated site-packages!
  • Tested all core modules (text standardization, national code, mobile operator, bank card Luhn check, number to words, Jalali astronomical calendar, font reshaper). All returned accurate outputs.

7. Example Script Executions #

All scripts in examples/ were executed against the isolated installed wheel:

Script Description Result Exit Code
examples/quickstart_demo.py Basic text, validation, currency, and date demonstration PASS 0
examples/form_validation_demo.py User registration pipeline with NationalCode, Mobile, and Card PASS 0
examples/invoice_currency_demo.py Financial invoicing, VAT, and words-to-number transformation PASS 0
examples/datetime_humanize_demo.py Jalali calendar formatting and relative-time humanization PASS 0

8. Python Version Compatibility & CI Configuration #

Locally Verified Environments #

  • Python 3.10.12 (GCC 11.4.0): 100% of tests passed.
  • Python 3.11.2: 100% of tests passed.

Continuous Integration (.github/workflows/ci.yml) #

Updated GitHub Actions workflow to run across:

  • Matrix: Python 3.10, 3.11, 3.12, 3.13
  • Pipeline Steps:
    1. actions/checkout@v4 & actions/setup-python@v5
    2. Install build tools, pytest, and package
    3. Execute legacy regression suite (python test.py)
    4. Execute comprehensive test suite (pytest -v tests)
    5. Execute discovery unit tests (python -m unittest discover -s tests)
    6. Execute runnable examples (examples/*.py)
    7. Build source distribution and wheel (python -m build)
    8. Force reinstall from built wheel and verify package version
    9. Run automated Markdown link validation

9. Remaining Risks and Limitations #

  1. Python 3.12 and 3.13 Local Testing: The local testing environment contained Python 3.10.12 and 3.11.2. Python 3.12 and 3.13 will be tested automatically by GitHub Actions CI upon push.
  2. External Key Rotation: The maintainer must verify and rotate any third-party credentials that may have been present in pre-import archives or local .env files outside this repository.

10. Release Verdict #

VERDICT: APPROVED FOR PRODUCTION RELEASE (v3.3.1)

ParsiKit v3.3.1 satisfies all release engineering requirements:

  • Clean and consistent versioning across all package metadata files.
  • Zero broken documentation links across both Persian and English docs.
  • 100% pass rate across all 118 automated tests.
  • High-quality, clean distribution wheel and source tarball containing zero unintended artifacts.
  • Safe secret hygiene and verified privacy masking utilities.