Skip to main content

An SDK for the MyTurn website. Selenium based as there is no REST API.

Project description

MyTurn SDK

A Selenium based SDK written in Python for the My Turn Lending Library Software.

Prerequisites

Google Chrome must be running on the machine this library runs on.

Installation

pip install myturn-sdk

Usage

Instantiate Library

myturnSubdomain = 'mylibrary'
myTurnUsername = 'testuser'
myturnPassword = 'Password!'

myTurnClient = MyTurnClient(
            myturnSubdomain, myTurnUsername, myturnPassword)

Search for a User

request = UserSearchRequest()
request.email = 'homer@simpsons.com'
response = myTurnClient.users.searchUsers(request)

for user in response.users:
    print(user.firstName+' '+user.lastName)

Other functionality follows a similar pattern:

  • myTurnClient.users.getUser()
  • myTurnClient.users.getUserIdForMembershipId()
  • myTurnClient.users.getRequestsToJoin()
  • myTurnClient.users.appendNote()
  • myTurnClient.users.setNote()
  • myTurnClient.users.getNote()
  • myTurnClient.users.deleteUser()

See unit tests for examples.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page