Skip to main content

An open source, standard data file format for graph data storage and retrieval.

Project description

GraphAr Python SDK

GraphAr Python SDK provides Python bindings for the GraphAr C++ library, allowing user to work with GraphAr formatted graph data in Python environments. It includes both a high-level API for data manipulation and a command-line interface for common operations.

Installation

Prerequisites

  • Python >= 3.7
  • pip (latest version recommended)
  • CMake >= 3.15 (for building from source)
  • Apache Arrow >= 12.0 (for building from source)

Install from Pypi

Install the latest released version from PyPI:

pip install -U graphar

Install from Source

Clone the repository and install the Python package:

git clone https://github.com/apache/incubator-graphar.git
cd incubator-graphar
pip install ./python

For verbose output during installation:

pip install -v ./python

Using Docker (Recommended)

The easiest way to get started is by using our pre-configured Docker environment:

docker run -it ghcr.io/apache/graphar-dev

Quick Start

Importing the Package

After installation, you can import the GraphAr Python SDK in your Python scripts:

import graphar

Basic Usage

Loading graph information:

import graphar

# Load graph info from a YAML file
graph_info = graphar.graph_info.GraphInfo.load("path/to/graph.yaml")

# Access vertex information
vertex_info = graph_info.get_vertex_info("person")
print(f"Vertex type: {vertex_info.get_type()}")

# Access edge information
edge_info = graph_info.get_edge_info("person", "knows", "person")
print(f"Edge type: {edge_info.get_edge_type()}")

Command-Line Interface

GraphAr Python SDK also provides a command-line interface for common operations such as checking metadata, showing graph information, and importing data.

For detailed information about the CLI functionality, please see CLI Documentation.

API Documentation

build docs

make install_docs
make docs

The Python SDK exposes the core GraphAr functionality through several modules:

  • graphar.graph_info: Main API for working with graph, vertex, and edge information
  • graphar.high_level: High-level API for data reading and writing

Examples

[!NOTE] under development.

You can find various examples in the examples directory which demonstrate usage of the underlying C++ library. These concepts translate directly to the Python SDK.

Development

To contribute to the Python SDK, please follow the guidelines in the main CONTRIBUTING.md file.

License

GraphAr is distributed under Apache License 2.0. Please note that third-party libraries may not have the same license as GraphAr.

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

graphar-0.13.0.dev0.tar.gz (297.5 kB view details)

Uploaded Source

Built Distributions

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

graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

graphar-0.13.0.dev0-cp313-cp313-macosx_11_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

graphar-0.13.0.dev0-cp312-cp312-macosx_11_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

graphar-0.13.0.dev0-cp311-cp311-macosx_11_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

graphar-0.13.0.dev0-cp310-cp310-macosx_11_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

