Skip to content

syubogdanov/weasel

weasel-logo

weasel-version weasel-license python-version weasel-readthedocs

Warning

The project is in the pre-alpha stage. Bugs may exist!

Gettings Started

Installation

Git

git clone https://github.com/syubogdanov/weasel.git
cd weasel/
poetry install

Make sure you have Python, Poetry and Git installed.

Docker

git clone https://github.com/syubogdanov/weasel.git
cd weasel/
docker build --tag weasel .

Make sure you have Docker installed.

Usage

diff

For more, see the documentation.

$ weasel diff --help
Usage: weasel diff [OPTIONS] SOURCE TARGET

  Compare files and highlight differences.

Options:
  --help  Show this message and exit.

info

For more, see the documentation.

$ weasel info --help
Usage: weasel info [OPTIONS]

  Show the 'weasel' configuration.

Options:
  --help  Show this message and exit.

scan

For more, see the documentation.

$ weasel scan --help
Usage: weasel scan [OPTIONS]

  Scan multiple files or repositories.

Options:
  --from-json FILE  Load from JSON.
  --from-toml FILE  Load from TOML.
  --from-yaml FILE  Load from YAML.
  --to-json TEXT    Write to JSON.
  --to-toml TEXT    Write to TOML.
  --to-yaml TEXT    Write to YAML.
  --help            Show this message and exit.

Examples

diff

Run the command:

$ weasel diff ./einstein/einstein.py ./kafka.py
weasel 0.0.0
------------

Files:      
- source:        einstein/einstein.py
- target:        kafka.py

Match:
- language:      python
- probability:   1.0
- labels:        -

Highlights:
- simple:        C:/Users/User/AppData/Local/Temp/tmpqt5qh5ih.html

scan

Write the manifest:

tasks:
  - name: Dijkstra
    submissions:
      - name: Albert Einstein
        path: ./einstein/
      - name: Franz Kafka
        path: ./kafka.py
      - name: Hermann Karl Hesse
        github:
          user: hesse
          repo: dijkstra
      - name: Sigmund Freud
        bitbucket:
          user: freud
          repo: algorithms
          branch: dijkstra

Run the command:

$ weasel scan --from-yaml=contest.yaml --to-yaml=report.yaml
weasel 0.0.0
------------

This may take a while...

Start:
- now:      2025-05-16 19:43:31.692+00:00

Finish:
- now:      2025-05-16 19:43:31.823+00:00

Reports:
- yaml:     report.yaml

See the report:

$ cat report.yaml
reviews:
- comparisons:
  - matches:
    - labels: []
      language: python
      probability: 1.0
      source: einstein.py
      target: kafka.py
    metrics:
      count: 1
      max: 1.0
      mean: 1.0
      median: 1.0
      min: 1.0
      nolie: 1.0
      p75: 1.0
      p90: 1.0
      p95: 1.0
      p99: 1.0
      std: 0.0
      var: 0.0
    source: Albert Einstein
    target: Franz Kafka
  - ...

License

MIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See LICENSE file.

About

Binary-blooded predator. Hunts plagiarism - line by line, byte by byte.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Languages