Skip to main content

Python package for structuredly managing directional relationship between objects.

Project description

polyfamily_tree

Python package for structuredly managing directional relationship between objects.

Though it uses allegory of 'family tree', it doesn't implement 'tree data structure'.
Alternatively, relationship in default is drawn by organizing Directed Acyclic Graph(DAG).
This means that there is a loop-less hierarchy in between members.
Not like tree, member of this data structure can have multiple parents
thus the package is named 'poly'family

Graph organizing members is not a concrete object.
All participants store its vicinity relationship in itself. By default relationship is build bidirectional - parent knows about children while
children knows about parent. But this can be manually tweaked using
lower level methods like fm_append fm_remove.

Methods use prefix 'fm_' to be distinguished.

Installation

Use pip to install the package.
pip install polyfamily_tree

Usage

from polyfamily_tree import *    


class MyMember(FamilyMember): # inherit `FamilyMember`  
    def __init__(self):
        super().__init__()    # vital for initiating required attributes  
        # your __init__ code below
        ...

a, b = MyMember(), MyMember()  
a.fm_append_member(parent=a, child=b) # build relationship
print(b.fm_get_parents())

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
https://github.com/grasshopperTrainer/polyfamily_tree

Alternative contect

For any questions :
grasshoppertrainer@gmail.com

Licence

MIT

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

polyfamily_tree-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polyfamily_tree-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file polyfamily_tree-0.1.0.tar.gz.

File metadata

  • Download URL: polyfamily_tree-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for polyfamily_tree-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41013166789d0034114aa1f343006b71b10a58559cc121fce54cab34138eb7ee
MD5 d655f1d61dd90eced37016ba94136efe
BLAKE2b-256 1ca2c215d702c74195f35af8ea654fda687ae195f295dbc9e2c9d891d2fc9d86

See more details on using hashes here.

File details

Details for the file polyfamily_tree-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: polyfamily_tree-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for polyfamily_tree-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c24231f51a3b93eb9da7387ec4b3cee6c3e01a69b0d134bcdb1458154acc3d55
MD5 56da736ee172e24259b97dbd62ac4d55
BLAKE2b-256 229fd7a77584be74fa53e515e4a321e928c102566c045a320dd0819d5977e029

See more details on using hashes here.

Supported by

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