Skip to main content

Introduction

Gravitino is a high-performance, geo-distributed, and federated metadata lake. It manages the metadata directly in different sources, types, and regions, also provides users the unified metadata access for data and AI assets.

Gravitino Python client helps data scientists easily manage metadata using Python language.

gravitino-python-client-introduction

Use Guidance

You can use Gravitino Python client library with Spark, PyTorch, Tensorflow, Ray and Python environment.

First of all, You must have a Gravitino server set up and run, You can refer document of How to install Gravitino to build Gravitino server from source code and install it in your local.

Gravitino Python client API

pip install gravitino
  1. Manage metalake using Gravitino Python API
  2. Manage fileset metadata using Gravitino Python API

Gravitino Fileset Example

We offer a playground environment to help you quickly understand how to use Gravitino Python client to manage non-tabular data on HDFS via Fileset in Gravitino. You can refer to the document How to use the playground#Launch AI components of playground to launch a Gravitino server, HDFS and Jupyter notebook environment in you local Docker environment.

Waiting for the playground Docker environment to start, you can directly open http://localhost:8888/lab/tree/gravitino-fileset-example.ipynb in the browser and run the example.

The gravitino-fileset-example contains the following code snippets:

  1. Install HDFS Python client.
  2. Create a HDFS client to connect HDFS and to do some test operations.
  3. Install Gravitino Python client.
  4. Initialize Gravitino admin client and create a Gravitino metalake.
  5. Initialize Gravitino client and list metalakes.
  6. Create a Gravitino Catalog and special type is Catalog.Type.FILESET and provider is hadoop
  7. Create a Gravitino Schema with the location pointed to a HDFS path, and use hdfs client to check if the schema location is successfully created in HDFS.
  8. Create a Fileset with type is Fileset.Type.MANAGED, use hdfs client to check if the fileset location was successfully created in HDFS.
  9. Drop this Fileset.Type.MANAGED type fileset and check if the fileset location was successfully deleted in HDFS.
  10. Create a Fileset with type is Fileset.Type.EXTERNAL and location pointed to exist HDFS path
  11. Drop this Fileset.Type.EXTERNAL type fileset and check if the fileset location was not deleted in HDFS.

How to development Gravitino Python Client

You can ues any IDE to develop Gravitino Python Client. Directly open the client-python module project in the IDE.

Prerequisites

Build and testing

  1. Clone the Gravitino project.

    git clone git@github.com:datastrato/gravitino.git
    
  2. Build the Gravitino Python client module

    ./gradlew :clients:client-python:build
    
  3. Run unit tests

    ./gradlew :clients:client-python:test -PskipITs
    
  4. Run integration tests

    Because Python client connects to Gravitino Server to run integration tests, So it runs ./gradlew compileDistribution -x test command automatically to compile the Gravitino project in the distribution directory. When you run integration tests via Gradle command or IDE, Gravitino integration test framework (integration_test_env.py) will start and stop Gravitino server automatically.

    ./gradlew :clients:client-python:test
    
  5. Distribute the Gravitino Python client module

    ./gradlew :clients:client-python:distribution
    
  6. Deploy the Gravitino Python client to https://pypi.org/project/gravitino/

    ./gradlew :clients:client-python:deploy
    

Resources

Metadata

Release files for gravitino 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gravitino 0.5.1
File Size Uploaded Provenance Actions
gravitino-0.5.1.tar.gz 31.3 kB Without provenance Details for gravitino-0.5.1.tar.gz

Release files / gravitino-0.5.1.tar.gz

Download URL gravitino-0.5.1.tar.gz
Size 31.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6f4d2ee3b07e5157ece2bf023c4f5c8cdea5ca97e085df8d00703bea82fc729f
BLAKE2b-256 checksum
How to use checksums
c8035f1cc4f3cf501dd021767c500f679aac0cea9283d17a055340d2422f083e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.19

Security for gravitino 0.5.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page