Skip to content

Package API Reference

Andy Byers edited this page Nov 25, 2025 · 1 revision

API Reference


access.models

class Contact

A contact is a person who is affiliated with an initiative.

class AccessLog

The access log is a record of when access was granted or revoked

class AccessLogExportCode

An export code is a code that can be used to export data

access_choices()

Returns the choices for the access log

Returns:

  • a tuple of choices

send_access_update_message()

This function is for OtF style presses using the access log It's not a functional requirement of OBC so has been postponed for v2


access.views

contact_list(request)

List all contacts for initiatives owned by the logged-in user.

Parameters:

  • request: the request object

Returns:

  • rendered response

create_contact(request, contact_id)

Create or edit a contact.

Parameters:

  • request: the request object
  • contact_id: the contact ID (optional, for editing)

Returns:

  • rendered response

delete_contact(request, contact_id)

Delete a contact.

Parameters:

  • request: the request object
  • contact_id: the contact ID

Returns:

  • redirect response

accounts.models

class Profile

User profile extending Django's User model with additional fields.

Profile.full_name()

Get the full name of the user.

Returns:

  • the full name as a string

Profile.active_baskets()

Get all active baskets for this user.

Returns:

  • queryset of active baskets

class AccountBandingChoices

Stores banding choices made by a user account.

profile_images_upload_path(instance, filename)

Generate upload path for profile images.

Parameters:

  • instance: unused (required by Django)
  • filename: the original filename

Returns:

  • the upload path for the profile image

accounts.templatetags.account_tags

is_current_banding_for_user(request)

This checks whether or not this banding is currently set for the user

Parameters:

  • request: the request object

Returns:

  • true or false

accounts.utils

process_permission_change(request)

Process permission changes from a request.

Parameters:

  • request: the request object containing permission changes

Returns:

  • None

accounts.views

login(request)

Redirects to the two_factor login page.

Parameters:

  • request: HttpRequest

Returns:

  • HttpRedirect

profile(request)

Allows a user to edit their profile.

Parameters:

  • request: HttpRequest

Returns:

  • HttpResponse

manage_account_bandings(request)

Allows a user to edit their profile.

Parameters:

  • request: HttpRequest

Returns:

  • HttpResponse

edit_profile(request)

Allows a user to edit their profile.

Parameters:

  • request: HttpRequest

Returns:

  • HttpResponse

manage_accounts(request)

Allows a user to manage accounts on the platform.

Parameters:

  • request: HttpRequest

Returns:

  • HttpResponse

api.urls

class ApiRoot

The root API view for OBC.


api.views

class PackageViewSet

API endpoint that allows packages to be viewed.

class InitiativeViewSet

API endpoint that allows initiatives to be viewed.

class StandardViewSet

API endpoint that allows standards to be viewed.

class PackageStandardAttestationViewSet

API endpoint that allows standards to be viewed.

class CountryViewSet

API endpoint that allows countries and currencies to be viewed.

class BandingTypeViewSet

API endpoint that allows banding types to be viewed.

class BandingVocabViewSet

API endpoint that allows banding vocabularies to be viewed.

class BandingViewSet

API endpoint that allows bandings to be viewed.

class PriceViewSet

API endpoint that allows prices to be viewed.


backup.management.commands.list_backups

class Command

Installs cron tasks.

Command.handle(args, options)

Pushes the backup to S3

Parameters:

  • args: None
  • options: None

Returns:

  • None

backup.management.commands.pull_backup

class Command

Installs cron tasks.

Command.handle(args, options)

Pushes the backup to S3

Parameters:

  • args: None
  • options: None

Returns:

  • None

backup.management.commands.push_backup

class Command

Installs cron tasks.

Command.handle(args, options)

Pushes the backup to S3

Parameters:

  • args: None
  • options: None

Returns:

  • None

cms.admin

class PageAdmin

Admin for the Page model.

class VersionAdmin

Admin for the Version model.

class SiteTextAdmin

Admin for the SiteText model.


cms.forms

class PageUpdateForm

Form for creating and updating PageUpdate objects.

PageUpdateForm.clean_thumbnail_image()

Resize the thumbnail image to the correct dimensions.

Returns:

  • The resized image.

PageUpdateForm.clean_mid_page_image()

Resize the mid-page image to the correct dimensions.

Returns:

  • The resized image.

PageUpdateForm.save(commit)

Save the PageUpdate object.

Parameters:

  • commit: Whether to commit the object to the database.

Returns:

  • The saved PageUpdate object.

class VersionForm

Form for creating and updating Version objects.

class WhoWeAreEntryForm

Form for creating and updating WhoWeAreProfileItem objects.

WhoWeAreEntryForm.clean_police_mugshot()

Resize the user's profile image to the correct dimensions. The name of this function is a joke,

Returns:

  • The resized image.

WhoWeAreEntryForm.save(commit)

Save the WhoWeAreProfileItem object.

Parameters:

  • commit: Whether to commit the object to the database.

Returns:

  • The saved WhoWeAreProfileItem object.

class PrimaryInitiativeForm

Form for creating and updating PrimaryInitiative objects.

class HomePageQuoteForm

Form for creating and updating HomePageQuote objects.

HomePageQuoteForm.clean_organization_logo()

Resize the organization logo to the correct dimensions.

Returns:

  • The resized image.

class EditSiteText

Form for editing the site text.


cms.models

class Version

A version of a page or news update. A page or news update can have

class PageUpdate

A page or news update. A page or news update can have multiple versions.

PageUpdate.first_character()

Returns the first character of the first paragraph of the current object

Returns:

  • str

PageUpdate.first_paragraph_minus_first_character()

Returns the first paragraph of the current object minus the first character

Returns:

  • str

PageUpdate.edit_url()

Returns the url for editing this page

PageUpdate.detail_url()

Returns the url for viewing this page

Returns:

  • an url string

class WhoWeAreProfileItem

Configures items visible on the Who We Are page

class SiteWideNewsItem

Configures items visible on the site-wide news feed

class PrimaryInitiative

Configures the primary initiative for the site

class HomePageQuote

Configures quotes visible on the home page

class FeaturedBook

Configures items visible on the home page

class SiteText

A site text object

SiteText.display(context)

Display the text, with an edit link if the user is staff

Parameters:

  • context: the request context

Returns:

  • the text, with an edit link if the user is staff

cms.templatetags.site_text

get_site_text(context, site_text_key, cms_prefetched)

Get the site text for the given key and render it with the given context.

Parameters:

  • context: The context to render the site text with.
  • site_text_key: The key of the site text to render.
  • cms_prefetched: A dictionary of prefetched site text objects.

Returns:

  • The rendered site text.

get_site_text_no_edit(context, site_text_key, cms_prefetched)

Get the site text for the given key and render it with the given context without the edit text.

Parameters:

  • context: The context to render the site text with.
  • site_text_key: The key of the site text to render.
  • cms_prefetched: A dictionary of prefetched site text objects.

Returns:

  • The rendered site text.

cms.utils

resize_image(width, height, image_upload)

Resize an image to the specified width and height

Parameters:

  • width: the width to resize to
  • height: the height to resize to
  • image_upload: the image to resize

Returns:

  • the resized image

send_cms_change_notification(request, initiative, page_or_update, page)

Send a notification to the platform manager that a page has been updated

Parameters:

  • request: the request object
  • initiative: the initiative that the page belongs to
  • page_or_update: either "page" or "update"
  • page: the page that was updated

Returns:

  • None

send_target_institution_notification(request, page)

Send a notification to the target institution that a page has been updated

Parameters:

  • request: the request object
  • page: the page that was updated

Returns:

  • None

cms.views

featured_books(request, initiative)

View for managing featured books

Parameters:

  • request: the request object
  • initiative: the initiative object

Returns:

  • HttpResponse object

page_list(request, initiative, page_or_update)

View for managing pages

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: either "page" or "update"

Returns:

  • HttpResponse object

initiative_pages_order(request, initiative_id)

Reorders the Form Elements list, posted via AJAX.

Parameters:

  • request: HttpRequest object
  • initiative_id: the initiative ID

Returns:

  • HttpResponse object

page_detail(request, initiative, page_or_update, page_id)

View for managing pages

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: either "page" or "update"
  • page_id: the page ID

Returns:

  • HttpResponse object

featured_book_create(request, initiative)

View for creating a featured book

Parameters:

  • request: the request object
  • initiative: the initiative object

Returns:

  • HttpResponse object

page_edit_or_create(request, initiative, page_or_update, page_id)

View for editing or creating a page

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: either "page" or "update"
  • page_id: the page ID

Returns:

  • HttpResponse object

featured_book_delete(request, initiative, fb_id)

Delete a featured book

Parameters:

  • request: the request object
  • initiative: the initiative object
  • fb_id: the featured book ID

Returns:

  • HttpResponse object

page_delete(request, initiative, page_or_update, page_id)

Delete a page

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: the page or update
  • page_id: the page ID

Returns:

  • HttpResponse object

view_version(request, initiative, page_or_update, page_id, version_id)

View a version of a page or update

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: the page or update
  • page_id: the page ID
  • version_id: the version ID

Returns:

  • HttpResponse object

view_current_version(request, initiative, page_or_update, page_id)

View the current version of a page or update

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: the page or update
  • page_id: the page ID

Returns:

  • HttpResponse object

diff_versions(request, initiative, page_or_update, page_id, version_one_id, version_two_id)

View the diff between two versions of a page or update

Parameters:

  • request: the request object
  • initiative: the initiative object
  • page_or_update: the page or update
  • page_id: the page ID
  • version_one_id: the first version ID
  • version_two_id: the second version ID

Returns:

  • HttpResponse object

page_update_feed(request)

View the page update feed]

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

sitewide_news_config(request)

Configure the sitewide news

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

sitewide_news(request)

View the sitewide news

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

news_item(request, update_id)

View a news item

Parameters:

  • request: the request object
  • update_id: the update ID

Returns:

  • HttpResponse object

extract_ids(input_list)

Extracts the IDs from a list of strings

Parameters:

  • input_list: the list of strings

Returns:

  • list of IDs

sitewide_news_order(request)

Reorders the Form Elements list, posted via AJAX.

Parameters:

  • request: HttpRequest object

Returns:

  • HttpResponse object

who_we_are_config(request)

Configure the who we are section

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

add_who_we_are_entry(request, section, entry_id)

Add or edit a who we are entry

Parameters:

  • request: the request object
  • section: the section
  • entry_id: the entry ID

Returns:

  • HttpResponse object

sitewide_news_delete(request, news_id)

Delete a sitewide news item

Parameters:

  • request: the request object
  • news_id: the news item ID

Returns:

  • HttpResponse object

delete_who_we_are_entry(request, entry_id)

Delete a who we are entry

Parameters:

  • request: the request object
  • entry_id: the entry ID

Returns:

  • HttpResponse object

who_we_are_order(request)

Reorders the Form Elements list, posted via AJAX.

Parameters:

  • request: HttpRequest object

Returns:

  • HttpResponse object

fixed_pages(request)

Configure the fixed pages

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

fixed_page(request, page_string)

Renders a fixed page

Parameters:

  • request: the request object
  • page_string: the page string

Returns:

  • HttpResponse object

all_pages(request)

View all pages

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

page_render(request, page_id)

Render a page.

Parameters:

  • request: the request object
  • page_id: the page ID

Returns:

  • HttpResponse object

homepage_quotes(request)

Configure the homepage quotes

Parameters:

  • request: the request object

Returns:

  • HttpResponse object

new_quote(request, quote_id)

Create or edit a homepage quote

Parameters:

  • request: the request object
  • quote_id: the quote ID

Returns:

  • HttpResponse object

delete_quote(request, quote_id)

Delete a homepage quote

Parameters:

  • request: the request object
  • quote_id: the quote ID

Returns:

  • HttpResponse object

homepage_quotes_order(request)

Reorders the Homepage Quotes list, posted via AJAX.

Parameters:

  • request: HttpRequest object

Returns:

  • HttpResponse object

order_featured_books(request, initiative_id)

Reorders the featured books

Parameters:

  • request: HttpRequest object
  • initiative_id: the initiative ID

Returns:

  • HttpResponse object

edit_site_text(request, key, lang_code)

View to handle both displaying the modal for editing site text and saving the updated text in the selected language.

Parameters:

  • request: the request object
  • key: the site text key
  • lang_code: the language code

Returns:

  • rendered response or success message

list_site_text(request)

View to list all site texts with a language selection dropdown.

Parameters:

  • request: the request object

Returns:

  • rendered response

site_text_csv(request)

View to download a CSV of all site texts.

Parameters:

  • request: the request object

Returns:

  • CSV download response

dashboard.views

visitor_dict(stats)

Convert the visitor stats to a dictionary

Parameters:

  • stats: the stats

Returns:

  • a dictionary of stats

index(request)

The dashboard index

Parameters:

  • request: the request object

Returns:

  • an HTTP response

documents(request)

The document centre dashboard

Parameters:

  • request: the request object

Returns:

  • a rendered response

frozen_document(request, document_id)

View a frozen document, piping it through Django in 8KB chunks to avoid memory issues.

Parameters:

  • request: the request object
  • document_id: the document ID

Returns:

  • A FileResponse

setup(request)

The site setup page

Parameters:

  • request: the request object

Returns:

  • an HTTP response

generate_graph(books)

Generate the graph of books published on the homepage

Parameters:

  • books: the book objects

Returns:

  • Labels, publisher counts, and template lists

create_js_template(color, publisher_name, publisher_data)

Produces a custom JS template for the graphing system in the dashboard

Parameters:

  • color: the color to use (a string of type 'rgba(210, 0, 0, 1)')
  • publisher_name: the name of the publisher
  • publisher_data: the data list to use

Returns:

  • a dictionary of values for json_script

initiatives.forms

class InitiativeForm

A form that represents an initiative

InitiativeForm.clean_image()

Resize the image to 335x100

Returns:

  • a resized image

initiatives.models

class Initiative

An initiative is an organisation working in the OA books space, i.e. a publisher or infrastructure provider

Initiative.pk_str()

Return the primary key as a string.

Returns:

  • string of primary key

Initiative.active_display()

Return a string representation of the active field.

Returns:

  • "Yes" or "No"

Initiative.highlights()

Return the highlights for this initiative.

Returns:

  • a queryset of highlights

