snowplow_analytics_sdk/run_manifests.py
def split_full_path(path):
    """Return pair of bucket without protocol and path

    Arguments:
    path - valid S3 path, such as s3://somebucket/events

    >>> split_full_path('s3://mybucket/path-to-events')
    ('mybucket', 'path-to-events/')
    >>> split_full_path('s3://mybucket')
    ('mybucket', None)
    >>> split_full_path('s3n://snowplow-bucket/some/prefix/')
    ('snowplow-bucket', 'some/prefix/')
    """
    if path.startswith('s3://'):
        path = path[5:]
    elif path.startswith('s3n://'):
        path = path[6:]
    elif path.startswith('s3a://'):
        path = path[6:]
    else:
        raise ValueError("S3 path should start with s3://, s3n:// or "
                         "s3a:// prefix")
    parts = path.split('/')
    bucket = parts[0]
    path = '/'.join(parts[1:])
    return bucket, normalize_prefix(path)
def split_full_path(path):
    """Return pair of bucket without protocol and path

    Arguments:
    path - valid S3 path, such as s3://somebucket/events

    >>> split_full_path('s3://mybucket/path-to-events')
    ('mybucket', 'path-to-events/')
    >>> split_full_path('s3://mybucket')
    ('mybucket', None)
    >>> split_full_path('s3n://snowplow-bucket/some/prefix/')
    ('snowplow-bucket', 'some/prefix/')
    """
    if path.startswith('s3://'):
        path = path[5:]
    elif path.startswith('s3n://'):
        path = path[6:]
    elif path.startswith('s3a://'):
        path = path[6:]
    else:
        raise ValueError("S3 path should start with s3://, s3n:// or "
                         "s3a:// prefix")
    parts = path.split('/')
    bucket = parts[0]
    path = '/'.join(parts[1:])
    return bucket, normalize_prefix(path)
Return pair of bucket without protocol and path

    Arguments:
    path - valid S3 path, such as s3://somebucket/events

    >>> split_full_path('s3://mybucket/path-to-events')
    ('mybucket', 'path-to-events/')
    >>> split_full_path('s3://mybucket')
    ('mybucket', None)
    >>> split_full_path('s3n://snowplow-bucket/some/prefix/')
    ('snowplow-bucket', 'some/prefix/')