graphar-0.13.0.dev0-cp39-cp39-macosx_11_0_arm64.whl (20.6 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file graphar-0.13.0.dev0.tar.gz.

File metadata

  • Download URL: graphar-0.13.0.dev0.tar.gz
  • Upload date:
  • Size: 297.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for graphar-0.13.0.dev0.tar.gz
Algorithm Hash digest
SHA256 b77ce9a468775fbe121a9bb8849c9aebbbf6abb353762c77a7baf9aa92b1bcb4
MD5 ba102a5ec357f78ec17b60456a2e85f5
BLAKE2b-256 8aad25e2551de8c86ccf9d6dbc2a0b1f79f40e48012242cccb0a9affcc071558

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0.tar.gz:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 df97e57ac2536a94c75f50be1b5f11251312e28a56df2170a87aa6ffb8f6d97a
MD5 5f34bf72a93e2cb31f664e7b2284f540
BLAKE2b-256 0246e1b8910565fdc69505ac406377f3a9505f4f4aa5460186550dad05c953c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d2b7c73b2da8c757f2e528a33038a971e749e86183bc5c111282ea8bd478bcab
MD5 9f75b30e33a6326bf736ba4203b05f27
BLAKE2b-256 ccae2af4edc195df62f58becb5d925367d3764d90a1575307e6463b941b22c50

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp313-cp313-manylinux_2_28_aarch64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b88033c3717d60a31d7b44b4f2b5cb48b55f6384131c1b27a7318adba3e01ac
MD5 4ffb46700120bd97a29f3b83ea49d75d
BLAKE2b-256 0cb21ededcf4c2caa7186777c22ffd12fe0aa5a2b03810fd3f41e335008111cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cd8c74048f370e84dbb23a91797201ec35ed610de2042d211066a328f9de7f5e
MD5 98989c80337a033067ecbd7feda72f2c
BLAKE2b-256 8784089b74412f2398ecd390e8f59753a5608353a56a5ff44c103afd8453a9d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 64532897507c9e67ae041c44d096d340d8e389aefe8e6ee12c25ed35546145dc
MD5 2f85c29c6757771fcb508f3baba6be52
BLAKE2b-256 3a9db30c543c228707b3d47b87570f13fd621a1e947f3dcc6a8dc3325960a164

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fdcbca7892d3064abba1cbe5781833f9898cc3711607e6d57e051e070d568726
MD5 fd207c2c21fef9f8f93b13a38f679e22
BLAKE2b-256 f1c069cbfdbd7aa664bb44cce356e96024ae8967c3ad330e61d0b3da65953ef8

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b785661253183d59beb31d89f7f568c26c728c27afbe040c81524d9fbad3b29
MD5 d70873c674fb64e78375914b469ad8e0
BLAKE2b-256 df9b487f876f276e1dfae7b27186b72fe21c45d5f2ad4cdc1efffdcad183cb9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f80b21c6f8779198884c7fde09ee9ecbf7609d1dd092ac3803ece1234182c4ea
MD5 328a7ef89b4e303390b99e93d6df8172
BLAKE2b-256 41a336354b521e78f8810e9bb6a70e5de9067a9319f63fa7083afde2e591b076

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81039a39aaacda5de7b22ba7cf2bf7baafe2beac91ec3b6acb9bdfac61b8a306
MD5 326754337bc94d04bff9ecfd306762c2
BLAKE2b-256 4859f5771b33acd8d44fb77a4b24b571d4f853f4a193f72f2c84fbcbbf74b815

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f6f02555ead3b5be05a91f180b100179eaaa60799c4f1b8893616ddefb12153c
MD5 b0c1e711beffb9967511f72d3683ebf6
BLAKE2b-256 d15341d65fba05d9d0d659d15298f9f28a9ff546d2df5475f3c7c44b06579da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 800ac56df67e6d3988b6dfa650375f5c4806b840932f2b442e8a660b5bbaea69
MD5 2abeaf40e2861c7df9f97133be9b63df
BLAKE2b-256 98d2710a3f003d90dda329badc3be41f3c030d1ee4d197d3a9508891e5a994d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a0c40e4c2f0c2ea9a65914040cc07c5549dbd0e739e0644973737490cf340dfe
MD5 3884b70aad23ee21eccc2b33306dda30
BLAKE2b-256 f6b01cdc524d99c9a8647269aa68466ca4d0da19fd34d51d55cb0731713f93cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e8c861eb798fd6e32c60e2dd8946021905a704f42c01e4a66fe464e332d0ea3
MD5 ec2a3bb4666c080262ff2018c9887587
BLAKE2b-256 8b9a3c2b8b47d5f059f538d5f41df442c0e1e5a8b999937b7855747d8e62d01e

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 663412a0b389b00ee625ab30a439367558c7db11f325f53625a6091f44cecf03
MD5 b469c2a1771913be0fc7206f01f4d0d6
BLAKE2b-256 386cfbe91186b53deb61a7014f4e677b9e50b3e2c4187a590110f831d50846bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp39-cp39-manylinux_2_28_aarch64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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

File details

Details for the file graphar-0.13.0.dev0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d110b619dcfd5f55ecb6858f06f947b939d7dc45154d55038031dd1ccdb58c0f
MD5 533ac7e71a5d7366d19ed46a252eed7a
BLAKE2b-256 6ba5448dc93a053af96c6ebfd825107bedc31194e21d0d1a6752d4c08bf2939e

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: python-wheel-workflow.yml on apache/incubator-graphar

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