class Highlights

Highlights for an initiative.

profile_images_upload_path(instance, filename)

Upload path for initiative profile images.

Parameters:

  • instance: unused
  • filename: the filename of the uploaded file

Returns:

  • a new filename

highlights_images_upload_path(instance, filename)

Upload path for initiative highlights images.

Parameters:

  • instance: unused
  • filename: the filename of the uploaded file

Returns:

  • a new filename

initiatives.views

initiative_list(request)

List all initiatives

Parameters:

  • request: the request

Returns:

  • an HTTP response

public_initiative_list(request)

List all active public initiatives

Parameters:

  • request: the request

Returns:

  • an HTTP response

public_initiative(request, initiative_id, page_id)

Show a public initiative

Parameters:

  • request: the request
  • initiative_id: the initiative id
  • page_id: the page id

Returns:

  • an HTTP response

initiative_detail(request, initiative_id)

Show initiative details

Parameters:

  • request: the request
  • initiative_id: the initiative id

Returns:

  • an HTTP response

initiative_edit_or_create(request, initiative_id)

Edit or create an initiative

Parameters:

  • request: the request
  • initiative_id: the initiative id

Returns:

  • an HTTP response

initiative_delete(request, initiative_id)

Delete an initiative: this function is not used as it is DANGEROUS

Parameters:

  • request: the request. Unused.
  • initiative_id: the initiative id. Unused.

Returns:

  • None

user_initiatives(request)

List all initiatives for the current user

Parameters:

  • request: the request

Returns:

  • an HTTP response

initiative_packages(request, initiative)

List all packages for an initiative

Parameters:

  • request: the request
  • initiative: the initiative

Returns:

  • an HTTP response

install.management.commands.install_cron

class Command

Installs cron tasks.

Command.handle(args, options)

Installs Cron

Parameters:

  • args: None
  • options: None

Returns:

  • None

find_job(tab, comment)

Find job in cron tab

Parameters:

  • tab: the cron tab
  • comment: the comment

Returns:

  • the job or None

intrepid.diff_match_patch

Diff Match and Patch Copyright 2018 The diff-match-patch Authors. https://github.com/google/diff-match-patch

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class diff_match_patch

Class containing the diff, match and patch methods. Also contains the behaviour settings.

diff_match_patch.diff_main()

Find the differences between two texts. Simplifies the problem by stripping any common prefix or suffix off the texts before diffing. Args: text1: Old string to be diffed. text2: New string to be diffed. checklines: Optional speedup flag. If present and false, then don't run a line-level diff first to identify the changed areas. Defaults to true, which does a faster, slightly less optimal diff. deadline: Optional time when the diff should be complete by. Used internally for recursive calls. Users should set DiffTimeout instead. Returns: Array of changes.

diff_match_patch.diff_compute()

Find the differences between two texts. Assumes that the texts do not have any common prefix or suffix. Args: text1: Old string to be diffed. text2: New string to be diffed. checklines: Speedup flag. If false, then don't run a line-level diff first to identify the changed areas. If true, then run a faster, slightly less optimal diff. deadline: Time when the diff should be complete by. Returns: Array of changes.

diff_match_patch.diff_lineMode()

Do a quick line-level diff on both strings, then rediff the parts for greater accuracy. This speedup can produce non-minimal diffs. Args: text1: Old string to be diffed. text2: New string to be diffed. deadline: Time when the diff should be complete by. Returns: Array of changes.

diff_match_patch.diff_bisect()

Find the 'middle snake' of a diff, split the problem in two and return the recursively constructed diff. See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. Args: text1: Old string to be diffed. text2: New string to be diffed. deadline: Time at which to bail if not yet complete. Returns: Array of diff tuples.

diff_match_patch.diff_bisectSplit()

Given the location of the 'middle snake', split the diff in two parts and recurse. Args: text1: Old string to be diffed. text2: New string to be diffed. x: Index of split point in text1. y: Index of split point in text2. deadline: Time at which to bail if not yet complete. Returns: Array of diff tuples.

diff_match_patch.diff_linesToChars()

Split two texts into an array of strings. Reduce the texts to a string of hashes where each Unicode character represents one line. Args: text1: First string. text2: Second string. Returns: Three element tuple, containing the encoded text1, the encoded text2 and the array of unique strings. The zeroth element of the array of unique strings is intentionally blank.

diff_match_patch.diff_charsToLines()

Rehydrate the text in a diff from a string of line hashes to real lines of text. Args: diffs: Array of diff tuples. lineArray: Array of unique strings.

diff_match_patch.diff_commonPrefix()

Determine the common prefix of two strings. Args: text1: First string. text2: Second string. Returns: The number of characters common to the start of each string.

diff_match_patch.diff_commonSuffix()

Determine the common suffix of two strings. Args: text1: First string. text2: Second string. Returns: The number of characters common to the end of each string.

diff_match_patch.diff_commonOverlap()

Determine if the suffix of one string is the prefix of another. Args: text1 First string. text2 Second string. Returns: The number of characters common to the end of the first string and the start of the second string.

diff_match_patch.diff_halfMatch()

Do the two texts share a substring which is at least half the length of the longer text? This speedup can produce non-minimal diffs. Args: text1: First string. text2: Second string. Returns: Five element Array, containing the prefix of text1, the suffix of text1, the prefix of text2, the suffix of text2 and the common middle. Or None if there was no match.

diff_match_patch.diff_cleanupSemantic()

Reduce the number of edits by eliminating semantically trivial equalities. Args: diffs: Array of diff tuples.

diff_match_patch.diff_cleanupSemanticLossless()

Look for single edits surrounded on both sides by equalities which can be shifted sideways to align the edit to a word boundary. e.g: The cat came. -> The cat came. Args: diffs: Array of diff tuples.

diff_match_patch.diff_cleanupEfficiency()

Reduce the number of edits by eliminating operationally trivial equalities. Args: diffs: Array of diff tuples.

diff_match_patch.diff_cleanupMerge()

Reorder and merge like edit sections. Merge equalities. Any edit section can move as long as it doesn't cross an equality. Args: diffs: Array of diff tuples.

diff_match_patch.diff_xIndex()

loc is a location in text1, compute and return the equivalent location in text2. e.g. "The cat" vs "The big cat", 1->1, 5->8 Args: diffs: Array of diff tuples. loc: Location within text1. Returns: Location within text2.

diff_match_patch.diff_prettyHtml()

Convert a diff array into a pretty HTML report. Args: diffs: Array of diff tuples. Returns: HTML representation.

diff_match_patch.diff_text1()

Compute and return the source text (all equalities and deletions). Args: diffs: Array of diff tuples. Returns: Source text.

diff_match_patch.diff_text2()

Compute and return the destination text (all equalities and insertions). Args: diffs: Array of diff tuples. Returns: Destination text.

diff_match_patch.diff_levenshtein()

Compute the Levenshtein distance; the number of inserted, deleted or substituted characters. Args: diffs: Array of diff tuples. Returns: Number of changes.

diff_match_patch.diff_toDelta()

Crush the diff into an encoded string which describes the operations required to transform text1 into text2. E.g. =3 -2 +ing -> Keep 3 chars, delete 2 chars, insert 'ing'. Operations are tab-separated. Inserted text is escaped using %xx notation. Args: diffs: Array of diff tuples. Returns: Delta text.

diff_match_patch.diff_fromDelta()

Given the original text1, and an encoded string which describes the operations required to transform text1 into text2, compute the full diff. Args: text1: Source string for the diff. delta: Delta text. Returns: Array of diff tuples. Raises: ValueError: If invalid input.

diff_match_patch.match_main()

Locate the best instance of 'pattern' in 'text' near 'loc'. Args: text: The text to search. pattern: The pattern to search for. loc: The location to search around. Returns: Best match index or -1.

diff_match_patch.match_bitap()

Locate the best instance of 'pattern' in 'text' near 'loc' using the Bitap algorithm. Args: text: The text to search. pattern: The pattern to search for. loc: The location to search around. Returns: Best match index or -1.

diff_match_patch.match_alphabet()

Initialise the alphabet for the Bitap algorithm. Args: pattern: The text to encode. Returns: Hash of character locations.

diff_match_patch.patch_addContext()

Increase the context until it is unique, but don't let the pattern expand beyond Match_MaxBits. Args: patch: The patch to grow. text: Source text.

diff_match_patch.patch_make()

Compute a list of patches to turn text1 into text2. Use diffs if provided, otherwise compute it ourselves. There are four ways to call this function, depending on what data is available to the caller: Method 1: a = text1, b = text2 Method 2: a = diffs Method 3 (optimal): a = text1, b = diffs Method 4 (deprecated, use method 3): a = text1, b = text2, c = diffs Args: a: text1 (methods 1,3,4) or Array of diff tuples for text1 to text2 (method 2). b: text2 (methods 1,4) or Array of diff tuples for text1 to text2 (method 3) or undefined (method 2). c: Array of diff tuples for text1 to text2 (method 4) or undefined (methods 1,2,3). Returns: Array of Patch objects.

diff_match_patch.patch_deepCopy()

Given an array of patches, return another array that is identical. Args: patches: Array of Patch objects. Returns: Array of Patch objects.

diff_match_patch.patch_apply()

Merge a set of patches onto the text. Return a patched text, as well as a list of true/false values indicating which patches were applied. Args: patches: Array of Patch objects. text: Old text. Returns: Two element Array, containing the new text and an array of boolean values.

diff_match_patch.patch_addPadding()

Add some padding on text start and end so that edges can match something. Intended to be called only from within patch_apply. Args: patches: Array of Patch objects. Returns: The padding string added to each side.

diff_match_patch.patch_splitMax()

Look through the patches and break up any which are longer than the maximum limit of the match algorithm. Intended to be called only from within patch_apply. Args: patches: Array of Patch objects.

diff_match_patch.patch_toText()

Take a list of patches and return a textual representation. Args: patches: Array of Patch objects. Returns: Text representation of patches.

diff_match_patch.patch_fromText()

Parse a textual representation of patches and return a list of patch objects. Args: textline: Text representation of patches. Returns: Array of Patch objects. Raises: ValueError: If invalid input.

class patch_obj

Class representing one patch operation.


intrepid.forms

class SiteSetupForm

Form for editing the site setup.


intrepid.middleware

debug_middleware(get_response)

Middleware that prints the IP address of the request to the console

Parameters:

  • get_response: a callable that takes a request and returns a response

Returns:

  • a request object

session_middleware(get_response)

Middleware that ensures that a session key is always present

Parameters:

  • get_response: a callable

Returns:

  • a request object

country_middleware(get_response)

Middleware that ensures that a session key is always present

Parameters:

  • get_response: a callable

Returns:

  • a request object

variables_middleware(get_response)

Middleware that injects commonly used variables into the request

Parameters:

  • get_response: a callable

Returns:

  • a new request object

intrepid.migrations.0003_auto_20220327_1110

insert_sites()

Populate the sites model


intrepid.models

class SiteSetup

This is a singleton class to store site variables. There should only ever be one object in here

class PrivateImage

A private image is an image that is not publicly accessible

PrivateImage.mime()

Get the mime type of the image

PrivateImage.serve_image_file()

Serve the image file

Returns:

  • an HttpResponse

copy_session_baskets_to_user(sender, user, request, kwargs)

When a user logs in, copy all their session baskets to their user account

Parameters:

  • sender: the dispatcher
  • user: the user who just logged in
  • request: the request object
  • kwargs: other arguments (unused)

Returns:

  • None

private_images_upload_path(instance, filename)

Generate a unique filename for a private image

Parameters:

  • instance: unused (required by Django)
  • filename: the original filename

Returns:

  • a new path

intrepid.security

user_is_initiative_manager(func)

Checks that the current user is an initiative manager

Parameters:

  • func: the function to wrap

Returns:

  • the result of the underlying function

intrepid.sessions

class SessionStore

Extends the default session store to update the session ID for when a user logs in, to preserver their basket.

SessionStore.cycle_key()

Cycles a key in the session store when the user logs in.

Returns:

  • None

intrepid.settings

Django settings for intrepid project.

Generated by 'django-admin startproject' using Django 2.2.24.

For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/


intrepid.templatetags.booleans

boolean_font_awesome(boolean)

Returns a font awesome icon for a boolean value.

Parameters:

  • boolean: a boolean value

Returns:

  • HTML code for a font awesome icon

intrepid.templatetags.cost_calculator

get_banding(costs, package)

Get the banding for a package.

Parameters:

  • costs: the costs
  • package: the package to get the banding for

Returns:

  • a string with the banding

meta_package_cost(costs, meta_package, converted_currency)

Get the total cost for a meta package.

Parameters:

  • costs: the costs for the meta package
  • meta_package: the meta package
  • converted_currency: the currency to convert to

Returns:

  • the currency totals

package_cost_multiplier(costs, package, converted_currency)

Get the cost for a package.

Parameters:

  • costs: the costs
  • package: the package to get the cost for
  • converted_currency: the currency to convert to

Returns:

  • the cost

package_cost(costs, package, converted_currency)

Get the cost for a package.

Parameters:

  • costs: the costs
  • package: the package to get the cost for
  • converted_currency: the currency to convert to

Returns:

  • the cost

format_price(cost, currency)

Format a price.

Parameters:

  • cost: the cost
  • currency: the currency

Returns:

  • a formatted currency string

format_price_multiplier()

Format a price.

add_total_and_site_fee(currency_total, site_percentage)

Add the total and site fee together.

Parameters:

  • currency_total: the currency total
  • site_percentage: the site percentage

Returns:

  • the final cost

intrepid.templatetags.initiatives

user_is_initiative_manager(request, role)

Check if the user is a manager of an initiative

Parameters:

  • request: a request object
  • role: a role object

Returns:

  • true if the user is a manager of an initiative otherwise false

intrepid.templatetags.permissions

user_has_fluid_permission(context, view_name)

Check if the user has a permission to a view.

Parameters:

  • context: the request context
  • view_name: the view name

Returns:

  • true if allowed to view, otherwise false

intrepid.utils

return_or_elsewhere(request, return_page)

Determine whether to return to a page or go to a default page.

Parameters:

  • request: a request object
  • return_page: the default page to return to

Returns:

  • an HttpResponseRedirect object

serve_file(path, filename, mime)

Serve a file

