Skip to main content

A function to get the difference between two files and return a pandas DataFrame

pip install textcompari

Tested against Windows 10 / Python 3.11 / Anaconda

Important!

The module will be compiled when you import it for the first time. Cython and a C/C++ compiler must be installed!

from rapidfuzz import fuzz
from textcompari import get_file_diff

"""
A function to get the difference between two files and return a pandas DataFrame.

:param afile: A file to compare (str, bytes, tuple, list, np.ndarray)
:param bfile: Another file to compare (str, bytes, tuple, list, np.ndarray)
:param window_shifts: The number of shifts for the window (default 5)
:param min_fuzz_match: The minimum fuzzy match score (default 80)
:param fuzz_scorer: The fuzzy scorer function (default fuzz.WRatio)
:param cpus: The number of CPUs to use (default 5)
:return: A pandas DataFrame containing the difference between the files
"""


afile = r"C:\Users\hansc\Downloads\difffindertest\test1_1.txt"
bfile = r"C:\Users\hansc\Downloads\difffindertest\test1_2.txt"

df = get_file_diff(
    afile, bfile, window_shifts=300, min_fuzz_match=99, fuzz_scorer=fuzz.WRatio, cpus=5
)
print(df)

Metadata

Release files for textcompari 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for textcompari 0.10
File Size Uploaded Provenance Actions
textcompari-0.10.tar.gz 28.9 kB Without provenance Details for textcompari-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for textcompari 0.10
File Interpreter ABI Platform Actions
textcompari-0.10-py3-none-any.whl Python 3 none any Details for textcompari-0.10-py3-none-any.whl

Total release size: 58.1 kB

Release files / textcompari-0.10.tar.gz

Download URL textcompari-0.10.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a641c7563f8ab0d7755cbdf9ae66d2034a9cc2b5a14ad2cb4b52e815c0a30fc5
BLAKE2b-256 checksum
How to use checksums
3905ebe2fa07f6e4d7c39330c7c9a91c6a91f7e3b981343860fd17ce89acbaa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / textcompari-0.10-py3-none-any.whl

Download URL textcompari-0.10-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
316d254e9fc8e4e7ce2a869089f76fc3f7ab7a90712d7b9cc787e61caf8b282c
BLAKE2b-256 checksum
How to use checksums
ba391318f7265e2d63a51da33dd4b19abd04522bd22ce503ab8daeafdc8763f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for textcompari 0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page