Skip to main content

E360 File Service Client for Python

Project description

E360 File Service Client

pipeline status

E360 File Service Client for Python (Python 3.12+).

Development

This package depends on clients_core, resolved from the internal e360-pypi Artifactory index. On a corporate network (or VPN), install and run checks:

pip install uv
export UV_INDEX_URL=https://rwes-artifactory01.internal.imsglobal.com/artifactory/api/pypi/e360-pypi/simple
uv sync --group dev
uv run pytest
uv run ruff check file_service_client tests

Introduction

Utilises the E360-File-Service microservice.

Features

  • Create a file
  • Get a file's information
  • Get a file's binary content
  • Delete a file

Usage

import pathlib
from uuid import UUID

from clients_core.simple_rest_client import SimpleRestClient
from file_service_client import FileServiceClient

USER_ID = UUID("00000000-0000-0000-0000-000000000001")
base_url = "https://your-file-service.example.com/api/v1.0.0/files/"
client = FileServiceClient(SimpleRestClient(base_url), user_id=USER_ID)

my_file = pathlib.Path("image.png")

# Create a file
client.create(my_file)

# Get file info
asset_id = UUID("b3bbb1b8-a774-4a0f-9ab6-c76047f7fdce")
client.get_by_id(asset_id)

# Get binary data and create a file
data = client.get_file_bytes(asset_id)
pathlib.Path("image.png").write_bytes(data)

# Delete
client.delete_by_id(asset_id)

Pre-commit

pre-commit install --install-hooks --overwrite

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 Distribution

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

file_service_client-2.3.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file file_service_client-2.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for file_service_client-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f7ae9181e9bd3784b0e666d79c41714b400e6dc8699f8e7f133efd6bfd3c6cc
MD5 38cc4cd971f252bf8267d40a8f1adb6f
BLAKE2b-256 a37b80f0bcc201af65f92c9b8d4ada030e8703aa1ecd53f5f61c76df0bed1db1

See more details on using hashes here.

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