Parameters:

  • path: the path
  • filename: the filename
  • mime: the mime type

Returns:

  • HttpResponse

intrepid.views

index(request)

Site index for intrepid.

Parameters:

  • request: a request

Returns:

  • a response

test_index(request)

An early and now unused test index loader

Parameters:

  • request: a request

Returns:

  • a response

who_we_are(request)

Render the "who we are" page

Parameters:

  • request: the request object

Returns:

  • a response

create_csv(field_list_method, request, queryset, field_method)

Create a CSV output

Parameters:

  • field_list_method: a method that lists the fields to evaluate
  • request: request object
  • queryset: the queryset
  • field_method: a method that builds a field list

Returns:

  • a response object

export(request, target)

Export a CSV of signups

Parameters:

  • request: a request
  • target: the object type to export

Returns:

  • a response

nav(request, page_name)

Render a site page.

Parameters:

  • request: the request object
  • page_name: the URL expression for the page

Returns:

  • a rendered response

intrepid.wsgi

WSGI config for intrepid project.

It exposes the WSGI callable as a module-level variable named application.

For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/


invoicing.forms

class StatusForm

Form for changing the status of an invoice.

class PaymentProcessorForm

Form for creating a new payment processor.


invoicing.models

class PaymentProcessor

A payment processor is a company that handles payments for us.

PaymentProcessor.is_member(user)

Check if a user is a manager of this payment processor.

Parameters:

  • user: the user to check

Returns:

  • True if user is a manager, False otherwise

class SignupInvoice

An invoice for a signup.

SignupInvoice.last_status_update()

Get the last status update for this invoice.

Returns:

  • an InvoiceLog object

class InvoiceLog

A log of status changes for an invoice.

status_choices()

Choices for the status field of invoices.

Returns:

  • a tuple of tuples

invoicing.signals

add_log_entry(sender, instance, created, kwargs)

When the status of an Invoice changes the log should add an entry.

Parameters:

  • sender: unused
  • instance: the invoice instance
  • created: unused
  • kwargs: unused

invoicing.templatetags.invoicing

order_invoices_processor(context, order)

Returns a queryset of invoices for the given order, filtered by the request user's payment processors.

Parameters:

  • context: the request context
  • order: the order to filter invoices for

Returns:

  • a queryset of invoices

invoicing.views

list_order_invoices(request, payment_processor_id)

Displays a list of an order's invoices.

Parameters:

  • request: the request
  • payment_processor_id: the payment processor ID

Returns:

  • an HttpResponse

detail_invoice(request, payment_processor_id, order_id)

Shows details of an invoice.

Parameters:

  • request: the request
  • payment_processor_id: the payment processor ID
  • order_id: the order ID

Returns:

  • an HttpResponse

list_order_invoices_initiative(request, initiative_id)

Displays a list of an order's invoices.

Parameters:

  • request: the request
  • initiative_id: the initiative ID

Returns:

  • an HttpResponse

detail_invoice_initiative(request, initiative_id, order_id)

Invoice detailing for an initiative.

Parameters:

  • request: a request object
  • initiative_id: an initiative ID
  • order_id: an order ID

Returns:

  • an HttpResponse

list_payment_processors(request)

Create a list of payment processors

Parameters:

  • request: a request object

Returns:

  • an HttpResponse

edit_payment_processor(request, processor_id)

Edit a payment processor

Parameters:

  • request: a request object
  • processor_id: a payment processor ID

Returns:

  • an HttpResponse

mail.management.commands.test_email

class Command

A management command that sends a test email


mail.management.commands.update_email_status

class Command

A management command that syncs Mailgun statuses to the database

Command.update_statuses()

Update the statuses of all logs

Returns:

  • None

mail.models

class EmailLog

A log of all emails sent through the system.

class EmailTemplate

A template for an email.

EmailTemplate.render_email(context)

Render the email template with the given context.

Parameters:

  • context: the context with which to render the template

Returns:

  • the rendered email template

EmailTemplate.send(to, context, subject, from_email, bcc, attachments)

Send an email.

Parameters:

  • to: the email recipient
  • context: the context with which to render the template
  • subject: the email subject
  • from_email: the email sender
  • bcc: the email bcc
  • attachments: the email attachments

Returns:

  • the email response

mail.views

list_logs(request)

List all email logs

Parameters:

  • request: the request

Returns:

  • the response

update_email_statuses(request)

Update the email statuses

Parameters:

  • request: the request

Returns:

  • the response

manage

Django's command-line utility for administrative tasks.


package.admin

class CountryAdmin

Admin for Country model

class BandingAdmin

Admin for Banding model

class PriceAdmin

Admin for Price model

class PackageAdmin

Admin for Package model

class MetaPackageLinkInline

Inline for MetaPackageLink model

class MetaPackage

Admin for MetaPackage model

class BasketAdmin

Admin for Basket model

class FormElementAdmin

Admin for AggregateFormElement model

class DocumentAdmin

Admin for PackageDocument model

class BandingTypeAdmin

Admin for BandingType model

class BandingTypeEntryAdmin

Admin for BandingTypeEntry model

class BandingTypeCurrencyEntryAdmin

Admin for BandingTypeCurrencyEntry model

class OrderAdmin

Admin for Order model

class PackageDocumentHistoricalAdmin

Admin for PackageDocumentHistorical model

class SignupInvoiceInline

Inline for SignupInvoice model

class PackageSignupAdmin

Admin for PackageSignup model


package.banding_views

banding_type_list(request)

Allows a staff member to view a list of banding types.

Parameters:

  • request: the request object

Returns:

  • the response object

banding_type_create(request)

Allows a staff member to create a new banding type.

Parameters:

  • request: the request object

Returns:

  • the response object

banding_type_vocabs(request, banding_type_id)

Allows a staff member to manage the vocabs for a banding type.

Parameters:

  • request: the request object
  • banding_type_id: the banding type id

Returns:

  • the response object

banding_type_edit(request, banding_type_id)

Allows a staff member to edit an existing banding type. NOTE: Unimplemented.

Parameters:

  • request: the request object
  • banding_type_id: the banding type id

Returns:

  • the response object

banding_type_delete(request, banding_type_id)

Allows a staff member to delete a banding type. NOTE: Unimplemented.

Parameters:

  • request: the request object
  • banding_type_id: the banding type id

Returns:

  • the response object

banding_type_order(request)

Allows a staff member to order banding types. NOTE: Unimplemented.

Parameters:

  • request: the request object

Returns:

  • the response object

package.context_processors

packages_awaiting_approval(request)

Returns a dictionary of packages awaiting approval

Parameters:

  • request: the request object (unused)

Returns:

  • a dictionary of packages awaiting approval

package.currency

convert(currency_from, currency_to, value)

Convert a value from a currency to another

Parameters:

  • currency_from: the currency to convert from
  • currency_to: the currency to convert to
  • value: the value to convert

Returns:

  • the converted value

package.forms

class NewBasketForm

Form for creating a new basket

NewBasketForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

class FTEForm

Form for entering FTE and currency

FTEForm.save()

Save the form

class ManagePackageForm

Form for managing packages

ManagePackageForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • tuple

class MetaPackageForm

Form for managing meta packages

MetaPackageForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the meta package

class FormElementForm

Form for managing form elements

FormElementForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the form element

class CustomVocabM2M

Custom M2M field for vocabularies

CustomVocabM2M.label_from_instance(vocab)

Display the label for a vocabulary

Parameters:

  • vocab: the vocabulary

Returns:

  • the label

class BandingTypeForm

Form for managing banding types

class BandingTypeEntryRedirectForm

Form for managing banding type entries

class DocumentUploadForm

Form for uploading documents

DocumentUploadForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the document

class BandingTypeField

Form for selecting banding types

class StandardsTypeField

Form for selecting standards

class StandardsAttestForm

Form for managing standards attestations

StandardsAttestForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the standards attestation

class CurrencyField

Form for selecting currencies

class FormListField

Form for selecting form fields

class ManagePackageCurrencyForm

Form for managing package currencies

ManagePackageCurrencyForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • None

class GeneratedForm

Form for generating forms

class CustomDocumentForm

Form for custom documents

CustomDocumentForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the document

class OrderForm

Form for orders

class PrivateImageForm

Form for private images

PrivateImageForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the image

class MediaFileForm

Form for media files

MediaFileForm.save(commit)

Save the form

Parameters:

  • commit: whether to commit or not

Returns:

  • the media file

render_choices(choices)

Helper function to render choices

Parameters:

  • choices: the choices to render

Returns:

  • the rendered choices

package.manage_views

start_package(request, initiative)

Allows creation of a package.

Parameters:

  • request: the request object
  • initiative: the initiative object

Returns:

  • the response object

create_package(request, initiative, banding_type_id)

Allows creation of a package.

Parameters:

  • request: the request object
  • initiative: the initiative object
  • banding_type_id: the banding type id

Returns:

  • the response object

manage_package(request, initiative, package_id)

Allows creation or editing of a package.

Parameters:

  • request: the request object
  • initiative: the initiative object
  • package_id: the package id

Returns:

  • the response object

list_meta_packages(request)

List all meta packages

Parameters:

  • request: the request object

Returns:

  • the response object

manage_meta_package(request, package_id)

Manage a meta package

Parameters:

  • request: the request object
  • package_id: the package id

Returns:

  • the response object

package.management.commands.pregenerate_prices

class Command

A management command that pregenerates package prices


package.media_views

list_media_files(request, package_id, initiative_id)

List all media files for a package.

Parameters:

  • request: the request object
  • package_id: the package id
  • initiative_id: the initiative id

Returns:

  • the response object

download_media_file(request, package_id, initiative_id, file_id)

Download a media file.

Parameters:

  • request: the request object
  • package_id: the package id
  • initiative_id: the initiative id
  • file_id: the file id

Returns:

  • the response object

package.models

class Country

A country represents a country in which a package is available.

class BandingType

A banding type specifies the mode of a Banding (e.g. Jisc Collections)

BandingType.is_fte_display()

Returns a string to display in the admin for the is_fte field

Returns:

  • A string: "Yes" if is_fte, "No" if not

BandingType.set_vocabs(ids, request)

Sets vocabs for this BandingType

Parameters:

  • ids: a list of IDs to set or unset
  • request: the request object

Returns:

  • a list of vocabs that were set

class BandingManager

Custom manager for Banding

BandingManager.get_queryset()

Returns a queryset of Banding objects with related objects

Returns:

  • a queryset of Banding objects with related objects

class Banding

A banding represents a type of banding (e.g. Jisc Band 1) for a package

Banding.name()

Returns the name of the banding

Returns:

  • the name of the banding

Banding.fte_minimum()

Returns the minimum FTE for this banding

Returns:

  • the minimum FTE for this banding

Banding.fte_maximum()

Returns the maximum FTE for this banding

Returns:

  • the maximum FTE for this banding

Banding.fte_comparable()

Returns whether this banding is comparable by FTE

Returns:

  • True if comparable, otherwise False

class PriceManager

Custom manager for Price

PriceManager.get_queryset()

Returns a queryset of Price objects with related objects

Returns:

  • a queryset of Price objects with related objects

class Price

A price point for a Banding in a particular currency. Loosely coupled with BandingTypeCurrencyEntry

Price.collect()

A garbage collector for orphaned prices

Returns:

  • None

class BandingTypeCurrencyEntry

Ties a currency to a BandingTypeEntry

class BandingTypeEntry

This model glues a package to a banding type. If this exists, then a package has selected to use a particular banding type. E.g. Open Book Pub using Jisc Collections.

class BasePackage

Abstract base class for Package and PackageHistory

BasePackage.highlights()

Return the highlights for this package

Returns:

  • a queryset of highlights

class Package

A package is a collection of content that can be purchased by a customer.

Package.stored_fields()

Returns a full list of stored field answers for this package. These are not guaranteed accessible for any particular signup.

Returns:

  • A list of fields

Package.active_display()

Returns a string to display in the admin for the active field

Returns:

  • A string: "Yes" if active, "No" if not

Package.set_contacts(ids, contact_type)

Sets contacts for this package

Parameters:

  • ids: a list of IDs to set or unset
  • contact_type: The ManyToMany field on which to operate. Should be either signup_contacts or access_contacts

Returns:

  • None

Package.save_price_data(form)

Saves the price data

Parameters:

  • form: the form to save

Returns:

  • None

Package.price_bandings()

This returns a dictionary of BandingTypeCurrencyEntries that contains a dictionary of countries that contains a list of prices E.g. price_bandings[BandingTypeCurrencyEntry][Country] = [Prices]

Returns:

  • a dictionary of BandingTypeCurrencyEntries that contains

Package.display_price()

Gets a display string of the pricing for this package

Returns:

  • a string of pricing display

Package.meta_packages()

Returns a list of meta packages that this package is a part of

Returns:

  • set of meta packages

Package.standards()

Returns a QuerySet of standards that this package is certified against

Returns:

  • QuerySet of standards

class MetaPackage

A Meta Package is a collection of packages that are grouped together

MetaPackage.initiative_list()

Returns a set of initiatives that this meta package is a part of

Returns:

  • a set of initiatives

MetaPackage.standards()

Returns a dictionary of standards for which this meta package is certified

Returns:

  • a dictionary of standards

class MetaPackageLink

A link between a package and a meta package

class Basket

A basket is a collection of packages and meta packages that a user has

Basket.package_set()

Returns a set of packages that are in this basket

Returns:

  • a set of packages

Basket.conflicts()

Checks if the packages and meta_packages conflict with one another.

Basket.list_of_conflicting_packages()

Returns a set of packages that conflict with one another

Returns:

  • a set of packages

Basket.cost(identifier, identifier_type)

Returns the cost of the basket

Parameters:

  • identifier: the user or country to get the cost for
  • identifier_type: the type of identifier

Returns:

  • tuple of the cost of the basket and currency totals

Basket.compliance_set()

Returns a dict of standards covered by the packages in this basket.

Basket.get_best_bandings_for_form(identifier, identifier_type)

Returns the best bandings for the form

Parameters:

  • identifier: the user or country to get the cost for
  • identifier_type: the type of identifier

Returns:

  • the cost of the basket

class AggregateForm

A form that aggregates multiple forms together.

class BaseAggregateFormElement

A form element that can be used in an aggregate form.

BaseAggregateFormElement.choices_list()

