Skip to content

utils

Module for utilities commonly used by XML parsers in schemas.

Functions:

  • split_ids

    Function for converting a string representation of a list of quoted integers into a Python list object.

split_ids

split_ids(input: str) -> list

Function for converting a string representation of a list of quoted integers into a Python list object.

Examples:

>>> s = "3001,3110,3113,3288"
>>> split_ids(s)
[3001, 3110, 3113, 3288]
>>> s = '[\"3001\",\"3110\",\"3113\",\"3288\"]'
>>> split_ids(s)
[3001, 3110, 3113, 3288]
>>> l = ['[\"3001\",\"3110\",\"3113\",\"3288\"]']
>>> split_ids(l)
[3001, 3110, 3113, 3288]
>>> s = '[]'
>>> split_ids(s)
[]

Parameters:

  • input

    (str | Any) –

    List of integers.

Returns:

  • list ( list ) –

    description