Euler diagrams in python
Project description
Euler's diagrams are non-empty Venn's diagrams. For further information about:
- the library: on URL https://eule.readthedocs.io;
- Euler diagrams: on wikipedia article https://en.wikipedia.org/wiki/Euler_diagram
Motivation
How to install
We run the command on desired installation environment:
pip install eule
Minimal example
Click to unfold usage
We run command python example.py
on the folder with file example.py
and following content:
#!/usr/bin/env python
from eule import euler, euler_keys, euler_boundaries, Euler
sets = {
'a': [1, 2, 3],
'b': [2, 3, 4],
'c': [3, 4, 5],
'd': [3, 5, 6]
}
euler_diagram = euler(sets)
euler_keys = euler_keys(sets)
euler_boundaries = euler_boundaries(sets)
euler_instance=Euler(sets)
# Euler dictionary:
# {'a,b': [2], 'b,c': [4], 'a,b,c,d': [3], 'c,d': [5], 'd': [6], 'a': [1]}
print(euler_diagram)
print(euler_instance.as_dict())
print('\n')
# Euler keys list:
# ['a,b', 'b,c', 'a,b,c,d', 'c,d', 'd', 'a']
print(euler_keys)
print(euler_instance.euler_keys())
print('\n')
# Euler boundaries dictionary:
# {
# 'a': ['b', 'c', 'd'],
# 'b': ['a', 'c', 'd'],
# 'c': ['a', 'b', 'd'],
# 'd': ['a', 'b', 'c']
# }
print(euler_boundaries)
print(euler_instance.euler_boundaries())
print('\n')
# Euler instance match:
# {'a'}
# {'a', 'b'}
# {'c', 'a', 'b'}
print(euler_instance.match({1,2,3}))
print(euler_instance.match({1,2,3,4}))
print(euler_instance.match({1,2,3,4,5}))
print('\n')
# Euler instance getitem dunder:
# [1, 2, 3]
# [1, 2, 3]
# [1, 2, 3, 4]
# [1, 2, 3, 4, 5]
print(euler_instance['a'])
print(euler_instance[('a', )])
print(euler_instance[('a', 'b', )])
print(euler_instance[('a', 'b', 'c',)])
print('\n')
# Euler instance remove_key:
euler_instance.remove_key('a')
print(euler_instance.as_dict())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eule-1.0.8.tar.gz
(6.7 kB
view details)
Built Distribution
eule-1.0.8-py3-none-any.whl
(7.7 kB
view details)
File details
Details for the file eule-1.0.8.tar.gz
.
File metadata
- Download URL: eule-1.0.8.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.8.10 Linux/5.15.0-88-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14b936590bdfffae4d73eb573bcbe50920b1bea234d0ca4986e88e433127ea60 |
|
MD5 | b7f55110f17b87f49204f1ddd954cee4 |
|
BLAKE2b-256 | fc8b0baceebae0bc0da819d7a43f02eb3d96709620e67c18a4470ec38522fec9 |
File details
Details for the file eule-1.0.8-py3-none-any.whl
.
File metadata
- Download URL: eule-1.0.8-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.8.10 Linux/5.15.0-88-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b98e0600ea3cc0f94e31aa5af57323fbe3d05d00e061f1e5c61633e8ff101dc |
|
MD5 | 94dfe1e36e176b803ff082df90c6147f |
|
BLAKE2b-256 | 1df9fb84c63c4f18d4f205b11b1128533063caf1f00d0bbabe1d8b94e281b88e |