Return the choices for this element as a list.

Returns:

  • None

class AggregateFormElement

A form element that can be used in an aggregate form.

AggregateFormElement.snapshot(answer)

Creates a snapshot of the element

Parameters:

  • answer: the answer to snapshot

Returns:

  • the snapshot

class AggregateAssignmentAnswer

An answer to an aggregate assignment.

AggregateAssignmentAnswer.element()

Returns the frozen element

Returns:

  • the element

class FrozenAggregateFormElement

A snapshot of a form element at the time an answer is created

class AggregateFormAnswer

An answer to an aggregate form.

class PackageFormElement

A form element that can be used in a package form.

class PackageDocument

A document associated with a package (e.g. a contract)

PackageDocument.create_historical_record()

Duplicating this object including copying the file

Returns:

  • the historical record

class FrozenPackageDocument

A frozen document associated when a package is bought (e.g. a set of merged PDF contracts)

class CustomPackageDocument

A document associated with a package (e.g. a contract)

class PackageDocumentHistorical

An old version of an existing PackageDocument.

PackageDocumentHistorical.revert()

Reverts the package document to this historical version

Returns:

  • None

class OrderFormAnswer

An answer to an order form.

class PackageSignupOrderFormAnswer

This model links a form answer to a signup

class Order

An order for a package.

Order.get_currency_totals_completed_order()

Returns the currency totals for a completed order

Returns:

  • dict

Order.parcel_data(signups)

This function takes a list of signups and saves a list of dicts

Parameters:

  • signups: list of signups

Returns:

  • None

Order.get_order_form_details()

Returns a list of dicts containing the order form details

Returns:

  • list of dicts

Order.has_processor(user)

Returns true if the user has a payment processor for this order

Parameters:

  • user: the user to check

Returns:

  • bool

Order.package_set()

Returns a set of packages associated with this order

Returns:

  • set

Order.data_to_collect()

Returns an OrderedSet of the field names that will be collected for this basket

Returns:

  • OrderedSet

Order.save_order_form(form)

Saves the order form

Parameters:

  • form: the form to save

Returns:

  • None

Order.rebuild_docs(request)

Rebuilds the docs for this order

Parameters:

  • request: the request

Returns:

  • None

class PackageSignup

A signup to a package

PackageSignup.external()

Returns a redirect field if one exists

Returns:

  • str

PackageSignup.external_display()

Returns a redirect field if one exists

Returns:

  • str

PackageSignup.stored_fields()

Returns a full list of stored field answers for this signup. These should be guaranteed accessible for this signup.

Returns:

  • A list of fields

PackageSignup.stored_answer(field)

Returns a stored answer or empty string if it does not exist

Parameters:

  • field: The field name

Returns:

  • str

PackageSignup.stored_answers()

Returns a dict of stored answers

Returns:

  • QuerySet of PackageSignupOrderFormAnswer

PackageSignup.payment_processor()

Returns the payment processor for this signup

Returns:

  • str

PackageSignup.formatted_price()

Returns a formatted price

Returns:

  • str

PackageSignup.formatted_price_multiplier()

Returns a formatted price

Returns:

  • str

class MediaFile

A media file for a package

MediaFile.mime()

Returns the mime type of the file

Returns:

  • str

MediaFile.unlink_file()

Unlinks the file from the filesystem

Returns:

  • None

MediaFile.serve_file()

Serve a file

Returns:

  • HttpResponse

package_images_upload_path(instance, filename)

Upload path for package images

Parameters:

  • instance: the instance of the model
  • filename: the filename of the file

Returns:

  • the path to upload the file to

element_kind_choices()

Returns the choices for the kind of element

Returns:

  • the choices

element_width_choices()

Returns the choices for the width of the element

Returns:

  • the choices

package.order_management

order_list(request)

List all orders.

Parameters:

  • request: the request

Returns:

  • the response

order_detail(request, order_id)

Detail view for an order.

Parameters:

  • request: the request
  • order_id: the order id

Returns:

  • the response

order_edit_create(request, order_id)

Edit or create an order.

Parameters:

  • request: the request
  • order_id: the order id

Returns:

  • the response

initiative_order_list(request, initiative)

List all orders for an initiative.

Parameters:

  • request: the request
  • initiative: the initiative

Returns:

  • the response

initiative_order_create(request, initiative, order_id)

Create an order for an initiative.

Parameters:

  • request: the request
  • initiative: the initiative
  • order_id: the order id

Returns:

  • the response

initiative_order_detail(request, initiative, order_id)

Detail view for an order.

Parameters:

  • request: the request
  • initiative: the initiative
  • order_id: the order id

Returns:

  • the response

order_add_image(request, order_id)

Add an image to an order.

Parameters:

  • request: the request
  • order_id: the order id

Returns:

  • the response

order_serve_image(request, order_id, image_id)

Serve an image from an order.

Parameters:

  • request: the request
  • order_id: the order id
  • image_id: the image id

Returns:

  • the response

order_add_package(request, order_id, initiative)

Add a package to an order.

Parameters:

  • request: the request
  • order_id: the order id
  • initiative: the initiative

Returns:

  • the response

package.receivers

cleanup_prices(sender, kwargs)

A signal receiver that runs the price garbage collector

Parameters:

  • sender: the sender of the signal
  • kwargs: the keyword arguments

Returns:

  • None

package.signals

update_order_status(sender, instance, kwargs)

When all PackageSignup objects have been approved by Org and Inits update the package status.

Parameters:

  • sender: the sender
  • instance: the instance
  • kwargs: the kwargs

Returns:

  • None

package.templatetags.conflicts

conflict_statement(package, basket)

Returns a string describing the conflict between the package and the basket.

Parameters:

  • package: the package to check for conflicts
  • basket: the basket to check for conflicts

Returns:

  • a string describing the conflict between the package and the basket

package.templatetags.currency_display

currency_display(value, currency)

Formats the price using the currency.

Parameters:

  • value: the price to format
  • currency: the currency to use

Returns:

  • the formatted price

package.utils

explain_price(package, identifier, identifier_type)

This function is used to explain the price calculation for a given package

Parameters:

  • package: the package to calculate the price for
  • identifier: the user or session to calculate the price for
  • identifier_type: the type of identifier (user or session)

Returns:

  • a tuple of the price, banding and explanation

get_price_for_package(package, identifier, identifier_type, country, explain)

This function is used to calculate the price for a given package

Parameters:

  • package: the package to calculate the price for
  • identifier: the user or session to calculate the price for
  • identifier_type: the type of identifier (user or session)
  • country: the country to calculate the price for
  • explain: whether to return an explanation of the price calculation

Returns:

  • a tuple of the price, banding and explanation

fetch_price(banding, country, explanation)

This function is used to fetch a price

Parameters:

  • banding: the banding to fetch the price for
  • country: the country to fetch the price for
  • explanation: the explanation of the price calculation

Returns:

  • a tuple of the explanation and the price

use_default_pricing(banding, explanation)

This function is used to use the default pricing

Parameters:

  • banding: the banding to use the default pricing for
  • explanation: the explanation of the price calculation

Returns:

  • a tuple of the explanation and the price

fallback_to_default(banding, bandings, explanation, fte, package)

This function is used to fall back to the default pricing

Parameters:

  • banding: the banding to fall back to the default pricing for
  • bandings: the bandings to fall back to the default pricing for
  • explanation: the explanation of the price calculation
  • fte: the FTE to fall back to the default pricing for
  • package: the package to fall back to the default pricing for

Returns:

  • a tuple of the banding and the explanation

get_user(band_filter, banding_choice, explanation, fte, identifier, identifier_type, package)

This function is used to get the user

Parameters:

  • band_filter: the band filter
  • banding_choice: the banding choice
  • explanation: the explanation of the price calculation
  • fte: the FTE
  • identifier: the identifier
  • identifier_type: the identifier type
  • package: the package

Returns:

  • a tuple of the banding choice, explanation and FTE

get_band_filter(band_filter, country, explanation, package)

This function is used to get the band filter

Parameters:

  • band_filter: the band filter
  • country: the country
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the band filter, country and explanation

user_without_banding(band_filter, banding, banding_choice, bandings, explanation, package)

This function is used to handle a user without a banding

Parameters:

  • band_filter: the band filter
  • banding: the banding object
  • banding_choice: the banding choice
  • bandings: the bandings
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the banding and the explanation

check_default_currency_and_fte(band_filter, bandings, explanation, fte, package)

This function is used to check the default currency and FTE

Parameters:

  • band_filter: the band filter
  • bandings: the bandings
  • explanation: the explanation of the price calculation
  • fte: the FTE
  • package: the package

Returns:

  • a tuple of the banding and the explanation

check_for_catch_all(band_filter, country, explanation, package)

This function is used to check for a catch-all price

Parameters:

  • band_filter: the band filter
  • country: the country
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the band filter, bandings, country and explanation

find_user_from_session(band_filter, explanation, identifier, package)

This function is used to find a user from a session

Parameters:

  • band_filter: the band filter
  • explanation: the explanation of the price calculation
  • identifier: the identifier
  • package: the package

Returns:

  • a tuple of the banding choice, explanation and FTE

find_user_in_database(band_filter, explanation, identifier, package)

This function is used to find a user in the database

Parameters:

  • band_filter: the band filter
  • explanation: the explanation of the price calculation
  • identifier: the identifier
  • package: the package

Returns:

  • a tuple of the banding choice, explanation and FTE

explain_catch_all_band_filter(band_filter, explanation, package)

This function is used to explain a catch-all band filter

Parameters:

  • band_filter: the band filter
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the banding and the explanation

match_price_to_code(band_filter, country, explanation, package)

This function is used to match a price to a code

Parameters:

  • band_filter: the band filter
  • country: the country (code)
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the band filter, country and explanation

handle_band_filter(band_filter, explanation, package)

This function is used to handle a band filter

Parameters:

  • band_filter: the band filter
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the banding and the explanation

test_country(band_filter, country, explanation, package)

This function is used to test the country

Parameters:

  • band_filter: the band filter
  • country: the country
  • explanation: the explanation of the price calculation
  • package: the package

Returns:

  • a tuple of the band filter and the explanation

provisional_page_table_rows(order)

This function is used to generate the table rows for the provisional page

Parameters:

  • order: the order to generate the table rows for

Returns:

  • a dictionary of table rows

unlink_frozen_doc(order)

This function is used to unlink a frozen document

Parameters:

  • order: the order to unlink the frozen document for

Returns:

  • None

generate_package_docs_zip(order, request)

This function is used to generate a zip file of the documents for a given

Parameters:

  • order: the order to generate the zip file for
  • request: the request object

Returns:

  • the frozen document

check_basket_for_disabled_signups(request, basket)

This function is used to check a basket for disabled signups

Parameters:

  • request: the request object
  • basket: the basket to check

Returns:

  • an error message if there is one, otherwise None

send_new_order_notification(order, request, identifier, identifier_type)

This function is used to send a new order notification

Parameters:

  • order: the order to send the notification for
  • request: the request object
  • identifier: the identifier
  • identifier_type: the identifier type

Returns:

  • None

send_order_complete_notification(order, request)

This function is used to send an order complete notification

Parameters:

  • order: the order to send the notification for
  • request: the request object

Returns:

  • None

format_price(cost, currency)

This function is used to format a price

Parameters:

  • cost: the cost to format
  • currency: the currency to format

Returns:

  • the formatted price

calculate_site_percentage(request, total)

This function is used to calculate the site percentage

Parameters:

  • request: the request object
  • total: the total to calculate the site percentage for

Returns:

  • a tuple of the site percentage and the site percentage value

filter_duplicates_from_costs(costs)

This function is used to filter duplicates from costs

Parameters:

  • costs: the costs to filter

Returns:

  • the filtered costs

convert_currency_totals(request, identifier_type, identifier, totals)

Convert currency totals to a single currency.

Parameters:

  • request: the request object
  • identifier_type: the identifier type
  • identifier: the identifier
  • totals: the totals to convert

Returns:

  • a tuple of converted values

generate_doc(request, order, identifier, identifier_type)

This function is used to generate a document

Parameters:

  • request: the request object
  • order: the order to generate the document for
  • identifier: the identifier
  • identifier_type: the identifier type

Returns:

  • a tuple of the path and filename of the document

generate_acceptance_doc(request, order, identifier, identifier_type)

This function is used to generate an acceptance document

Parameters:

  • request: the request object
  • order: the order to generate the acceptance document for
  • identifier: the identifier
  • identifier_type: the identifier type

Returns:

  • a tuple of the path and filename of the acceptance document

add_bold_paragraph(document, text, secondary_text)

This function is used to add a bold paragraph to a document

Parameters:

  • document: the document to add the paragraph to
  • text: the text to add
  • secondary_text: the secondary text to add

Returns:

  • None

get_user_currency(identifier, identifier_type)

This function is used to get a user's currency

Parameters:

  • identifier: the identifier
  • identifier_type: the identifier type

Returns:

  • the user's currency

add_pre_calc_to_objects(country_code, packages)

Add pre-calculated min/max prices to package objects.

Parameters:

  • country_code: the country code
  • packages: the packages to add pre-calc prices to

Returns:

  • the packages with pre-calc prices added

add_pre_calc_to_meta_objects(country_code, packages)

Add pre-calculated min/max prices to meta package objects.

Parameters:

  • country_code: the country code
  • packages: the meta packages to add pre-calc prices to

Returns:

  • the meta packages with pre-calc prices added

package.views

initiative_list(request)

List all initiatives that the user has access to.

Parameters:

  • request: the request

Returns:

  • the response

collective_list(request)

List all collectives that the user has access to.

Parameters:

  • request: the request

Returns:

  • the response

package_info(request, package_id)

Display information about a package.

Parameters:

  • request: the request
  • package_id: the package ID

Returns:

  • the response

list_signups(request)

List all signups that the user has access to.

Parameters:

  • request: the request

Returns:

  • the response

process_signup(request, initiative_id, package_id, signup_id)

Process a signup.

Parameters:

  • request: the request
  • initiative_id: the initiative ID
  • package_id: the package ID
  • signup_id: the signup ID

Returns:

  • the response

package_access_control_change(request, signup_id, initiative_id, access_type)

Change the access control for a package.

Parameters:

  • request: the request
  • signup_id: the signup ID
  • initiative_id: the initiative ID
  • access_type: the access type

