Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Public Fused UDFs. Build any scale workflows with the Fused Python SDK and Workbench webapp, and integrate them into your stack with the Fused Hosted API.

License

NotificationsYou must be signed in to change notification settings

fusedio/udfs

Repository files navigation

🌎 Code to Map. Instantly.



alt text

This repo is a public collection of Fused User Defined Functions (UDFs).

Fused is the glue layer that interfaces data platforms and data tools via a managed serverless API. With Fused, you can write, share, or discover UDFs which are the building blocks of serverless geospatial operations. UDFs are Python functions that turn into live HTTP endpoints that load their output into any tools that can call an API.

Quickstart

1. Install Fused Python SDK

PyPI Version

The Fused Python SDK is available atPyPI. Use the standard Pythoninstallation tools. UDFs this repo expect the most recent version.

python3 -m venv .venvsource .venv/bin/activatepip install fused

It's possible that to run UDFs locally the local environment might require additional packages not found locally. If that is the case, this command installs all required dependencies.

!pip install fused odc-stac duckdb numba xarray-spatial planetary-computer'odc-stac[botocore]' py3dep stackstac pynhd boto3

2. Load a UDF into a workflow

This snippet shows how to import a UDF from this repo into a Python environment. The URL is of the directory that contains a UDF generated with Fused.

importfusedudf=fused.load("https://github.com/fusedio/udfs/tree/main/public/DuckDB_NYC_Example")gdf=fused.run(udf=udf)gdf

Similarly, as a bash oneliner.

python-c"import fused; udf = fused.load('https://github.com/fusedio/udfs/tree/main/public/DuckDB_NYC_Example'); print(fused.run(udf=udf));"

Walkthrough

Repo structure

This repository is structured to facilitate easy access of UDFs and their supporting files. Each UDF, likeSample_UDF, is contained within its own subdirectory within thepublic directory - along with its documentation, code, metadata, and utility function code.

Each UDF can be thought of as a standalone Python package.

├── README.md└── public    └── Sample_UDF        ├── README.MD        ├── Sample_UDF.py        ├── meta.json        └── utils.py

Files relevant to each UDF are:

  • README.md Provides details of the UDF's purpose and how it works.
  • Sample_UDF.py This eponymous Python file contains the UDF's business logic as a Python function decorated with@fused.udf.
  • meta.json This file contains metadata needed to render the UDF in the Fused explorer and for the UDF to run correctly.
  • utils.py This Python file contains helper functions the UDF (optionally) imports and references.

Contribute a UDF

  1. Save UDF
importfused@fused.udfdefmy_udf(bounds:fused.types.Tile=None):importpandasaspdreturnpd.DataFrame({'Hello': ['from Fused']})# Run locallyprint(fused.run(my_udf))# Save locallymy_udf.to_directory('my_udf')# or for zip file: my_udf.to_file('my_udf.zip')# Save remotely to Fusedmy_udf.to_fused('my_udf')

"Save locally" generates the UDF folder on your local system, which you'll use in the following step.

  1. Open a PR

Clone this repo to your local system and add the UDF folder underpublic orcommunity. Create a PR on this repo.

Ecosystem

Build any scale workflows with theFused Python SDK andWorkbench webapp, and integrate them into your stack bycalling then via HTTP

alt text

Documentation

Fused documentation is indocs.fused.io.

Contribution guidelines

All UDF contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.

Pre commit

Please run pre-commit hooks on your UDF prior to submitting.

pre-commit installpre-commit run --files public/PC_Sentinel2/*

License

MIT License

About

Public Fused UDFs. Build any scale workflows with the Fused Python SDK and Workbench webapp, and integrate them into your stack with the Fused Hosted API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp