Skip to main content

Ilum job python API

Project description

Ilum Job API Python Package

PyPI - Python Version License

This package provides an interface for interacting with Ilum's Job API using Python. With this package, you can create your own interactive spark job.

Installation

Use pip to install the ilum-job-api package:

pip install ilum

Usage

Here's a simple example of how to use it:

from ilum.api import IlumJob
from random import random
from operator import add


class SparkPiInteractiveExample(IlumJob):

    def run(self, spark, config):
        partitions = int(config.get('partitions', '5'))
        n = 100000 * partitions

        def f(_: int) -> float:
            x = random() * 2 - 1
            y = random() * 2 - 1
            return 1 if x ** 2 + y ** 2 <= 1 else 0

        count = spark.sparkContext.parallelize(range(1, n + 1), partitions).map(f).reduce(add)

        return "Pi is roughly %f" % (4.0 * count / n)

For more detailed usage instructions, see our Documentation and API Reference.

License

This project is licensed under the terms of the Apache License 2.0.

Contact

If you have any issues or feature requests, please create an idea on our board. For general questions or discussions, post a question here.

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

ilum-6.7.0rc1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

ilum-6.7.0rc1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file ilum-6.7.0rc1.tar.gz.

File metadata

  • Download URL: ilum-6.7.0rc1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ilum-6.7.0rc1.tar.gz
Algorithm Hash digest
SHA256 e1a305adf9ae8b4198ed4ca4b890d33233cf04a515f1c927b315f1d8cc1904cc
MD5 dc164f78d97a50e86e50f8676ffab6b8
BLAKE2b-256 009402d0c884ad1d5983bb712e8c8dd1b029a7bc660291a0023d0c48a9d6fb93

See more details on using hashes here.

File details

Details for the file ilum-6.7.0rc1-py3-none-any.whl.

File metadata

  • Download URL: ilum-6.7.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ilum-6.7.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 110429c1942732c51faea98254a64701133c8d966025ac7107a4080b5eb9896d
MD5 60e1e1ac3d65b981bd90ae7f2ff4a763
BLAKE2b-256 3001b614cd76b1b370082f02505671e9d3b6d20c59396d6b6be762ede70a1aff

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