Returns:

  • the response

package_access_control(request, package_id, initiative_id)

Display the access control for a package.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID

Returns:

  • the response

package_standards_attest_delete(request, package_id, initiative_id, standard_id)

Delete a standard attestation.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • standard_id: the standard ID

Returns:

  • the response

package_standards_attest(request, package_id, initiative_id, standard_id)

Attest to a standard.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • standard_id: the standard ID

Returns:

  • the response

package_standards(request, package_id, initiative_id)

Display the standards for a package.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID

Returns:

  • the response

package_contacts(request, package_id, initiative_id)

Display the contacts for a package.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID

Returns:

  • the response

view_baskets(request)

View the baskets for the user.

Parameters:

  • request: the request

Returns:

  • the response

view_basket(request, basket_id)

View a basket.

Parameters:

  • request: the request
  • basket_id: the basket ID

Returns:

  • the response

manage_basket(request, package_id, meta_package_id)

Manage a basket.

Parameters:

  • request: the request
  • package_id: the package ID
  • meta_package_id: the meta package ID

Returns:

  • the response

create_checkout_documents(request, order_id)

Creates the zip files and documents in the document centre

Parameters:

  • request: the request object
  • order_id: the order ID that is being checked out

Returns:

  • needs to return an HTTP status code

order_form(request, order_id)

Display an order form

Parameters:

  • request: the request
  • order_id: the order ID

Returns:

  • an HttpResponse

order_provisional(request, order_id)

Display a provisional order.

Parameters:

  • request: the request
  • order_id: the order ID

Returns:

  • an HttpResponse

order_complete(request, order_id)

Display a completed order.

Parameters:

  • request: the request
  • order_id: the order ID

Returns:

  • an HttpResponse

remove_from_basket(request, basket_id, package_id, meta_package_id)

Remove a package from a basket.

Parameters:

  • request: the request
  • basket_id: the basket ID
  • package_id: the package ID
  • meta_package_id: the meta package ID

Returns:

  • an HttpResponse

form_elements_setup(request)

This function lists all the form elements

Parameters:

  • request: request object

Returns:

  • HttpResponse object

form_element_delete(request, form_element_id)

This function deletes a form element

Parameters:

  • request: request object
  • form_element_id: the form element_id to delete

Returns:

  • HttpResponse object

form_element_package_delete(request, initiative_id, package_id, form_element_id)

This function deletes an affiliation of a form element with a package

Parameters:

  • request: request object
  • initiative_id: the initiative ID
  • package_id: the package ID
  • form_element_id: the form element_id to delete

Returns:

  • HttpResponse object

form_element_create(request, form_element_id)

This function creates a new form element

Parameters:

  • request: request object
  • form_element_id: the form element_id to edit

Returns:

  • HttpResponse object

package_approval(request)

This function lists all the packages awaiting approval

Parameters:

  • request: request object

Returns:

  • HttpResponse object

form_elements_order(request)

Reorders the Form Elements list, posted via AJAX.

Parameters:

  • request: HttpRequest object

Returns:

  • HttpResponse object

list_documents(request, initiative_id, package_id)

List the documents for a package.

Parameters:

  • request: the request
  • initiative_id: the initiative ID
  • package_id: the package ID

Returns:

  • the response

package_data(request, initiative_id, package_id)

List the form elements for a package.

Parameters:

  • request: the request
  • initiative_id: the initiative ID
  • package_id: the package ID

Returns:

  • the response

price_debugger(request)

Debug the price of a package.

Parameters:

  • request: the request

Returns:

  • the response

add_document(request, initiative_id, package_id)

Add a document to a package.

Parameters:

  • request: the request
  • initiative_id: the initiative ID
  • package_id: the package ID

Returns:

  • the response

view_document(request, package_id, initiative_id, document_id)

View a document.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • document_id: the document ID

Returns:

  • the response

delete_document(request, package_id, initiative_id, document_id)

Delete a document.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • document_id: the document ID

Returns:

  • the response

upload_new_document(request, package_id, initiative_id, document_id)

Upload a new document.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • document_id: the document ID

Returns:

  • the response

revert_document_version(request, package_id, initiative_id, document_id)

Revert a document to a previous version.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • document_id: the document ID

Returns:

  • the response

delete_package(request, package_id, initiative_id)

Delete a package.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID

Returns:

  • the response

delete_package_banding(request, package_id, initiative_id, banding_id)

Delete a package banding.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • banding_id: the banding ID

Returns:

  • the response

delete_package_banding_currency(request, package_id, initiative_id, banding_id, banding_currency_id)

Delete a package banding currency.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • banding_id: the banding ID
  • banding_currency_id: the banding currency ID

Returns:

  • the response

manage_package_bandings(request, package_id, initiative_id)

Manage the bandings for a package.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID

Returns:

  • the response

edit_redirect_for_banding(request, package_id, initiative_id, banding_id)

Edit the redirect for a banding.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • banding_id: the banding ID

Returns:

  • the response

manage_package_banding_currencies(request, package_id, initiative_id, banding_id)

Manage the currencies for a package banding.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • banding_id: the banding ID

Returns:

  • the response

manage_package_banding_currencies_prices(request, package_id, initiative_id, banding_id, currency_id)

Manage the prices for a package banding currency.

Parameters:

  • request: the request
  • package_id: the package ID
  • initiative_id: the initiative ID
  • banding_id: the banding ID
  • currency_id: the currency ID

Returns:

  • the response

download_order_document(request, order_id)

Download a document for an order.

Parameters:

  • request: the request
  • order_id: the order ID

Returns:

  • the response

new_order_complete(request, order_id)

Show the new order complete page.

Parameters:

  • request: the request
  • order_id: the order ID

Returns:

  • the response

summary.views

get_initiative(package_or_initiative, identifier)

Get initiative from package or initiative identifier

Parameters:

  • package_or_initiative: type of identifier
  • identifier: the identifier

Returns:

  • initiative

summary_package_initiative(request, package_or_initiative, identifier)

Summary page for package or initiative

Parameters:

  • request: the request
  • package_or_initiative: type of identifier
  • identifier: the identifier

Returns:

  • the response

summary_more_info(request, package_or_initiative, identifier)

Summary page for package or initiative

Parameters:

  • request: the request
  • package_or_initiative: type of identifier
  • identifier: the identifier

Returns:

  • the response

summary_pricing(request, package_or_initiative, identifier)

Summary page for package or initiative

Parameters:

  • request: the request
  • package_or_initiative: type of identifier
  • identifier: the identifier

Returns:

  • the response

summary_meta_package(request, package_id)

Summary page for meta package

Parameters:

  • request: the request
  • package_id: the package id

Returns:

  • the response

thoth.management.commands.gen_stats

class Command

A management command that syncs Thoth entries to the local database

Command.handle(args, options)

A management command that syncs Thoth entries to the local database

Parameters:

  • args: command line arguments
  • options: command line options

Command.generate_stats()

Generate stats for the database

Returns:

  • None

thoth.management.commands.install_bic

class Command

A management command that installs BIC code support


thoth.management.commands.install_bisac

class Command

A management command that installs Bisac code support


thoth.management.commands.install_ror

(c) ΔQ Programming LLP, 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class Command

A management command that fetches and installs the latest ROR support


thoth.management.commands.install_thema

class Command

A management command that installs Thema code support


thoth.management.commands.notify_new_books

class Command

A management command that syncs Thoth entries to the local database

Command.handle(args, options)

A management command that syncs Thoth entries to the local database

Parameters:

  • args: command line arguments
  • options: command line options

thoth.management.commands.sync_thoth

class Command

A management command that syncs Thoth entries to the local database

Command.handle(args, options)

A management command that syncs Thoth entries to the local database

Parameters:

  • args: command line arguments
  • options: command line options

Command.sync_thoth()

Syncs Thoth entries to the local database

Returns:

  • None

Command.run_sync(ret_text)

Runs the sync

Parameters:

  • ret_text: the return text

Returns:

  • None

thoth.management.commands.test_thoth

class DotDict

dot.notation access to dictionary attributes

class Command

A management command that syncs Thoth entries to the local database

Command.handle(args, options)

A management command that tests Thoth sync is working with minimal database interaction

Parameters:

  • args: command line arguments
  • options: command line options

Command.output(text, ret_text)

Outputs text to the console and to the return text

Parameters:

  • text: the text to output
  • ret_text: the return text

Returns:

  • None

Command.test_thoth()

Tests that Thoth sync is working with minimal database interaction

Returns:

  • None

thoth.models

class Publisher

A publisher in Thoth

class Stats

A model to store stats about the Thoth database

class OverallStats

A model to store overall stats about the Thoth database

class CountryStat

A model to store country stats

class BIC

A BIC subject code

class BISAC

A BISAC subject code

class Thema

A Thema subject code

class ThothWorkManager

A manager for Thoth Work objects

ThothWorkManager.get_queryset()

Get optimized queryset for Thoth Work objects excluding book chapters.

Returns:

  • queryset with prefetched related objects

class Work

A work in Thoth

Work.thoth_export_url()

REST export URL for this Thoth instance. Replaces "api" with "export"

Returns:

  • a string of the export url

class WorkNotification

A model to store notifications about new works

WorkNotification.notify()

Notify users of new books

Returns:

  • None

WorkNotification.notifies()

Returns a dictionary of profiles and works of which to notify

Returns:

  • a dictionary of profiles and works

class Subject

A subject code for a work

Subject.subject_display()

Display a code and heading for this subject

Returns:

  • a string of the code and heading

class Contributor

A contributor

class Contribution

A contribution to a work

class ThothSearch

A search in Thoth

ThothSearch.results(elements)

Returns results for this search

Parameters:

  • elements: an optional list of elements to parse instead of those associated with this entry in the database

Returns:

  • a queryset of Works or None

class RORRecord

A record corresponding to an ROR record

class Institution

An institution

class Funding

A funding record

class ThothSearchElement

A search element in Thoth

ThothSearchElement.type_of_search()

Returns a string of the type of search

Returns:

  • a string of the type of search

ThothSearchElement.q()

Generate a Q query for this search method

Returns:

  • a tuple of Q queries for Works, Contributor, and Contribution

thoth.utils

json_response(func)

A decorator that allows for JSONP callbacks

Parameters:

  • func: The function to decorate

Returns:

  • The decorated function

thoth.views

book(request, book_id)

Display a single book

Parameters:

  • request: the request object
  • book_id: the book id

Returns:

  • the response

saved_searches(request)

Display a list of saved searches

Parameters:

  • request: the request object

Returns:

  • the response

delete_search(request, search_id)

Delete a saved search

Parameters:

  • request: the request object
  • search_id: the search id

Returns:

  • the response

run_search(request, search_id)

Run a saved search

Parameters:

  • request: the request object
  • search_id: the search id

Returns:

  • the response

toggle_email(request, search_id)

Toggle email on new result

Parameters:

  • request: the request object
  • search_id: the search id

Returns:

  • the response

driver(request)

Run the Thoth driver

Parameters:

  • request: the request object

Returns:

  • the response

books_by_ror(request, ror_id)

Display a list of books by ROR ID

Parameters:

  • request: the request object
  • ror_id: the ROR ID

Returns:

  • the response

all_books(request)

Display a list of all books

Parameters:

  • request: the request object

Returns:

  • the response

advanced_search(request)

Display the advanced search page

Parameters:

  • request: the request object

Returns:

  • the response

add_search_term(current_search, elements, search_terms_split, search_type)

Add a search term to the current search

Parameters:

  • current_search: the current search
  • elements: the elements
  • search_terms_split: the search terms, split
  • search_type: the type of search

Returns:

  • None

ror_ajax(request)

Return a list of ROR institutions

Parameters:

  • request: the request object

Returns:

  • the response

thothlibrary

GraphQL client for Thoth


thothlibrary.auth

GraphQL client for Thoth

(c) Open Book Publishers, February 2020 This programme is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothAuthenticator

Authentication handler

ThothAuthenticator.get_token()

Perform an authentication request


thothlibrary.cli

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothAPI

A command line interface for the Thoth python API client. This tool allows you to query a Thoth API for publications, works, authors and other endpoints.

