Metadata-Version: 2.4
Name: md.python.graph
Version: 1.1.0
Summary: Set of contracts & operations over graph type
License: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: requires-python
Dynamic: summary

# md.python.graph

md.python.graph component defines contracts to perform operations over
graph type, and provides few useful tools out from box.

## Architecture overview

[![Architecture overview][architecture-overview]][architecture-overview]

## Component overview

```python3
# Types
NodeType = typing.TypeVar('NodeType', bound=typing.Hashable)
GraphType = typing.Mapping[NodeType, typing.Collection[NodeType]]
GraphPathType = typing.Iterable[NodeType]
TopologicalSortType = typing.Callable[[GraphType[NodeType]], typing.Iterable[NodeType]]

# Implementation 
def topological_sort_ascending(graph: GraphType[NodeType]) -> typing.Iterable[NodeType]: ...

def topological_sort_descending(
    graph: GraphType[NodeType],
    initial_node: typing.Iterable[NodeType] = None
) -> typing.Iterable[NodeType]: ...

def get_paths(graph: GraphType[NodeType], include_subtree: bool = False) -> typing.Tuple[
    typing.List[GraphPathType[NodeType]],
    typing.List[GraphPathType[NodeType]],
]: ...
```

## Install

```sh
pip install md.python.graph --index-url https://source.md.land/python/
```

## [Documentation](docs/index.md)

Read documentation with examples: <https://development.md.land/python/md.python.graph/>

## [Changelog](changelog.md)
## [License (MIT)](license.md)

[architecture-overview]: docs/_static/architecture-overview.class-diagram.svg
