PHPackages                             rk/php-sword - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rk/php-sword

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rk/php-sword
============

A PHP library for reading SWORD project Bible modules. Inspired by PySword.

0.2.6(today)00MITPHPPHP ^8.4

Since Jun 13Pushed todayCompare

[ Source](https://github.com/rk/PhpSword)[ Packagist](https://packagist.org/packages/rk/php-sword)[ RSS](/packages/rk-php-sword/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

PHP Sword
=========

[](#php-sword)

PHP Sword is a library for interacting with SWORD Project Bible Modules, intended for other uses like converting to other formats or working with the raw data. Inspired by [PySword](https://gitlab.com/tgc-dk/pysword).

Features
--------

[](#features)

- Reads Bible modules.
- Supports ztext, ztext4, rawtext, rawtext4 formats.
- Supports compressed modules, in zip format.
- Supports PHP 8.4+
- [Sapphire II Stream Cipher](https://ftp.crosswire.org/jsword/javadoc/org/crosswire/common/crypt/Sapphire.html)

Development Structure
---------------------

[](#development-structure)

```
- _doc - internal planning documents, ignored in .git
- _doc/wiki - internal documentation of the structure
- _doc/PySword - a copy of PySword for translation from
- src/ - PSR-4 compatible package root
- tests/ - where our tests go

```

AI agents SHALL MAINTAIN the `_doc/wiki` as a current description of architecture, decisions, and memories.

Goals
-----

[](#goals)

- A feature-complete translation of PySword in PHP.
- It SHOULD be idiomatic PHP.
- It MUST use minimal or preferably NO 3rd party packages except during development.
- It MUST adhere to [PSR-4](http://www.php-fig.org/psr/psr-4/) and [PER3.0](https://github.com/php-fig/per-coding-style/blob/3.0.0/spec.md) standards.
- It MUST adhere to SemVer.
- It SHOULD document/DocBlock anything that requires additional context.
- It MUST [exclude non-essential files using .gitattributes](_doc/ignore_non_essentials.md).
- It MUST maintain a changelog for each release, and it should state both the WHAT and WHY.

Getting Started
---------------

[](#getting-started)

```
composer install
composer download-bibles   # fetches KJV, ASV, and other fixture modules
composer test              # 45 tests; 3 skipped when FTP fixtures unavailable
composer lint && composer analyse
```

Set `PHP_SWORD_AUTO_DOWNLOAD=1` to auto-download missing bible fixtures when running tests.

**ChiPinyin test gap:** `testLoadChipinyinZip` is skipped when `chipinyin.zip` is missing. The CrossWire/Xiphos FTP mirror for that module is down and no alternative download URL was found, so this integration test cannot be repaired until a substitute fixture source is available.

Roadmap
-------

[](#roadmap)

- Phase 1
    - Package development environment configuration, like test framework, linter, formatter, etc.
    - Translate all test cases from PySword as a reference implementation.
        - Tests should be able to pass on both the [KJV](https://crosswire.org/sword/servlet/SwordMod.Verify?modName=KJV&pkgType=raw) and [ASV](https://crosswire.org/sword/servlet/SwordMod.Verify?modName=ASV&pkgType=raw) modules. Those are our first targets to test against. They should probably be downloaded into test when the test case runs, if they don't already exist.
- Phase 2
    - Translate or implement all features in PySword.
    - Test cases UNCHANGED (fixture text captured from downloaded modules where PySword assertions differ).
- Phase 3
    - Complete test case coverage if less than 80%.
- Phase 4
    - TBD

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a298a35a62a67b9ad302043f0f3dcb53a2e4ce8617e6c1b791c2ebd729e971e?d=identicon)[rk](/maintainers/rk)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rk-php-sword/health.svg)

```
[![Health](https://phpackages.com/badges/rk-php-sword/health.svg)](https://phpackages.com/packages/rk-php-sword)
```

###  Alternatives

[sitegeist/archaeopteryx

The missing link editor for Neos

2585.0k3](/packages/sitegeist-archaeopteryx)[heptacom/heptaconnect-portal-base

HEPTAconnect base dataset that every other portal is based on

1025.2k15](/packages/heptacom-heptaconnect-portal-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
