Skip to main content

Euler diagrams in python

Project description

a night owl

Version downloads codecov Documentation Status

Binder

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

Uploaded Source

Built Distribution

eule-1.3.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eule-1.3.1.tar.gz
  • Upload date:
  • Size: 213.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.3

File hashes

Hashes for eule-1.3.1.tar.gz
Algorithm Hash digest
SHA256 d5e4efe738e08468736afd4086f502f73bb4296fc9fe1824351bb046dc5806c2
MD5 d8f7048568e68c4b3d940f119af12cda
BLAKE2b-256 e6c4816b7899c160dfb5feab06c7d373683c59e7b2ba6b7cb9a331f5a8fcecd4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eule-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.3

File hashes

Hashes for eule-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba71e007808bcbf9eef728e49eba04c44027df994cfadb6bdb8e96eb0d1e2bb
MD5 6a834999582299b6f63a8aacee02ecf9
BLAKE2b-256 c349dead3b7b384639efb2ac5b9038b9f227266b7330647af49980c417ef7326

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