proteindf_bridge.str_processing モジュール

class proteindf_bridge.str_processing.StrUtils[ソース]

ベースクラス: object

classmethod add_spaces(s, num_add)[ソース]

行頭にnum_add分のスペースを追加する

classmethod check_pickled(data, level=0)[ソース]
classmethod del_spaces(s, num_del)[ソース]
classmethod get_common_str(str1, str2)[ソース]

(先頭から)共通文字列を返す

>>> a = 'abcdef'
>>> b = 'abcdefg'
>>> Utils.get_common_str(a, b)
'abcdef'
classmethod num_spaces(s)[ソース]

行頭のスペース数を返す

classmethod sort_nicely(given_list)[ソース]

人間の直感に合う順序でリストをソートする。 ref: http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html

classmethod str_to_bool(input_str)[ソース]
classmethod to_bytes(unicode_or_str)[ソース]

strをbytes(utf-8)に変換する。

classmethod to_unicode(unicode_or_str)[ソース]

byteをstr(utf-8)に変換する

classmethod to_unicode_dict(d)[ソース]

byteを保存してある辞書に対して、 str(utf-8)をキーとする辞書に変換する。

classmethod to_unicode_list(l)[ソース]
classmethod unindent_block(s)[ソース]