Skip to main content

Utilities for Fabric/Spark environments

Project description

manifold_fabric_utils

Utilities for Microsoft Fabric/Spark environments, with helpers for working with Lakehouse Tables/ and Files/ using notebookutils.mssparkutils.

Install

pip install .

Requires Python 3.6+ and a Fabric/Spark runtime for functions that call mssparkutils.

Quick start

from manifold_fabric_utils import (
    path_exists,
    list_dir,
    map_dir,
    create_schema_if_not_exists,
)

# Works with local/posix paths and Fabric Lakehouse paths
path_exists("/tmp")               # True/False via os.path.exists
path_exists("Tables/my_schema")   # Uses mssparkutils.fs.ls under the hood

# Directory listing (Lakehouse path expected for list/map helpers)
files = list_dir("Files/my_folder")        # List[str]
names_iter = map_dir("Files/my_folder")    # Iterator[str]

# Create a Lakehouse schema folder if missing
created = create_schema_if_not_exists("my_schema")  # True if created, else False

API

  • path_exists(path): Returns True if a local path exists or if a Lakehouse path (Tables/ or Files/) can be listed via mssparkutils.fs.ls.
  • list_dir(path): Returns a list of entry names for a Lakehouse directory.
  • map_dir(path): Returns an iterator of entry names for a Lakehouse directory.
  • create_schema_if_not_exists(schema_name): Ensures Tables/{schema_name} exists; creates it if missing.

Notes

  • Functions that touch Tables/ and Files/ require notebookutils.mssparkutils (Fabric/Spark environment).
  • Local filesystem behavior uses the standard library (os.path).

License

MIT

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

manifold_fabric_utils-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

manifold_fabric_utils-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file manifold_fabric_utils-0.1.0.tar.gz.

File metadata

  • Download URL: manifold_fabric_utils-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for manifold_fabric_utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3d79b700c462851b17879eae266c05491e685ec7a7566c1818d856be99eb98cb
MD5 30cd98999255f4feac2113acf1018a7e
BLAKE2b-256 2d0045983e0d7ca8524052a40be75ffd268d4a5f15794f3c291ec82c237d41a7

See more details on using hashes here.

File details

Details for the file manifold_fabric_utils-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for manifold_fabric_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0695194fedb9938c6fabfe0d9bb86b56362b7e7cdbce6b54028feae95a15207c
MD5 63ec0001ab99b4a03949d195bb7ffc57
BLAKE2b-256 c96a206861a7983999d7b9e7ef607648b3a04c4bfee8b6a160415f89568a68be

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