Leafy Graph Library
Leafy is a python graph library written in cython. This mix gives the speed of writing the library in c with the benefit of python bindings.
Usage
Graph Objects
Leafy supports Sparse Graphs, these create Adjacencey lists underneath.
To instantiate a graph object we need to know the number of nodes (verticies) in the graph, and if the graph is directed. Graphs defualt to undirected.
from leafy import Graph
g = Graph(4, True)
g.add_edge(0, 1)
g.add_edge(2, 3)
g.add_edge(2, 1)
g.list
Search
Leafy can run Depth First Search (DFS) and Breadth First Search (BFS) on a graph and return the graph search properties.
To run a search we need to define the graph to search and the node to start from.
Before you can view the properties we must call .run().
from leafy.search import DFS
dfs = DFS(g, 0)
dfs.run()
dfs.simple_path(12)
dfs.bridges
Digraphs
For diagraphs leafy supports DFS which can be imported from leafy.digraph
from leafy.digraph import DFS
dfs = DFS(g, 0)
dfs.run()
dfs.is_dag
dfs.topological_order()
Shortest Distance
For network shortest path leafy supports single source Dijkstra which can be imported from leafy.shortest_path
from leafy.shortest_path import Dijkstra
dij = Dijkstra(g, 0)
dij.run()
dij.path(3)
Metadata
Release files for leafy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 6.8 MB
Release files / leafy-1.0.0-cp311-cp311-win_amd64.whl
| Download URL | leafy-1.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 164.1 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d1a67c8ecfdf06a0d72dfc8a35eb5451435dea9ba439989f1413b883a4c93d06
|
|
BLAKE2b-256 checksum How to use checksums |
96779009169b63cf6f18f9a9f21a02f0f76e90124f6afd08f0c99a15ce1a1661
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
| Download URL | leafy-1.0.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a0b8ce228d00f8ce7f410a82ba620dbf721cf94e963de63b567f3fa9dbb3653b
|
|
BLAKE2b-256 checksum How to use checksums |
b48dfa52381e1f5285189d73db9bd0e6a93a4be60616b1094ad351ed54b83412
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | leafy-1.0.0-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 354.4 kB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
66c2a1b79b5b0d35372fb17d8f85e6170393fdf2b4311c7e40ecdb1777e9351b
|
|
BLAKE2b-256 checksum How to use checksums |
05249bcf80d6b83e9fbd6acce6c4345f6803476817a16092792713954512fecd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp310-cp310-win_amd64.whl
| Download URL | leafy-1.0.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 163.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
34f3bd3b7b5933602cc73179cc055ec63e21ece0c4d01171ca4f518b8aa889d1
|
|
BLAKE2b-256 checksum How to use checksums |
e7cd44e0c7a658f9597ef5beca55655e3d146b69cfa6e4671a01e523a1288043
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
| Download URL | leafy-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 957.9 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
8a791dc1abdb3e746c2222b0e2c6ade387b57b56c8ef8a17702d1da9e85b0314
|
|
BLAKE2b-256 checksum How to use checksums |
94778f684282db679f4554b9a12deb7a43e292ba8ffb9387ee4146af0201cf33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl
| Download URL | leafy-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl |
|---|---|
| Size | 176.0 kB |
| Tags | CPython 3.10 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
1967e1f019a3ed1d1d107ae31ce957d5cdf8d0264b078ed625643610efaf87e7
|
|
BLAKE2b-256 checksum How to use checksums |
8d88612efc203693452a04e5b0139551967e3f53f878e2f5b2fc807393f85bbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp39-cp39-win_amd64.whl
| Download URL | leafy-1.0.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 195.9 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
72facfd2b769c93ba6c04287961433411ed6bb4b9ba3e09bf476c73f84926f7b
|
|
BLAKE2b-256 checksum How to use checksums |
b7a859ad7be4a2e4a97c75f395720f0f9a0df6912fd574cfb8983ade8f09a31b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
| Download URL | leafy-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 973.7 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
d60f723a87b88ece7c9de85085fe571569afec77e54781ddbb6279ac6eb9af86
|
|
BLAKE2b-256 checksum How to use checksums |
e00b3d47549e80beb4a899dabb1ed0c12d824d6ba6cb08cf7e7080eb44b015af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp39-cp39-macosx_11_0_x86_64.whl
| Download URL | leafy-1.0.0-cp39-cp39-macosx_11_0_x86_64.whl |
|---|---|
| Size | 178.8 kB |
| Tags | CPython 3.9 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
692c45d53616a069468c2d21ff199bad9d29d92b23d4a6e46fb2c24e4267d4e9
|
|
BLAKE2b-256 checksum How to use checksums |
314446e5068efd4c2ad965028741d634f2fe058363beacd1ce299eecad2d1a83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp38-cp38-win_amd64.whl
| Download URL | leafy-1.0.0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 195.9 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d13debef0a074713efb7ab380dba69ecd0ab0a6e59db2573ad6a8f514064abf2
|
|
BLAKE2b-256 checksum How to use checksums |
32416abc2ab2a2049f08e2a85d58c929cad7b3e0a8c7a7e394d33cd43eb7a350
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
| Download URL | leafy-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 965.6 kB |
| Tags | CPython 3.8 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
8d10803b3bb19aa4ae37620aefe04e039c759b2d405944a87edce11458728468
|
|
BLAKE2b-256 checksum How to use checksums |
de06a3276c07819fffc849b6c0ffc3224d02d20cd1207259fcab5fde134ca121
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp38-cp38-macosx_11_0_x86_64.whl
| Download URL | leafy-1.0.0-cp38-cp38-macosx_11_0_x86_64.whl |
|---|---|
| Size | 180.5 kB |
| Tags | CPython 3.8 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
afd8776d8c24a3d3c2d6982d5d1a290137f63e06aa7d3abbb8a061a87b914d97
|
|
BLAKE2b-256 checksum How to use checksums |
a9f3c3b1a6c9ccd2c6f876d1bd5a1587352d6387a3f52a7d11bfa909fdcb6d58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp37-cp37m-win_amd64.whl
| Download URL | leafy-1.0.0-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 196.2 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
61d10c7f26b2d7b9a09c3719e2bc96da675a3c502aeb0e27903cccd0fe2d5d6d
|
|
BLAKE2b-256 checksum How to use checksums |
5a096418af08eaa0fa170674981b9a697b7144a9674c6222a6ab9c0174c69587
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
| Download URL | leafy-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 893.4 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
5763999916687da14f430d2fd4375f0135b1c812b1191f08528765d8551bedac
|
|
BLAKE2b-256 checksum How to use checksums |
7be455d82e97d44ad50f0b45a6d1713f4eb2ba3e225c10149f66d6a9e5f4c302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / leafy-1.0.0-cp37-cp37m-macosx_11_0_x86_64.whl
| Download URL | leafy-1.0.0-cp37-cp37m-macosx_11_0_x86_64.whl |
|---|---|
| Size | 180.1 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
8e7c901e14355a2e9a7298c2a83c23cec2accd719b8e85be7b90080178b51d48
|
|
BLAKE2b-256 checksum How to use checksums |
b185613fe44acea55f3cec5c53cfc4518901d2fe23d1afd0324fef12f901f69d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for leafy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.