schrodinger.application.matsci.typography module

Module to format text

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.typography.TYPO_TYPE(value)

Bases: enum.Enum

An enumeration.

unicode = 1
markup = 2
schrodinger.application.matsci.typography.subscript_digits(digits, typo_type=TYPO_TYPE.unicode)

Convert a number to subscripted string

  • digits (int) – The number that needs to be subscripted

  • typo_type (TYPO_TYPE) – The typography type


The integer converted to subscript string using html markup

Return type



ValueError – When the typography type does not have a way for creating subscript style

schrodinger.application.matsci.typography.trim_str(text, max_len, suffix='...')

Trim the string to approximately max_len. Add a suffix if the string is longer than max_len.

  • text – String to trim

  • max_len (int) – Max length of the string

  • suffix (str) – Suffix to add if the string is to be trimmed

Return str

Trimmed string

schrodinger.application.matsci.typography.title_case(original, exceptions=('an', 'of', 'the', 'for'), skip_single_letters=True)

Convert the string to title case, optionally ignoring articles and single letters

Examples with default kwargs: “Number of molecules”: “Number of Molecules” “axis b”: “Axis b”

  • original (str) – The string to make title case

  • exceptions (tuple) – The words to not capitalize

  • skip_single_letters (bool) – Whether single letters should not be capitalized

Return type



The string in title case