ThothAPI.contribution(str contribution_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a contribution by ID from a Thoth instance

Parameters:

  • str contribution_id: the contributor to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.contributions(int limit, int order, int offset, str publishers, str contribution_type, bool raw, str version, str endpoint, bool serialize)

Retrieves contributions from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str contribution_type: the contribution type (e.g. AUTHOR)
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.contribution_count(str publishers, str search, bool raw, str version, str contribution_type, str endpoint)

Retrieves a count of contributions from a Thoth instance

Parameters:

  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str contribution_type: the work type (e.g. AUTHOR)
  • str endpoint: a custom Thoth endpoint

ThothAPI.contributor(str contributor_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a contributor by ID from a Thoth instance

Parameters:

  • str contributor_id: the contributor to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.contributors(int limit, int order, int offset, str search, bool raw, str version, str endpoint, bool serialize)

Retrieves contributors from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.contributor_count(str search, bool raw, str version, str endpoint)

Retrieves a count of contributors from a Thoth instance

Parameters:

  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.institution(str institution_id, bool raw, str version, str endpoint, bool serialize)

Retrieves an institution by ID from a Thoth instance

Parameters:

  • str institution_id: the institution to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.institutions(int limit, int order, int offset, str search, bool raw, str version, str endpoint, bool serialize)

Retrieves institutions from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.funder_count(str search, bool raw, str version, str endpoint)

Retrieves a count of funders from a Thoth instance

Parameters:

  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.funding(str funding_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a funding by ID from a Thoth instance

Parameters:

  • str funding_id: the funding to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.fundings(int limit, int order, int offset, str publishers, bool raw, str version, str endpoint, bool serialize)

Retrieves fundings from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.funding_count(bool raw, str version, str endpoint)

Retrieves a count of fundings from a Thoth instance

Parameters:

  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.imprint(str imprint_id, bool raw, str version, str endpoint, bool serialize)

Retrieves an imprint by ID from a Thoth instance

Parameters:

  • str imprint_id: the imprint to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.imprints(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize)

Retrieves imprints from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.imprint_count(str publishers, str search, bool raw, str version, str endpoint)

Retrieves a count of imprints from a Thoth instance

Parameters:

  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.issue(str issue_id, bool raw, str version, str endpoint, bool serialize)

Retrieves an issue by ID from a Thoth instance

Parameters:

  • str issue_id: the issue to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.issues(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize)

Retrieves issues from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.issue_count(bool raw, str version, str endpoint)

Retrieves a count of issues from a Thoth instance

Parameters:

  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.language(str language_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a language by ID from a Thoth instance

Parameters:

  • str language_id: the language to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.languages(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize, language_relation, language_codes)

Retrieves languages from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object
  • language_relation: select by language relation (e.g. ORIGINAL)
  • language_codes: select by language code (e.g. ADA)

ThothAPI.language_count(bool raw, str version, str endpoint, language_codes, language_relation)

Retrieves a count of languages from a Thoth instance

Parameters:

  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • language_codes: the code to retrieve (e.g. CHI)
  • language_relation: the relation (e.g. ORIGINAL)

ThothAPI.price(str price_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a price by ID from a Thoth instance

Parameters:

  • str price_id: the price to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.prices(int limit, int order, int offset, str publishers, bool raw, str version, str endpoint, bool serialize, str currency_codes)

Retrieves prices from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object
  • str currency_codes: the currency code (e.g. GBP)

ThothAPI.price_count(str currency_codes, bool raw, str version, str endpoint)

Retrieves a count of prices from a Thoth instance

Parameters:

  • str currency_codes: the currency to search by (e.g. GBP)
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.publication(bool raw, str version, str endpoint, bool serialize, str publication_id)

Retrieves a publication by id from a Thoth instance

Parameters:

  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object
  • str publication_id: a publicationId to retrieve

ThothAPI.publications(int limit, int order, int offset, str publishers, str search, str publication_types, bool raw, str version, str endpoint, bool serialize)

Retrieves publications from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • str publication_types: the work type (e.g. PAPERBACK)
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.publication_count(str publishers, str search, bool raw, str version, str publication_types, str endpoint)

Retrieves a count of publications from a Thoth instance

Parameters:

  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str publication_types: the work type (e.g. MONOGRAPH)
  • str endpoint: a custom Thoth endpoint

ThothAPI.publisher(str publisher_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a publisher by ID from a Thoth instance

Parameters:

  • str publisher_id: the publisher to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.publishers(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize)

Retrieves publishers from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.publisher_count(str publishers, str search, bool raw, str version, str endpoint)

Retrieves a count of publishers from a Thoth instance

Parameters:

  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

ThothAPI.reference(str reference_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a reference by ID from a Thoth instance

Parameters:

  • str reference_id: the series to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.references(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize)

Retrieves references from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.series(str series_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a series by ID from a Thoth instance

Parameters:

  • str series_id: the series to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.serieses(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize, series_types)

Retrieves serieses from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object
  • series_types: the type of serieses to return (e.g. BOOK_SERIES)

ThothAPI.series_count(str publishers, str search, bool raw, str version, str series_types, str endpoint)

Retrieves a count of serieses from a Thoth instance

Parameters:

  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str series_types: the work type (e.g. BOOK_SERIES)
  • str endpoint: a custom Thoth endpoint

ThothAPI.subject(str subject_id, bool raw, str version, str endpoint, bool serialize)

Retrieves a subject by ID from a Thoth instance

Parameters:

  • str subject_id: the subject to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.subjects(int limit, int order, int offset, str publishers, str search, bool raw, str version, str endpoint, bool serialize, subject_types)

Retrieves subjects from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object
  • subject_types: select by subject code (e.g. BIC)

ThothAPI.subject_count(bool raw, str version, str endpoint, str subject_types, str search)

Retrieves a count of subjects from a Thoth instance

Parameters:

  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • str subject_types: the type to retrieve (e.g. BIC)
  • str search: a search

ThothAPI.supported_versions()

Retrieves a list of supported Thoth versions @return: a list of supported Thoth versions

ThothAPI.work(str doi, bool raw, str version, str endpoint, bool serialize, str work_id, bool cover_ascii)

Retrieves a work by DOI or ID from a Thoth instance

Parameters:

  • str doi: the doi to fetch
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object
  • str work_id: a workId to retrieve
  • bool cover_ascii: whether to render an ASCII art cover

ThothAPI.works(int limit, int order, int offset, str publishers, str search, str work_types, str work_status, bool raw, str version, str endpoint, bool serialize)

Retrieves works from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • str work_types: the work type (e.g. MONOGRAPH)
  • str work_status: the work status (e.g. ACTIVE)
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.work_count(str publishers, str search, bool raw, str version, str work_types, str work_status, str endpoint)

Retrieves a count of works from a Thoth instance

Parameters:

  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str work_types: the work type (e.g. MONOGRAPH)
  • str work_status: the work status (e.g. ACTIVE)
  • str endpoint: a custom Thoth endpoint

ThothAPI.books(int limit, int order, int offset, str publishers, str search, str work_status, bool raw, str version, str endpoint, bool serialize)

Retrieves books from a Thoth instance

Parameters:

  • int limit: the maximum number of results to return
  • int order: a GraphQL order query statement
  • int offset: the offset from which to retrieve results
  • str publishers: a list of publishers to limit by
  • str search: a search string to search
  • str work_status: the work status (e.g. ACTIVE)
  • bool raw: whether to return a python object or the raw result
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint
  • bool serialize: return a pickled python object

ThothAPI.update_cover(str doi, str work_id, str url, str version, str endpoint)

Update the work cover by DOI or ID

Parameters:

  • str doi: the doi of the work
  • str work_id: the workId of the work
  • str url: the cover URL of the work
  • str version: a custom Thoth version
  • str endpoint: a custom Thoth endpoint

thothlibrary.client

GraphQL client for Thoth

(c) Open Book Publishers, February 2020 and (c) ΔQ Programming LLP, July 2021 This programme is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient

Client to Thoth's GraphQL API

ThothClient.login()

Obtain an authentication token

ThothClient.mutation()

Instantiate a thoth mutation and execute it

ThothClient.query()

Instantiate a thoth query and execute

ThothClient.create_publisher()

Construct and trigger a mutation to add a new publisher object

ThothClient.create_imprint()

Construct and trigger a mutation to add a new imprint object

ThothClient.create_work()

Construct and trigger a mutation to add a new work object

ThothClient.create_publication()

Construct and trigger a mutation to add a new publication object

ThothClient.create_price()

Construct and trigger a mutation to add a new price object

ThothClient.create_language()

Construct and trigger a mutation to add a new language object

ThothClient.create_subject()

Construct and trigger a mutation to add a new subject object

ThothClient.create_series()

Construct and trigger a mutation to add a new series object

ThothClient.create_issue()

Construct and trigger a mutation to add a new issue object

ThothClient.create_contributor()

Construct and trigger a mutation to add a new contributor object

ThothClient.create_contribution()

Construct and trigger a mutation to add a new contribution object

ThothClient.create_affiliation()

Construct and trigger a mutation to add a new affiliation object

ThothClient.create_institution()

Construct and trigger a mutation to add a new institution object

ThothClient.create_location()

Construct and trigger a mutation to add a new location object

ThothClient.create_funding()

Construct and trigger a mutation to add a new funding object

ThothClient.create_work_relation()

Construct and trigger a mutation to add a new work relation object

ThothClient.create_reference()

Construct and trigger a mutation to add a new reference object

ThothClient.update_work()

Construct and trigger a mutation to update a work object

ThothClient.update_institution()

Construct and trigger a mutation to update an institution object

ThothClient.supported_versions()

Shows the versions of Thoth that this API supports @return: a list of version strings


thothlibrary.errors

GraphQL client for Thoth

(c) Open Book Publishers, February 2020 This programme is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothError

Exception to report Thoth errors


thothlibrary.graphql

(c) ΔQ Programming LLP, July 2021 This file is free software; you may redistribute and/or modify it under the terms of the MIT License.

This file is adapted from the Simple GraphQL client for Python 2.7+ https://github.com/prisma-labs/python-graphql-client

The modifications here change the library to use the requests framework instead of urllib. This means that we can then mock requests more easily in unit tests.

The MIT License (MIT)

Copyright (c) 2016 graph.cool, ΔQ Programming LLP, July 2021

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


thothlibrary.mutation

GraphQL client for Thoth

(c) Open Book Publishers, February 2020 This programme is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothMutation

GraphQL mutation in Thoth Mutations are specified in the MUTATIONS list, which specifies their fields and desired return value 'fields' must be a list of tuples (str, bool) where the string represents the attribute and the boolean represents whether the values should be enclosed with quotes and sanitised. Each mutation must have a return_value. Normally this is the primary key of that object, but in some cases, when we don't need to use the return value, we simply specify any field that can be returned in that mutation (e.g. createContribution).

ThothMutation.prepare_request()

Format the mutation request string

ThothMutation.run()

Perform the GraphQL mutation and report any errors

ThothMutation.generate_values()

Returns a set of mutation statements based on object attributes.


thothlibrary.query

GraphQL client for Thoth

(c) Open Book Publishers, February 2020 This programme is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothQuery

GraphQL query in Thoth Queries are specified in the QUERIES list of the API version, which specifies their fields and desired return value 'fields' must be a list of tuples (str, bool) where the string represents the attribute and the boolean represents whether the values should be enclosed with quotes and sanitised.

ThothQuery.prepare_request()

Format the query request string

ThothQuery.run()

Perform the GraphQL query and report any errors

ThothQuery.prepare_parameters()

Returns a string with all query parameters.

ThothQuery.prepare_fields()

Returns a string with all query fields.

ThothQuery.prepare_alias_of()

Returns the GraphQL endpoint name of which the query name is an alias, if any.


thothlibrary.thoth-0_4_2.endpoints

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient0_4_2

The client for Thoth 0.4.2

ThothClient0_4_2.contribution()

Returns a contribution by ID @param contribution_id: the contribution ID @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.contributions()

Returns a contributions list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param contribution_type: the contribution type (e.g. AUTHOR) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_4_2.contribution_count()

Returns a count of contributions @param search: a search string @param publishers: a list of publishers @param contribution_type: a contribution type (e.g. AUTHOR) @param raw: whether to return a raw result @return: a count of contributions

ThothClient0_4_2.contributor()

Returns a contributor by ID @param contributor_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.contributors()

Returns contributors @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param search: a filter string to search @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.contributor_count()

Return a count of contributors @param search: a search string @param raw: whether to return the raw result @return: a count of contributors

ThothClient0_4_2.funder()

Returns a funder by ID @param funder_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.funders()

Return funders @param limit: the limit on the number of results @param offset: the offset from which to start @param order: the order of results @param search: a search string @param raw: whether to return raw result @return: an object or raw result

ThothClient0_4_2.funder_count()

A count of funders @param search: a search string @param raw: whether to return raw result @return: a count of funders

ThothClient0_4_2.funding()

Returns a funding by ID @param funding_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.fundings()

Returns a fundings list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_4_2.funding_count()

A count of fundings @param raw: whether to return a raw result @return: a count of fundings

ThothClient0_4_2.imprint()

Return an imprint @param imprint_id: the imprint @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.imprints()

Return imprints @param limit: the limit on the number of results returned @param offset: the offset from which to begin @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers by which to limit the query @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_4_2.imprint_count()

A count of imprints @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of imprints

ThothClient0_4_2.issue()

Returns an issue by ID @param issue_id: the issue @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.issues()

Return issues @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit results @param raw: whether to return a raw response @return: an object or raw response

ThothClient0_4_2.issue_count()

A count of issues @param raw: whether to return a raw result @return: a count of issues

ThothClient0_4_2.language()

Returns a language by ID @param language_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.languages()

Return languages @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @param language_code: the language code to query @param language_relation: the language relation to query (e.g. ORIGINAL) @return: an object or raw result

ThothClient0_4_2.language_count()

A count of languages @param language_code: a language code (e.g. CHI) @param language_relation: a language relation (e.g. ORIGINAL) @param raw: whether to return a raw result @return: a count of languages

ThothClient0_4_2.price()

Returns a price by ID @param price_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.prices()

Returns prices @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param currency_code: the currency code (e.g. GBP) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_4_2.price_count()

A count of prices @param currency_code: a currency code (e.g. GBP) @param raw: whether to return a raw result @return: a count of prices

ThothClient0_4_2.publication()

Returns a publication by ID @param publication_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.publications()

Returns publications @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param publication_type: the work type (e.g. PAPERBACK) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_4_2.publication_count()

A count of publications @param search: a search string @param publishers: a list of publishers by which to limit the result @param publication_type: the publication type (e.g. PAPERBACK) @param raw: whether to return a raw result @return: a count of publications

ThothClient0_4_2.publisher()

Returns a publisher by ID @param publisher_id: the publisher @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.publishers()

Return publishers @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_4_2.publisher_count()

Return a count of publishers @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of publishers

ThothClient0_4_2.series()

Returns a series by ID @param series_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.serieses()

Return serieses @param limit: the limit on the number of results to retrieve @param offset: the offset from which to start @param order: the order in which to present the results @param search: a search string @param publishers: a list of publishers by which to limit results @param series_type: the series type (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_4_2.series_count()

Return a count of serieses @param search: a search string @param publishers: a list of publishers by which to limit the results @param series_type: the type of series (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: a count of serieses

ThothClient0_4_2.subject()

Returns a subject by ID @param subject_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.subjects()

Return subjects @param limit: a limit on the number of results @param offset: the offset from which to retrieve results @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers @param raw: whether to return a raw result @param subject_type: the subject type (e.g. BIC) @return: subjects

ThothClient0_4_2.subject_count()

A count of subjects @param subject_type: the type of subject @param search: a search string @param raw: whether to return a raw result @return: a count of subjects

ThothClient0_4_2.works()

Returns works @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_4_2.work_by_doi()

Returns a work by DOI @param doi: the DOI to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.work_by_id()

Returns a work by ID @param work_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_4_2.work_count()

A count of works @param search: a search string @param publishers: a list of publishers by which to limit results @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a raw result @return: a count of works


thothlibrary.thoth-0_4_2.structures

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class StructureBuilder

A class to build a Thoth object structure

StructureBuilder.create_structure()

Creates an object structure from dictionary input @return: an object


thothlibrary.thoth-0_4_2.tests.tests

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.


thothlibrary.thoth-0_5_0.endpoints

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient0_5_0

The client for Thoth 0.4.2

ThothClient0_5_0.contribution()

Returns a contribution by ID @param contribution_id: the contribution ID @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.contributions()

Returns a contributions list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param contribution_type: the contribution type (e.g. AUTHOR) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_5_0.contribution_count()

Returns a count of contributions @param search: a search string @param publishers: a list of publishers @param contribution_type: a contribution type (e.g. AUTHOR) @param raw: whether to return a raw result @return: a count of contributions

ThothClient0_5_0.contributor()

Returns a contributor by ID @param contributor_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.contributors()

Returns contributors @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param search: a filter string to search @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.contributor_count()

Return a count of contributors @param search: a search string @param raw: whether to return the raw result @return: a count of contributors

ThothClient0_5_0.funder()

Returns a funder by ID @param funder_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.funders()

Return funders @param limit: the limit on the number of results @param offset: the offset from which to start @param order: the order of results @param search: a search string @param raw: whether to return raw result @return: an object or raw result

ThothClient0_5_0.funder_count()

A count of funders @param search: a search string @param raw: whether to return raw result @return: a count of funders

ThothClient0_5_0.funding()

Returns a funding by ID @param funding_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.fundings()

Returns a fundings list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_5_0.funding_count()

A count of fundings @param raw: whether to return a raw result @return: a count of fundings

ThothClient0_5_0.imprint()

Return an imprint @param imprint_id: the imprint @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.imprints()

Return imprints @param limit: the limit on the number of results returned @param offset: the offset from which to begin @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers by which to limit the query @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_5_0.imprint_count()

A count of imprints @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of imprints

ThothClient0_5_0.issue()

Returns an issue by ID @param issue_id: the issue @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.issues()

Return issues @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit results @param raw: whether to return a raw response @return: an object or raw response

ThothClient0_5_0.issue_count()

A count of issues @param raw: whether to return a raw result @return: a count of issues

ThothClient0_5_0.language()

Returns a language by ID @param language_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.languages()

Return languages @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @param language_code: the language code to query @param language_relation: the language relation to query (e.g. ORIGINAL) @return: an object or raw result

ThothClient0_5_0.language_count()

A count of languages @param language_code: a language code (e.g. CHI) @param language_relation: a language relation (e.g. ORIGINAL) @param raw: whether to return a raw result @return: a count of languages

ThothClient0_5_0.price()

Returns a price by ID @param price_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.prices()

Returns prices @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param currency_code: the currency code (e.g. GBP) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_5_0.price_count()

A count of prices @param currency_code: a currency code (e.g. GBP) @param raw: whether to return a raw result @return: a count of prices

ThothClient0_5_0.publication()

Returns a publication by ID @param publication_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.publications()

Returns publications @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param publication_type: the work type (e.g. PAPERBACK) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_5_0.publication_count()

A count of publications @param search: a search string @param publishers: a list of publishers by which to limit the result @param publication_type: the publication type (e.g. PAPERBACK) @param raw: whether to return a raw result @return: a count of publications

ThothClient0_5_0.publisher()

Returns a publisher by ID @param publisher_id: the publisher @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.publishers()

Return publishers @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_5_0.publisher_count()

Return a count of publishers @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of publishers

ThothClient0_5_0.series()

Returns a series by ID @param series_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.serieses()

Return serieses @param limit: the limit on the number of results to retrieve @param offset: the offset from which to start @param order: the order in which to present the results @param search: a search string @param publishers: a list of publishers by which to limit results @param series_type: the series type (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_5_0.series_count()

Return a count of serieses @param search: a search string @param publishers: a list of publishers by which to limit the results @param series_type: the type of series (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: a count of serieses

ThothClient0_5_0.subject()

Returns a subject by ID @param subject_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.subjects()

Return subjects @param limit: a limit on the number of results @param offset: the offset from which to retrieve results @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers @param raw: whether to return a raw result @param subject_type: the subject type (e.g. BIC) @return: subjects

ThothClient0_5_0.subject_count()

A count of subjects @param subject_type: the type of subject @param search: a search string @param raw: whether to return a raw result @return: a count of subjects

ThothClient0_5_0.works()

Returns works @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_5_0.work_by_doi()

Returns a work by DOI @param doi: the DOI to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.work_by_id()

Returns a work by ID @param work_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_5_0.work_count()

A count of works @param search: a search string @param publishers: a list of publishers by which to limit results @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a raw result @return: a count of works


thothlibrary.thoth-0_5_0.structures

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class StructureBuilder

A class to build a Thoth object structure

StructureBuilder.create_structure()

Creates an object structure from dictionary input @return: an object


thothlibrary.thoth-0_5_0.tests.tests

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.


thothlibrary.thoth-0_6_0.endpoints

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient0_6_0

The client for Thoth 0.4.2

ThothClient0_6_0.contribution()

Returns a contribution by ID @param contribution_id: the contribution ID @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.contributions()

Returns a contributions list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param contribution_type: the contribution type (e.g. AUTHOR) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_6_0.contribution_count()

Returns a count of contributions @param search: a search string @param publishers: a list of publishers @param contribution_type: a contribution type (e.g. AUTHOR) @param raw: whether to return a raw result @return: a count of contributions

ThothClient0_6_0.contributor()

Returns a contributor by ID @param contributor_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.contributors()

Returns contributors @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param search: a filter string to search @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.contributor_count()

Return a count of contributors @param search: a search string @param raw: whether to return the raw result @return: a count of contributors

ThothClient0_6_0.institution()

Returns an institution by ID @param funder_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.institutions()

Return institutions @param limit: the limit on the number of results @param offset: the offset from which to start @param order: the order of results @param search: a search string @param raw: whether to return raw result @return: an object or raw result

ThothClient0_6_0.funder_count()

A count of funders @param search: a search string @param raw: whether to return raw result @return: a count of funders

ThothClient0_6_0.funding()

Returns a funding by ID @param funding_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.fundings()

Returns a fundings list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_6_0.funding_count()

A count of fundings @param raw: whether to return a raw result @return: a count of fundings

ThothClient0_6_0.imprint()

Return an imprint @param imprint_id: the imprint @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.imprints()

Return imprints @param limit: the limit on the number of results returned @param offset: the offset from which to begin @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers by which to limit the query @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_6_0.imprint_count()

A count of imprints @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of imprints

ThothClient0_6_0.issue()

Returns an issue by ID @param issue_id: the issue @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.issues()

Return issues @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit results @param raw: whether to return a raw response @return: an object or raw response

ThothClient0_6_0.issue_count()

A count of issues @param raw: whether to return a raw result @return: a count of issues

ThothClient0_6_0.language()

Returns a language by ID @param language_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.languages()

Return languages @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @param language_code: the language code to query @param language_relation: the language relation to query (e.g. ORIGINAL) @return: an object or raw result

ThothClient0_6_0.language_count()

A count of languages @param language_code: a language code (e.g. CHI) @param language_relation: a language relation (e.g. ORIGINAL) @param raw: whether to return a raw result @return: a count of languages

ThothClient0_6_0.price()

Returns a price by ID @param price_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.prices()

Returns prices @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param currency_code: the currency code (e.g. GBP) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_6_0.price_count()

A count of prices @param currency_code: a currency code (e.g. GBP) @param raw: whether to return a raw result @return: a count of prices

ThothClient0_6_0.publication()

Returns a publication by ID @param publication_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.publications()

Returns publications @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param publication_type: the work type (e.g. PAPERBACK) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_6_0.publication_count()

A count of publications @param search: a search string @param publishers: a list of publishers by which to limit the result @param publication_type: the publication type (e.g. PAPERBACK) @param raw: whether to return a raw result @return: a count of publications

ThothClient0_6_0.publisher()

Returns a publisher by ID @param publisher_id: the publisher @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.publishers()

Return publishers @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_6_0.publisher_count()

Return a count of publishers @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of publishers

ThothClient0_6_0.series()

Returns a series by ID @param series_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.serieses()

Return serieses @param limit: the limit on the number of results to retrieve @param offset: the offset from which to start @param order: the order in which to present the results @param search: a search string @param publishers: a list of publishers by which to limit results @param series_type: the series type (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_6_0.series_count()

Return a count of serieses @param search: a search string @param publishers: a list of publishers by which to limit the results @param series_type: the type of series (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: a count of serieses

ThothClient0_6_0.subject()

Returns a subject by ID @param subject_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.subjects()

Return subjects @param limit: a limit on the number of results @param offset: the offset from which to retrieve results @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers @param raw: whether to return a raw result @param subject_type: the subject type (e.g. BIC) @return: subjects

ThothClient0_6_0.subject_count()

A count of subjects @param subject_type: the type of subject @param search: a search string @param raw: whether to return a raw result @return: a count of subjects

ThothClient0_6_0.works()

Returns works @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_6_0.work_by_doi()

Returns a work by DOI @param doi: the DOI to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.work_by_id()

Returns a work by ID @param work_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_6_0.work_count()

A count of works @param search: a search string @param publishers: a list of publishers by which to limit results @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a raw result @return: a count of works


thothlibrary.thoth-0_6_0.structures

(c) ΔQ Programming LLP, November 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class StructureBuilder

A class to build a Thoth object structure

StructureBuilder.create_structure()

Creates an object structure from dictionary input @return: an object


thothlibrary.thoth-0_6_0.tests.tests

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.


thothlibrary.thoth-0_8_0.endpoints

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient0_8_0

The client for Thoth 0.4.2

ThothClient0_8_0.contribution()

Returns a contribution by ID @param contribution_id: the contribution ID @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.contributions()

Returns a contributions list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param contribution_type: the contribution type (e.g. AUTHOR) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_0.contribution_count()

Returns a count of contributions @param search: a search string @param publishers: a list of publishers @param contribution_type: a contribution type (e.g. AUTHOR) @param raw: whether to return a raw result @return: a count of contributions

ThothClient0_8_0.contributor()

Returns a contributor by ID @param contributor_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.contributors()

Returns contributors @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param search: a filter string to search @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.contributor_count()

Return a count of contributors @param search: a search string @param raw: whether to return the raw result @return: a count of contributors

ThothClient0_8_0.institution()

Returns an institution by ID @param funder_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.institutions()

Return institutions @param limit: the limit on the number of results @param offset: the offset from which to start @param order: the order of results @param search: a search string @param raw: whether to return raw result @return: an object or raw result

ThothClient0_8_0.funder_count()

A count of funders @param search: a search string @param raw: whether to return raw result @return: a count of funders

ThothClient0_8_0.funding()

Returns a funding by ID @param funding_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.fundings()

Returns a fundings list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_0.funding_count()

A count of fundings @param raw: whether to return a raw result @return: a count of fundings

ThothClient0_8_0.imprint()

Return an imprint @param imprint_id: the imprint @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.imprints()

Return imprints @param limit: the limit on the number of results returned @param offset: the offset from which to begin @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers by which to limit the query @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_8_0.imprint_count()

A count of imprints @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of imprints

ThothClient0_8_0.issue()

Returns an issue by ID @param issue_id: the issue @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.issues()

Return issues @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit results @param raw: whether to return a raw response @return: an object or raw response

ThothClient0_8_0.issue_count()

A count of issues @param raw: whether to return a raw result @return: a count of issues

ThothClient0_8_0.language()

Returns a language by ID @param language_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.languages()

Return languages @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @param language_code: the language code to query @param language_relation: the language relation to query (e.g. ORIGINAL) @return: an object or raw result

ThothClient0_8_0.language_count()

A count of languages @param language_code: a language code (e.g. CHI) @param language_relation: a language relation (e.g. ORIGINAL) @param raw: whether to return a raw result @return: a count of languages

ThothClient0_8_0.price()

Returns a price by ID @param price_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.prices()

Returns prices @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param currency_code: the currency code (e.g. GBP) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_0.price_count()

A count of prices @param currency_code: a currency code (e.g. GBP) @param raw: whether to return a raw result @return: a count of prices

ThothClient0_8_0.publication()

Returns a publication by ID @param publication_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.publications()

Returns publications @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param publication_type: the work type (e.g. PAPERBACK) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_0.publication_count()

A count of publications @param search: a search string @param publishers: a list of publishers by which to limit the result @param publication_type: the publication type (e.g. PAPERBACK) @param raw: whether to return a raw result @return: a count of publications

ThothClient0_8_0.publisher()

Returns a publisher by ID @param publisher_id: the publisher @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.publishers()

Return publishers @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_8_0.publisher_count()

Return a count of publishers @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of publishers

ThothClient0_8_0.series()

Returns a series by ID @param series_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.serieses()

Return serieses @param limit: the limit on the number of results to retrieve @param offset: the offset from which to start @param order: the order in which to present the results @param search: a search string @param publishers: a list of publishers by which to limit results @param series_type: the series type (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_8_0.series_count()

Return a count of serieses @param search: a search string @param publishers: a list of publishers by which to limit the results @param series_type: the type of series (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: a count of serieses

ThothClient0_8_0.subject()

Returns a subject by ID @param subject_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.subjects()

Return subjects @param limit: a limit on the number of results @param offset: the offset from which to retrieve results @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers @param raw: whether to return a raw result @param subject_type: the subject type (e.g. BIC) @return: subjects

ThothClient0_8_0.subject_count()

A count of subjects @param subject_type: the type of subject @param search: a search string @param raw: whether to return a raw result @return: a count of subjects

ThothClient0_8_0.works()

Returns works @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_0.work_by_doi()

Returns a work by DOI @param doi: the DOI to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.work_by_id()

Returns a work by ID @param work_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_0.work_count()

A count of works @param search: a search string @param publishers: a list of publishers by which to limit results @param work_type: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a raw result @return: a count of works


thothlibrary.thoth-0_8_0.structures

(c) ΔQ Programming LLP, November 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class StructureBuilder

A class to build a Thoth object structure

StructureBuilder.create_structure()

Creates an object structure from dictionary input @return: an object


thothlibrary.thoth-0_8_4.endpoints

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient0_8_4

The client for Thoth 0.4.2

ThothClient0_8_4.contribution()

Returns a contribution by ID @param contribution_id: the contribution ID @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.contributions()

Returns a contributions list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param contribution_type: the contribution type (e.g. AUTHOR) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_4.contribution_count()

Returns a count of contributions @param search: a search string @param publishers: a list of publishers @param contribution_type: a contribution type (e.g. AUTHOR) @param raw: whether to return a raw result @return: a count of contributions

ThothClient0_8_4.contributor()

Returns a contributor by ID @param contributor_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.contributors()

Returns contributors @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param search: a filter string to search @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.contributor_count()

Return a count of contributors @param search: a search string @param raw: whether to return the raw result @return: a count of contributors

ThothClient0_8_4.institution()

Returns an institution by ID @param funder_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.institutions()

Return institutions @param limit: the limit on the number of results @param offset: the offset from which to start @param order: the order of results @param search: a search string @param raw: whether to return raw result @return: an object or raw result

ThothClient0_8_4.funding_count()

A count of fundings @param raw: whether to return a raw result @return: a count of fundings

ThothClient0_8_4.funding()

Returns a funding by ID @param funding_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.fundings()

Returns a fundings list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_4.imprint()

Return an imprint @param imprint_id: the imprint @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.imprints()

Return imprints @param limit: the limit on the number of results returned @param offset: the offset from which to begin @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers by which to limit the query @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_8_4.imprint_count()

A count of imprints @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of imprints

ThothClient0_8_4.issue()

Returns an issue by ID @param issue_id: the issue @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.issues()

Return issues @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit results @param raw: whether to return a raw response @return: an object or raw response

ThothClient0_8_4.issue_count()

A count of issues @param raw: whether to return a raw result @return: a count of issues

ThothClient0_8_4.language()

Returns a language by ID @param language_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.languages()

Return languages @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @param language_codes: the language code to query @param language_relation: the language relation to query (e.g. ORIGINAL) @return: an object or raw result

ThothClient0_8_4.language_count()

A count of languages @param language_codes: a language code (e.g. CHI) @param language_relation: a language relation (e.g. ORIGINAL) @param raw: whether to return a raw result @return: a count of languages

ThothClient0_8_4.price()

Returns a price by ID @param price_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.prices()

Returns prices @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param currency_codes: the currency code (e.g. GBP) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_4.price_count()

A count of prices @param currency_codes: a currency code (e.g. GBP) @param raw: whether to return a raw result @return: a count of prices

ThothClient0_8_4.publication()

Returns a publication by ID @param publication_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.publications()

Returns publications @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param publication_types: the work type (e.g. PAPERBACK) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_4.publication_count()

A count of publications @param search: a search string @param publishers: a list of publishers by which to limit the result @param publication_types: the publication type (e.g. PAPERBACK) @param raw: whether to return a raw result @return: a count of publications

ThothClient0_8_4.publisher()

Returns a publisher by ID @param publisher_id: the publisher @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.publishers()

Return publishers @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_8_4.publisher_count()

Return a count of publishers @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of publishers

ThothClient0_8_4.series()

Returns a series by ID @param series_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.serieses()

Return serieses @param limit: the limit on the number of results to retrieve @param offset: the offset from which to start @param order: the order in which to present the results @param search: a search string @param publishers: a list of publishers by which to limit results @param series_types: the series type (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_8_4.series_count()

Return a count of serieses @param search: a search string @param publishers: a list of publishers by which to limit the results @param series_types: the type of series (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: a count of serieses

ThothClient0_8_4.subject()

Returns a subject by ID @param subject_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.subjects()

Return subjects @param limit: a limit on the number of results @param offset: the offset from which to retrieve results @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers @param raw: whether to return a raw result @param subject_types: the subject type (e.g. BIC) @return: subjects

ThothClient0_8_4.subject_count()

A count of subjects @param subject_types: the type of subject @param search: a search string @param raw: whether to return a raw result @return: a count of subjects

ThothClient0_8_4.works()

Returns works @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_types: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_4.work_by_doi()

Returns a work by DOI @param doi: the DOI to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.work_by_id()

Returns a work by ID @param work_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_8_4.work_count()

A count of works @param search: a search string @param publishers: a list of publishers by which to limit results @param work_types: the work type (e.g. MONOGRAPH) @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a raw result @return: a count of works

ThothClient0_8_4.books()

Returns books @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_8_4.book_count()

A count of books @param search: a search string @param publishers: a list of publishers by which to limit results @param work_status: the work status (e.g. ACTIVE) @param raw: whether to return a raw result @return: a count of works


thothlibrary.thoth-0_8_4.structures

(c) ΔQ Programming LLP, November 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class StructureBuilder

A class to build a Thoth object structure

StructureBuilder.create_structure()

Creates an object structure from dictionary input @return: an object


thothlibrary.thoth-0_8_4.tests.tests

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.


thothlibrary.thoth-0_9_0.endpoints

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class ThothClient0_9_0

The client for Thoth 0.9.0

ThothClient0_9_0.contribution()

Returns a contribution by ID @param contribution_id: the contribution ID @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.contributions()

Returns a contributions list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param contribution_type: the contribution type (e.g. AUTHOR) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.contribution_count()

Returns a count of contributions @param search: a search string @param publishers: a list of publishers @param contribution_type: a contribution type (e.g. AUTHOR) @param raw: whether to return a raw result @return: a count of contributions

ThothClient0_9_0.contributor()

Returns a contributor by ID @param contributor_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.contributors()

Returns contributors @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param search: a filter string to search @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.contributor_count()

Return a count of contributors @param search: a search string @param raw: whether to return the raw result @return: a count of contributors

ThothClient0_9_0.institution()

Returns an institution by ID @param funder_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.institutions()

Return institutions @param limit: the limit on the number of results @param offset: the offset from which to start @param order: the order of results @param search: a search string @param raw: whether to return raw result @return: an object or raw result

ThothClient0_9_0.institution_count()

Return a count of institutions @param search: a search string @param raw: whether to return the raw result @return: a count of institutions

ThothClient0_9_0.funding_count()

A count of fundings @param raw: whether to return a raw result @return: a count of fundings

ThothClient0_9_0.funding()

Returns a funding by ID @param funding_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.fundings()

Returns a fundings list @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.imprint()

Return an imprint @param imprint_id: the imprint @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.imprints()

Return imprints @param limit: the limit on the number of results returned @param offset: the offset from which to begin @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers by which to limit the query @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_9_0.imprint_count()

A count of imprints @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of imprints

ThothClient0_9_0.issue()

Returns an issue by ID @param issue_id: the issue @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.issues()

Return issues @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit results @param raw: whether to return a raw response @return: an object or raw response

ThothClient0_9_0.issue_count()

A count of issues @param raw: whether to return a raw result @return: a count of issues

ThothClient0_9_0.language()

Returns a language by ID @param language_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.languages()

Return languages @param limit: the limit on the number of results to return @param offset: the offset from which to begin @param order: the order in which to return results @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @param language_codes: the language code to query @param language_relation: the language relation to query (e.g. ORIGINAL) @return: an object or raw result

ThothClient0_9_0.language_count()

A count of languages @param language_codes: a language code (e.g. CHI) @param language_relation: a language relation (e.g. ORIGINAL) @param raw: whether to return a raw result @return: a count of languages

ThothClient0_9_0.price()

Returns a price by ID @param price_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.prices()

Returns prices @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param currency_codes: the currency code (e.g. GBP) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.price_count()

A count of prices @param currency_codes: a currency code (e.g. GBP) @param raw: whether to return a raw result @return: a count of prices

ThothClient0_9_0.publication()

Returns a publication by ID @param publication_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.publications()

Returns publications @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param publication_types: the work type (e.g. PAPERBACK) @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.publication_count()

A count of publications @param search: a search string @param publishers: a list of publishers by which to limit the result @param publication_types: the publication type (e.g. PAPERBACK) @param raw: whether to return a raw result @return: a count of publications

ThothClient0_9_0.publisher()

Returns a publisher by ID @param publisher_id: the publisher @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.publishers()

Return publishers @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_9_0.publisher_count()

Return a count of publishers @param search: a search string @param publishers: a list of publishers by which to limit the result @param raw: whether to return a raw result @return: a count of publishers

ThothClient0_9_0.reference()

Returns a reference by ID @param reference_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.references()

Return references @param limit: the limit on the number of results @param offset: the offset from which to begin @param order: the order for the returned results @param search: a search string @param publishers: a list of publishers by which to limit the results @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_9_0.series()

Returns a series by ID @param series_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.serieses()

Return serieses @param limit: the limit on the number of results to retrieve @param offset: the offset from which to start @param order: the order in which to present the results @param search: a search string @param publishers: a list of publishers by which to limit results @param series_types: the series type (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: an object or raw result

ThothClient0_9_0.series_count()

Return a count of serieses @param search: a search string @param publishers: a list of publishers by which to limit the results @param series_types: the type of series (e.g. BOOK_SERIES) @param raw: whether to return a raw result @return: a count of serieses

ThothClient0_9_0.subject()

Returns a subject by ID @param subject_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.subjects()

Return subjects @param limit: a limit on the number of results @param offset: the offset from which to retrieve results @param order: the order in which to present results @param search: a search string @param publishers: a list of publishers @param raw: whether to return a raw result @param subject_types: the subject type (e.g. BIC) @return: subjects

ThothClient0_9_0.subject_count()

A count of subjects @param subject_types: the type of subject @param search: a search string @param raw: whether to return a raw result @return: a count of subjects

ThothClient0_9_0.works()

Returns works @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_types: the work types (e.g. [MONOGRAPH, TEXTBOOK]) @param work_status: (deprecated) the work status (e.g. ACTIVE) @param work_statuses: the work statuses (e.g. [ACTIVE]) @param updated_at_with_relations: timestamp and choice of greater/less than, for limiting results by last update time @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.work_by_doi()

Returns a work by DOI @param doi: the DOI to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.work_by_id()

Returns a work by ID @param work_id: the ID to fetch @param raw: whether to return a python object or the raw result @return: either an object (default) or raw server response

ThothClient0_9_0.work_count()

A count of works @param search: a search string @param publishers: a list of publishers by which to limit results @param work_types: the work types (e.g. [MONOGRAPH, TEXTBOOK]) @param work_status: (deprecated) the work status (e.g. ACTIVE) @param work_statuses: the work statuses (e.g. [ACTIVE]) @param updated_at_with_relations: timestamp and choice of greater/less than, for limiting results by last update time @param raw: whether to return a raw result @return: a count of works

ThothClient0_9_0.books()

Returns books @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_status: (deprecated) the work status (e.g. ACTIVE) @param work_statuses: the work statuses (e.g. [ACTIVE]) @param updated_at_with_relations: timestamp and choice of greater/less than, for limiting results by last update time @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.bookIds()

Returns books, in a minimal representation containing only workId @param limit: the maximum number of results to return @param order: a GraphQL order query statement @param offset: the offset from which to retrieve results @param publishers: a list of publishers to limit by @param search: a filter string to search @param work_status: (deprecated) the work status (e.g. ACTIVE) @param work_statuses: the work statuses (e.g. [ACTIVE]) @param updated_at_with_relations: timestamp and choice of greater/less than, for limiting results by last update time @param raw: whether to return a python object or the raw server result @return: either an object (default) or raw server response

ThothClient0_9_0.book_count()

A count of books @param search: a search string @param publishers: a list of publishers by which to limit results @param work_status: (deprecated) the work status (e.g. ACTIVE) @param work_statuses: the work statuses (e.g. [ACTIVE]) @param updated_at_with_relations: timestamp and choice of greater/less than, for limiting results by last update time @param raw: whether to return a raw result @return: a count of works


thothlibrary.thoth-0_9_0.structures

(c) ΔQ Programming LLP, November 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.

class StructureBuilder

A class to build a Thoth object structure

StructureBuilder.create_structure()

Creates an object structure from dictionary input @return: an object


thothlibrary.thoth-0_9_0.tests.tests

(c) ΔQ Programming LLP, July 2021 This program is free software; you may redistribute and/or modify it under the terms of the Apache License v2.0.


vocab.forms

class NewVocabForm

Form for creating a new vocab word.

class NewStandardForm

Form for creating a new standard.

class SubjectForm

Form for creating a new subject.


vocab.models

class StandardVocab

A standard to which a package can attest compliance

StandardVocab.pk_str()

Returns the pk as a string

Returns:

  • str

class PackageStandardAttestation

An attestation of compliance with a standard

class AttestationHistory

Historical record of standard attestations being added or removed from packages.

class BandingVocab

A standardised vocabulary option for package banding. E.g. "Jisc Band 1"

BandingVocab.is_fte()

Returns true if the banding is fte

Returns:

  • bool

BandingVocab.m2m_display()

Returns a string for the m2m display

Returns:

  • str

class SubjectVocab

A subject vocabulary for categorizing packages.

SubjectVocab.subject_pk_str()

Returns the pk as a string

Returns:

  • str

vocab.utils

notify_initiatives_new_vocabs(banding_type, new_vocabs, request)

Notify initiatives of new vocabs

Parameters:

  • banding_type: the banding type
  • new_vocabs: the new vocabs
  • request: the request

Returns:

  • None

notify_initiatives_new_standards(standard, request)

Notify initiatives of new standards

Parameters:

  • standard: the standard
  • request: the request

Returns:

  • None

vocab.views

vocab_list(request)

List all the vocab items in the system

Parameters:

  • request: the request object

Returns:

  • the response object

vocab_delete(request, vocab_id)

Delete a vocab item

Parameters:

  • request: the request object
  • vocab_id: the id of the vocab item to delete

Returns:

  • the response object

vocab_new(request, vocab_to_edit)

Create a new vocab item

Parameters:

  • request: the request object
  • vocab_to_edit: the id of the vocab item to edit

Returns:

  • the response object

standards_vocab_list(request)

List all the standards vocab items in the system

Parameters:

  • request: the request object

Returns:

  • the response object

standard_new(request, vocab_to_edit)

Create a new standard vocab item

Parameters:

  • request: the request object
  • vocab_to_edit: the id of the vocab item to edit

Returns:

  • the response object

standard_delete(request, vocab_id)

Delete a standard vocab item

Parameters:

  • request: the request object
  • vocab_id: the id of the vocab item to delete

Returns:

  • the response object

subjects(request)

List all the subjects in the system

Parameters:

  • request: the request object

Returns:

  • the response object

new_edit_subject(request, subject_id)

Create or edit a subject

Parameters:

  • request: the request object
  • subject_id: the id of the subject to edit

Returns:

  • the response object

Clone this wiki locally