A Python implementation for networks of nodes.
Project description
Description
A Python package that provides structure for networks of interconnected nodes using the DOT language for representation.
Installation
The source code for pynetworks is hosted on GitHub. You can install pynetworks with pip:
pip install pynetworks
Documentation
Read the latest documentation for pynetworks here.
Example Usage
Node
>>> a = Node('A')
>>> b = Node('B')
>>> a.connect(b, 3)
Printing a gives:
graph {
"A" -- "B" [label=3]
}
shortest_path()
>>> a = Node('A')
>>> b = Node('B')
>>> c = Node('C')
>>> a.connect(b, 3)
>>> b.connect(c, 5)
>>> path = shortest_path(a, c)
>>> path.weight
8
Printing path gives:
graph {
"B" -- "C" [label=5]
"A" -- "B" [label=3]
}
Network
>>> a = Node('A')
>>> b = Node('B')
>>> c = Node('C')
>>> a.connect(b, 3)
>>> net = Network([a, b, c])
Printing net gives:
graph {
"C"
"A" -- "B" [label=3]
}
License
GNU.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynetworks-0.6.1.tar.gz.
File metadata
- Download URL: pynetworks-0.6.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c072d16f4ec8f7032cf14d8d03ff1841d802fb3eff42d5e886475529dca2bd62
|
|
| MD5 |
afa34565553e6ddd90603b281a21fed0
|
|
| BLAKE2b-256 |
c8eae36bfcfecdf09c82b8dcb37f15bf1bb830346e02d3fe525359b9f97bd7f2
|
File details
Details for the file pynetworks-0.6.1-py3-none-any.whl.
File metadata
- Download URL: pynetworks-0.6.1-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4342b843fd135b09cf974ab76a2e5c03c7020afd6a5785c745f06249edc2a072
|
|
| MD5 |
8adf48f92171989730b63fcb4619b4d1
|
|
| BLAKE2b-256 |
30bf9b16aea697c9a654cb47817067de6ba0169d2eeb54e958e9b1e1233a349e
|