Giter Club home page Giter Club logo

cydifflib's Introduction

CyDifflib

Continuous Integration PyPI package version Python versions
GitHub license

CyDifflib is a fast implementation of difflib's algorithms, which can be used as a drop-in replacement.

๐Ÿš€ Benchmarks

The following benchmark compares the performance in the original difflib implementation, the library cdifflib and CyDifflib

Benchmark CyDifflib

โš™๏ธ Installation

You can install this library from PyPI with pip:

pip install cydifflib

CyDifflib provides binary wheels for all common platforms.

Source builds

For a source build (for example from a SDist packaged) you only require a C++11 compatible compiler. You can install directly from GitHub if you would like.

pip install git+https://github.com/rapidfuzz/CyDifflib.git@main

๐Ÿ“– Usage

The library can be used in the same way as difflib. Just use the cydifflib module instead of difflib:

# from difflib import SequenceMatcher
from cydifflib import SequenceMatcher

The official documentation of difflib explains how to use the library. If you work with a library which internally uses some of the algorithms of difflib it is possible to replace the implementation before importing this library. E.g. for thefuzz this can be done in the following way:

from cydifflib import SequenceMatcher
import difflib

difflib.SequenceMatcher = SequenceMatcher
from thefuzz import fuzz

๐Ÿ‘ Contributing

PRs are welcome!

  • Found a bug? Report it in form of an issue. Any difference in behavior to difflib is considered as a bug.
  • Can make something faster? Great! Just avoid external dependencies and remember that external behavior does not change.
  • Have no time to code? Tell your friends and subscribers about CyDifflib.

Thank you โค๏ธ

โš ๏ธ License

Copyright 2021-present Max Bachmann. CyDifflib is free and open-source software licensed under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.