Skip to main content

Euler diagrams in python

Project description

a night owl

Version python downloads Binder

codecov Documentation Status Lint workflow

Euler's diagrams are non-empty Venn's diagrams. For further information about:

  1. the library: on URL https://eule.readthedocs.io;
  2. 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:
# {('b', 'c'): [4], ('c', 'd'): [5], ('b', 'c', 'd'): [3], ('d',): [6], ('b',): [2]}
euler_instance.remove_key('a')
print(euler_instance.as_dict())

Project details


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.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

eule-1.2.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file eule-1.2.0.tar.gz.

File metadata

  • Download URL: eule-1.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for eule-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b45a704312fe40e618f05569908a099b5af6b70db7562194eb253a077f4e1006
MD5 8b204c042151c4b5b70903481ffe3c77
BLAKE2b-256 eae0072a1c0e9bcc308f4f5de08d3600775a14e8f83f293e8e5585e74c15266a

See more details on using hashes here.

File details

Details for the file eule-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: eule-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for eule-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40574bf4d75328278d92ba714ae41db233efec1cf9dc6be9158fd39bbd89cf75
MD5 62f3b3feed1a7820d56cc3d03184ab0d
BLAKE2b-256 b09c74ea97ac5cd8ae6e775d5123040b1b178dc3ffa04c8b8421ed42ff7646d3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page