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.dev1.tar.gz (297.7 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.dev1-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.dev1-cp313-cp313-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

graphar-0.13.0.dev1-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.dev1-cp312-cp312-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

graphar-0.13.0.dev1-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.dev1-cp311-cp311-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

graphar-0.13.0.dev1-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.dev1-cp310-cp310-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

graphar-0.13.0.dev1-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.dev1-cp39-cp39-manylinux_2_28_aarch64.whl (20.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

graphar-0.13.0.dev1-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.dev1.tar.gz.

File metadata

  • Download URL: graphar-0.13.0.dev1.tar.gz
  • Upload date:
  • Size: 297.7 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.dev1.tar.gz
Algorithm Hash digest
SHA256 d91d3c6a7f45b48cc94dc5b48728db15ff5849c377e3794e821670dd09f394fb
MD5 f31bb28d7cae6c41c2c8b5c4fae4dae5
BLAKE2b-256 826104d20e1fbb28673d5447ff4a8623409d7205cbcb4285bddd56df0ee855dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1.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.dev1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9f70fc361d89ec68bb9f9ac78cbd2340d83d61fa6f9eec0b305c79d501ab929a
MD5 1f6bca4badd71ddee834f43e6374fdfc
BLAKE2b-256 22aad612f49afff6ab707a4256fa42b54004e118627ff9d9e047304e0bc96856

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7a9a5371fb68e0f61e43701f5823e55c73ec75045abbe5096205361e8352cd08
MD5 003a5addeac9c14c4951a5b88a0098f4
BLAKE2b-256 71c2c54cce7690f56a50071185dbe8d1b50a6595bf82223d6a742973edab7161

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c25bc04e3c952d2da1f5fa13e288f7fea89335d6e54612b59e9ae4e82182c3b5
MD5 7de000f28bc2b8cf90e0ae82230a8687
BLAKE2b-256 76663f86c1dae720885a9497025ae116ac3e5444826b1722d38f3977dd553969

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bca7aa03acbc047b06d9d539bdd03963a18004b99dbe31ce4778974b253bc62b
MD5 616921a93d57d4323b0141ae663d7498
BLAKE2b-256 5f2d5633a6840f179c7bc66e2377bfcc4ff59df3fcbddaa02ce2a544cef97318

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6aacf4401185ccf7421e6c928e107cde2fa61f777fc9b500554f85c28aeee590
MD5 de4158b110671376f05a1f5ad0be45ed
BLAKE2b-256 37e47a7c165c70696b64057d7099d6832bc722ff391f205170769dfbdc4258fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 736e71bc15b0326c61d65721985e8290f06a87c4ae6f2d993c859d8bd3bd7c4f
MD5 c826601f7195205cdf367a1cda8e50d9
BLAKE2b-256 395b9432e9d784ec751c9765ea726281fc8e393e07733007f17bfe72eda51986

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dce562a508fc1ef459be32b156b55a46d3a55a8743a1dac969d62fbb374bd50f
MD5 55b9f12b85f2cda27627a568132082eb
BLAKE2b-256 523c8908852febd696d7aa9201962835c7a39c840d39a981d3113ea7ba393b04

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e4fa46a3eb3db5220560c516902450057ae4a1adc1fd4f81ad73189bb1068dd3
MD5 52d19be1808e9fae3b0b669d02128099
BLAKE2b-256 ac569f22b7838f101342a673a82474130f580a666b6983fc51a1ad58fc9074cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca25646aa5b48a582cde9f2b4fa2abe66ed9d6fd40bc8a6110d1b2a2246255a2
MD5 8cce826700c16c41f43a252bf9e8a5f3
BLAKE2b-256 446e7e1cf615c83bdaac4792eba1a00749f134711be308ea5021239254e99a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fe0d5d8dd8697b307929257df11e8004826a036d3b1823aaff48ebfe47e67739
MD5 4f191f736cf174d8a454ea77b82ced71
BLAKE2b-256 048560163d268a29cddb7bca085ebacc6cd3c9ade3331f2818e52036773e51a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 43b6fd678bffd9ae8d3cbf7db050f1ad637edde6e574db4da695eb26fd980e15
MD5 6b2a0fcf5e91cb134562f4c897551ef7
BLAKE2b-256 46a71af65393721404bff71cdf733098e50d743326c0c77a03497744f5f875ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f80c98bac46726c23ad0900747e12a76c7b4001a7688dbf9a97b877092163688
MD5 7273513c4360e378860ece3b20978f81
BLAKE2b-256 ba45ee3d846d1c0a87db0a905c7132b030e2eda9f4ffdea3bb806e66e19c8418

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 875af6f870c94bf573e54dd81c5d44a58fe863d30a2b0c56370b156cec9db7dd
MD5 72063d8b78ebc653c01cff475fdc95c5
BLAKE2b-256 72fa5ce17c6a1e44de897183cc1bfd550a3e05b180ffa33de4dfb64f33bc99a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3de0f36cb96f6e8d3e20a83d7a602d89a78d1d797ed23c55241592751210267e
MD5 507dfa372f0c86c13af21aec5345d170
BLAKE2b-256 53847f16be76c5b288bf23fe4b4f55ba33467ce2c252cd152b76a4a268d7de69

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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.dev1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graphar-0.13.0.dev1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 177623c5c461fe222c996ec2cd4719ce23c6b27158b8bfa676d75c9c1f1d02a9
MD5 27ccf40f92d03992c967e2937f85783c
BLAKE2b-256 f33463f29a8f253041697ef665fbfb75a7e6d183f4d90c0e12da5657625abea3

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphar-0.13.0.dev1-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