def getPublicAttributes(obj):
    """Return a list of public attribute names."""
    attrs = []
    for attr in dir(obj):
        if attr.startswith('_'):
            continue
        try:
            getattr(obj, attr)
        except AttributeError:
            continue
        attrs.append(attr)
    return attrs
