def parse_piccolo_url(url):
    """Parse URL of form:
        server:[port][/piccolo_lib]

    Port is an integer
    """
    url = url.strip()
    u = url.split('/')
    server_port = u[0]
    try:
        piccolo_lib = u[1]
    except IndexError:
        piccolo_lib = None

    u = server_port.split(':')
    server = u[0]
    try:
        port = int(u[1])  # Expect port to be an integer if specfied
    except IndexError:
        port = None
    except ValueError:
        # not an integer, silently ignore
        port = None

    if not server:
        server = None

    if not piccolo_lib:
        piccolo_lib = None

    return (server, port, piccolo_lib)