Skip to main content

A library for managing hierarchical numerical data structures

Project description

fractal-forest

fractal-forest is a Python library designed for efficient management and analysis of hierarchical numerical data structures. It supports recursive tree structures where each node contains a tuple of an integer and a generic value. The library can be optimized for real-time distributed processing and OLAP compatibility.

Features

  • Recursive tree structures with multiple children per node
  • Node values as tuples: (int, Any) for numerical aggregation and associated data
  • Automated tree creation and child addition
  • Integrity checks with automatic propagation of updates to parent and child nodes
  • Designed for hierarchical structured data such as:
    • Financial data (e.g., budgeting, accounting hierarchies)
    • Inventory systems (e.g., product categories, stock levels)
    • Organizational charts
    • Nested project management tasks
    • Any domain requiring structured aggregation and integrity validation

Installation

pip install fractal-forest

Usage

from fractal_forest import Node, Tree

# Create the root node with a value (int, label)
root = Node((10, "root"))

# Create children
child1 = Node((5, "child1"))
child2 = Node((7, "child2"))

# Add children to root
root.add_child(child1)
root.add_child(child2)

# Add grandchild
grandchild = Node((3, "grandchild"))
child1.add_child(grandchild)

# Print the tree
tree = Tree(root)
tree.print_tree()

# Access the updated value at root
print(root.value)  # Output will be (25, 'root') after aggregation

License

MIT License

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

fractal_forest-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

fractal_forest-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fractal_forest-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for fractal_forest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b6637aa954468646bed6c86dce2c2372052d253e55d1e8d834f9d9f6c723b0bd
MD5 e37940ed58a64c30db5a47bdaeb1849f
BLAKE2b-256 46f7c9b1559f5755474818be33c4b99cde916f08042b9c860d3aa9c225bc58ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fractal_forest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for fractal_forest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ee28b4f703d0edb15f83d5cb3b814a47595d6eadaa8b0f8c2a1fd57b5a998cb
MD5 8067fe4aca3f9f73c0a21d720a2fafef
BLAKE2b-256 20ed3dd4e454fa7269d50c92dc36655de8840e2d93eb263992fe60f551fd63d2

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