Coder Social home page Coder Social logo

jorrandewit / ithenticate-api-python Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 5.0 30 KB

Python API Client for iThenticate, a professional plagiarism detection and prevention technology.

Home Page: https://www.ithenticate.com/

License: BSD 2-Clause "Simplified" License

Python 100.00%
plagiarism ithenticate turnitin python publication

ithenticate-api-python's Introduction

iThenticate API Client Python

This package provides an iThenticate API Client for Python. You may also use this client for a Turnitin account, which uses the iThenticate API.

PyPI version

Installation

The easiest way to install is with pip.

$ pip install ithenticate-api-python

Getting started

Requiring the iThenticate API Client.

>>>> import iThenticate

Initializing the iThenticate API client and login.

>>>> client = iThenticate.API.Client('test_username', 'test_password')
>>>> client.login()
True

Method reference

Folders

Use the folders property to list all folders related to your account.

List all folders

folders.all()
>>>> client.folders.all()
{
  "data": [
    {
      'name': 'My Folder',
      'group': None,
      'id': 123456,
    }
  ],
  "messages": [],
  "status": 200
}

Documents

Use the documents property for all document related methods.

Get all documents

documents.all(folder_id)
>>>> client.documents.all('1234567')
{
  "data": [
    {
      'title': 'My Document',
      'doc_id': 987654,
      'author_first': 'John',
      'author_last': 'Doe',
      'is_pending': 1,
    }
  ],
  "messages": [],
  "status": 200
}

Submit a document

documents.add(path, folder_id, author_first_name, author_last_name, document_title)
>>>> client.documents.add('/absolute/path/to/document.pdf', '123456', 'John', 'Doe', 'Document Title')
{
  "data": [
    {
      'filename': 'document.pdf',
      'id': 123456,
    }
  ],
  "messages": [
    'Uploaded 1 document successfully'
  ],
  "status": 200
}

Get document status

documents.get(path, document_id)
>>>> client.documents.get('123456')
{
  "data": [
    {
        'id': 123456,
        'title': 'Beautiful Dummy Document',
        'uploaded_time': '2008-06-05T15:13:11',
        'author_last': 'Doe',
        'author_first': 'John',
        'percent_match': 73,
        'is_pending': 1,
        'processed_time': '2008-06-05T15:30:02',
    }
  ],
  "messages": [],
  "status": 200
}

Support

The package is Python 3.x-compatible.

License

BSD (Berkeley Software Distribution) License. Copyright (c) 2017, Jorran de Wit.

ithenticate-api-python's People

Contributors

jorrandewit avatar jscaux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ithenticate-api-python's Issues

Error in login function

Hi,

I tried to use this api to connect to ithenticate but it doesn't work, I guess they changed somehting in the meantime. Here is the output:

(solar) vita@valinor 23:02:05 0 ~ > python ./test.py 
Traceback (most recent call last):
  File "./test.py", line 5, in <module>
    print(client.login())
  File "/media/data1/Dropbox/Work/projects/python-envs/solar/lib/python3.6/site-packages/iThenticate/API/Client.py", line 42, in login
    root = ET.fromstring(xml_string)
  File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 1314, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 238

This is a clean virtualenv with python 3.6.5 and only ithenticate-api-python installed.

ssl.ssleoferror (python 3.10)

Using python 3.10 leads to an unstable behavior with errors such as ssl.ssleoferror: eof occurred in violation of protocol from time to time.

Downgrading to python 3.9 seems to resolve those issues. (Just in case someone runs into the same issue.)

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.