/Plagiarism_checker

Simple application of Copyleaks Plagiarism api.

Primary LanguagePythonMIT LicenseMIT

Copyleaks Python SDK

Copyleaks SDK is a simple framework that allows you to scan textual content for plagiarism and trace content distribution online, using the Copyleaks plagiarism checker cloud.

Detect plagiarism using Copyleaks SDK in:

Installation

Supported Python version: 3.

You have two ways to integrate with the Copyleaks SDK:

  • Recommended - Use the Python Package Manager - PiPy.
    When integrating this way you will automatically be able to update the SDK to its latest version:
    pip3 install copyleaks
    
  • Download the code from this repository and add it to your project.

You can also check out this video showing how to use this SDK.

Register and Get Your API Key

To use the Copyleaks SDK you need to have a Copyleaks account. The registration to Copyleaks is free of charge and quick. Signup and confirm your account to finalize your registration.

Now, generate your personal API key on your dashboard (Businesses dashboard, Education dashboard or Websites dashboard) under 'Access Keys'.

For more information check out our API guide.

Examples

Get started using this API with this examples. ExampleAsynchronous.py is an example of creating a process and getting a completion callback with the results. ExampleSynchronous.py is an example of creating a process, checking its status and getting the results programmatically.

Usage

Login to your account using your email, api-key and the product that you would like to use.

from copyleaks.copyleakscloud import CopyleaksCloud
from copyleaks.product import Product
cloud = CopyleaksCloud(Product.Education, 'YOUR_EMAIL_HERE', 'YOUR_API_KEY_HERE')# You can change the product.

Create `ProcessOptions` instance to add custom headers to your request. For more info see the Configuration section below.

options = ProcessOptions()
options.setSandboxMode(True)  # Scan will not consume any credits and will return dummy results.
options.setHttpCallback("http://yoursite.here/callback") # Recieve a completion callback with the results. For testing purposes we recommend using http://requestb.in

This example shows how to scan a URL using the line:

process = cloud.createByUrl('http://python.org', options)

Available create methods: `createByUrl`, `createByFile`, `createByText`, `createByOcr` and `createByFiles`. For more info visit the Api Documentation.

If you don't wish to use callbacks you can check the process status and get the process results.

Check process status:

[iscompleted, percents] = process.isCompleted()

Get the results:

results = process.getResults()

Configuration

Custumize your process using this optional headers. For more information visit Optional Request Headers

options = ProcessOptions()
options.setSandboxMode(True) # Scan will not consume any credits and will return dummy results.
options.setHttpCallback("http://yoursite.here/callback") # Recieve a completion callback. For testing purposes we recommend using http://requestb.in
options.setHttpInProgressResultsCallback("http://yoursite.here/callback/results")
options.setEmailCallback("Your@email.com")
options.setCustomFields({'Custom': 'field'})
options.setAllowPartialScan(True)
options.setCompareDocumentsForSimilarity(True)  # Available only on compareByFiles
options.setImportToDatabaseOnly(True)  # Available only on Education API

Dependencies

pip3 install requests
pip3 install python-dateutil
pip3 install enum34

Read More