Added constraints on relationships to Python library, updated tutorial