https://github.com/neurobin/cyclic
Handle cyclic relation
https://github.com/neurobin/cyclic
circular circular-dependencies cyclic python-library
Last synced: 7 months ago
JSON representation
Handle cyclic relation
- Host: GitHub
- URL: https://github.com/neurobin/cyclic
- Owner: neurobin
- License: other
- Created: 2018-09-26T15:40:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-27T15:00:53.000Z (over 5 years ago)
- Last Synced: 2025-05-13T20:35:59.589Z (8 months ago)
- Topics: circular, circular-dependencies, cyclic, python-library
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/neurobin/cyclic)
Handle cyclic relation compared by value.
# Install
Install from Pypi:
```bash
pip install cyclic
```
# Usage
```python
from cyclic import Cyclic
cy = Cyclic()
# Let's say A is a prent of B
cy.add(B, A)
# B is a parent of C
cy.add(C, B)
# C is a parent of A (cyclic)
cy.add(A, C)
# let's see if C is in any kind of cyclic relation
print(cy.is_cyclic(C)) # True
```