Python lib/client for Gravitino
Project description
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.
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
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:
- Install HDFS Python client.
- Create a HDFS client to connect HDFS and to do some test operations.
- Install Gravitino Python client.
- Initialize Gravitino admin client and create a Gravitino metalake.
- Initialize Gravitino client and list metalakes.
- Create a Gravitino
Catalog
and specialtype
isCatalog.Type.FILESET
andprovider
is hadoop - Create a Gravitino
Schema
with thelocation
pointed to a HDFS path, and usehdfs client
to check if the schema location is successfully created in HDFS. - Create a
Fileset
withtype
is Fileset.Type.MANAGED, usehdfs client
to check if the fileset location was successfully created in HDFS. - Drop this
Fileset.Type.MANAGED
type fileset and check if the fileset location was successfully deleted in HDFS. - Create a
Fileset
withtype
is Fileset.Type.EXTERNAL andlocation
pointed to exist HDFS path - 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
- Python 3.8+
- Refer to How to build Gravitino to have necessary build environment ready for building.
Build and testing
-
Clone the Gravitino project.
git clone git@github.com:datastrato/gravitino.git
-
Build the Gravitino Python client module
./gradlew :clients:client-python:build
-
Run unit tests
./gradlew :clients:client-python:test -PskipITs
-
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 thedistribution
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
-
Distribute the Gravitino Python client module
./gradlew :clients:client-python:distribution
-
Deploy the Gravitino Python client to https://pypi.org/project/gravitino/
./gradlew :clients:client-python:deploy
Resources
- Official website https://datastrato.ai/
- Project home on GitHub: https://github.com/datastrato/gravitino/
- Playground with Docker: https://github.com/datastrato/gravitino-playground
- User documentation: https://datastrato.ai/docs/
- Videos on Youtube: https://www.youtube.com/@Datastrato
- Twitter: https://twitter.com/datastrato
- Linkedin: https://www.linkedin.com/company/datastrato
- Slack Community: https://join.slack.com/t/datastrato-community
- Discourse Community: https://gravitino.discourse.group/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file gravitino-0.5.1.tar.gz
.
File metadata
- Download URL: gravitino-0.5.1.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f4d2ee3b07e5157ece2bf023c4f5c8cdea5ca97e085df8d00703bea82fc729f |
|
MD5 | 21aa8e6f8760f81d8d338c82931e1d1d |
|
BLAKE2b-256 | c8035f1cc4f3cf501dd021767c500f679aac0cea9283d17a055340d2422f083e |