lib/py: separating core and web