Install & Compatibility
Where this runs
tested against v1.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.11
✕ build_error
✕ build_error
py 3.12
✕ build_error
✕ build_error
py 3.13
✕ build_error
✕ build_error
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
affinegap
✓ import affinegap
✗ from affinegap import affinegap
affinegap is the module itself, not a function named affinegap; the main function is accessed as affinegap.affineGapDistance
Basic usage: compute affine gap string distance. The function returns an integer distance or similarity score depending on penalties.
import affinegap
# Compute affine gap distance between two strings
dist = affinegap.affineGapDistance("string1", "string2")
print(dist)
# With custom gap penalties
dist = affinegap.affineGapDistance("hello", "hallo", match_weight=0, mismatch_weight=1, gap_weight=1, spatial_gap_weight=1)
print(dist)
Errors
Common errors & fixes
ImportError: cannot import name 'affinegap'
Trying to do `from affinegap import affinegap` instead of `import affinegap`.
fixReplace with `import affinegap` and use `affinegap.affineGapDistance`.
AttributeError: module 'affinegap' has no attribute 'affinegap'
Same as above - the module does not contain a function named affinegap.
fixUse `affinegap.affineGapDistance`.
TypeError: expected string or Unicode object
Passing a non-string (e.g., integer) to affineGapDistance.
fixConvert arguments to strings: `affinegap.affineGapDistance(str(a), str(b))`
Upgrade
Version history
1.12latest on PyPI · released Jan 1, 2022
Audit
Dependencies
No dependency data recorded yet.