Skip to main content

Python bindings for Software Heritage graph access (built on webgraph)

Project description

webgraph-swh

Python bindings for accessing Software Heritage graphs, built on top of webgraph.

Provides bidirectional graph traversal with full access to node properties (SWHIDs, timestamps, persons, messages) for the SWH compressed graph.

Installation

pip install webgraph-swh

This automatically installs the webgraph package as a dependency.

Building from source

Pre-built wheels are compiled for a generic target. You should however enable native optimizations (e.g., BMI2 for faster succinct data structures) by building the wheel from source:

pip install maturin
git clone https://github.com/vigna/webgraph-py.git
cd webgraph-py/webgraph-swh
maturin build --release -o dist
pip install dist/*.whl

The repository's .cargo/config.toml sets target-cpu=native, so the resulting wheel will be optimized for your CPU. We suggest to use the same approach for webgraph.

Quick start

from webgraph_swh import SwhGraph, PyNodeType

# Load the SWH graph with all properties
g = SwhGraph("/path/to/swh-graph")

print(f"Nodes: {g.num_nodes()}")

# Traverse successors with properties
for s in g.successors(42):
    print(g.swhid(s), g.node_type(s))

# Filter by node type
revrel = g.subgraph("rev,rel")
for s in revrel.successors(42):
    print(revrel.author_id(s), revrel.author_timestamp(s))

# Access the underlying BvGraph
bv = g.forward_graph()
for root, parent, node, dist in bv.bfs():
    ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

webgraph_swh-0.1.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

webgraph_swh-0.1.3-cp314-cp314-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

webgraph_swh-0.1.3-cp314-cp314-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

webgraph_swh-0.1.3-cp314-cp314-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

webgraph_swh-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

webgraph_swh-0.1.3-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

webgraph_swh-0.1.3-cp313-cp313-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

webgraph_swh-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

webgraph_swh-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

webgraph_swh-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

webgraph_swh-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

webgraph_swh-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

webgraph_swh-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

webgraph_swh-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

webgraph_swh-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

webgraph_swh-0.1.3-cp310-cp310-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file webgraph_swh-0.1.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9f3ae3ff807b32785fd8228c7e344dc39bdcde7c33c103a020cff436a7ba643
MD5 7616cb65a2d256e0877df03f8e64bb6e
BLAKE2b-256 17e1681adbd49fe207026c5f03185877e030d1d4296ac29f599c5ac7639b2267

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aade8ad168477512ec1fc4aef168af89d9aab6da6dbb0b4251ef6107d2cd6b6c
MD5 7f15a3afbbd1e3e426c717541a89f72d
BLAKE2b-256 838379cf0fa5d1e982e0f3fa497d55bdbde77bd7600a4595e057a06de4c5790e

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51ef85d7bacb94830b02dee64dfabcd86470bebe639706b84549a341ef45afb8
MD5 5b94107adbf85bf588f7bedd10e972e9
BLAKE2b-256 73a8dc134a45959fbd51ac5d44fa553a0fc318bf93727623815f114ece560bf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 47497f9176b29153497f8fada1af33dbd8e6fc355c1663063137b5d061b63365
MD5 26b0bfc59ba96f4af4538713686050c1
BLAKE2b-256 13d4df33b82bd926c923e350be51a4945719abac218eeb874e479d77db19b28f

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 be18192ef801dbf7f84d8170984f63f17a27a2be9e4e913c27e513b08a3332d7
MD5 c7958bb231145bca3edaeac7911c8767
BLAKE2b-256 87c1607bcae4ce433455b9874fb00a95900559beeda5020ae0a95a50d529f74c

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a5a791179549365a977d571fe0b087f3c801784779f39d5d5d335dcd8f28ab0b
MD5 c41232d1a7f852bb3dfb0182f8839751
BLAKE2b-256 4d54022673847c8a8ba42b35b00a3305950e16177c0f77d127499459f6fcfdd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3ec4f84e4e05c052947b7666d316dd6366bf9bb20da09953664fe38e9bb85a65
MD5 d5b9b9b9994fbcb996eb1d3cfcc7493f
BLAKE2b-256 d55bc928e2e59cddbbb235a3ba68e1358c0c6bbeb2896a752d85d850b873e11e

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 be9926c9aee6d2d33bc639f4703397a7465f2cb5fc5168290662450af600f8d9
MD5 ec40d8542f274de42c4e905153c4a45c
BLAKE2b-256 e33167ccf756e75103b21869b4dd0290e6a064a752c97dc01ab0c74e1ee3a9c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2df5cd99ef0d9afd793a1bafc4e326ddab2a1ead7331af65cb83965f3d7944ae
MD5 5773f029d83806fa2b8e14125e8c8c89
BLAKE2b-256 8c32fe44f69beceb577b20972314baced233975ebcf3f3e5fe91aa2e1ff8e14c

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a3705d14f377e3c9226f371391537223993e79ec9c30d67447f727af479dd0e7
MD5 15688c20aa1f97c77b4afbb6c647fc28
BLAKE2b-256 90fc307298ee8c6a7da4283267dff300b8b4c1da93f578b128bd864bf7907570

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bacfc1403fd8f326dceeb1f5eb4e20edbbaf2df872cf5991e6be4257f2cab9b6
MD5 b8e7b34b5acf97e49d15c9eb9a3934cc
BLAKE2b-256 643098e0a333138185326dd076141c43787f7661100f12585fda3dd37b34ac71

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adb06c983ccc46c8014281ff2382c4e40e6a77029643f9fcf06e40c58dbab22b
MD5 625a119d67b331b37c02e90ecbf8fb26
BLAKE2b-256 e3d40fdae229e010fb05265537bf8f0eeb0053d6ebdf5549466f2248c36ed9e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5b6038e2d76f8025b4d0cd01ae861830ff97eb793eafb6fb92e473428fd274f0
MD5 bea2b23152779de30129d550d8d19e64
BLAKE2b-256 8b50e3d2856829bced60af82e45b9372a84e57b0f5b63a19012fe3c33be45a16

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d87b1a4baa475fd71a640756e09e8c4b7f3e6693fe67b5cdca73daa6be8e190b
MD5 d184962b300a0a7e43a268bc4dcb6e9a
BLAKE2b-256 44da27d13842210c2aa134c9120911d4bc2baa5d528b532ab78a2d758fd99eb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 50ee9b844e5d8da9207f7b978411d8d06e13780274173e95d66d9abe6fc4651f
MD5 3d00c7e460e7e5e3d0511fbed2490685
BLAKE2b-256 ec64084f1676a2b4e935b7e7bd44fe8f8767c51e9d807da6bac9a16e85d7363c

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webgraph_swh-0.1.3-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for webgraph_swh-0.1.3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7da12c5b799b424ec401094083c37b2a664120fb6eb1c2004184a084b9f7c2b1
MD5 310ae0060c0c797da2606b5f9d7c2a4f
BLAKE2b-256 57ba73dd845887f1385c4cd5aebeec72124dae726b69eafe428876766f588319

See more details on using hashes here.

Provenance

The following attestation bundles were made for webgraph_swh-0.1.3-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: workflow.yml on vigna/webgraph-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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