Skip to main content

API ingestion for PySpark

Project description

Polymo

Polymo makes it easy to read REST APIs into Spark DataFrames. Just a config file and read it with Spark.

Quick start

  1. Define a config file:

    version: 0.1
    source:
      type: rest
      base_url: https://jsonplaceholder.typicode.com
    stream:
      path: /posts
      params:
        _limit: 20
      infer_schema: true
    
  2. Register the source and read data:

    from pyspark.sql import SparkSession
    from polymo import ApiReader 
    
    spark = SparkSession.builder.getOrCreate()
    spark.dataSource.register(ApiReader)
    
    df = (
        spark.read.format("polymo")
        .option("config_path", "./config.yml")
        .option("token", "<YOUR_BEARER_TOKEN>")  
        .load()
    )
    

Builder UI

Want a friendly way to craft configs? Launch the local builder:

polymo builder --port 9000

Installation

Base version without spark and builder:

pip install polymo

For builder UI:

pip install 'polymo[builder]'

  • Incremental cursors, partitioning, and advanced pagination strategies are on the roadmap.

Contributions and early feedback welcome!

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

polymo-0.1.2.tar.gz (163.6 kB view details)

Uploaded Source

Built Distribution

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

polymo-0.1.2-py3-none-any.whl (168.7 kB view details)

Uploaded Python 3

File details

Details for the file polymo-0.1.2.tar.gz.

File metadata

  • Download URL: polymo-0.1.2.tar.gz
  • Upload date:
  • Size: 163.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for polymo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e9e3cf28f6f3b433d63f515c9b4478abc9445fbaba374e923dce7c479770337d
MD5 ddd0bd24d41f429ffcf4c7520e1613ec
BLAKE2b-256 12e75713eaa452870bfce2fc174cc0a18767f84e396d577fbcfa56082f240f49

See more details on using hashes here.

Provenance

The following attestation bundles were made for polymo-0.1.2.tar.gz:

Publisher: release.yml on dan1elt0m/polymo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polymo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: polymo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 168.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for polymo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b55e2b52f587c861f6e2334a1331d8f11da7f27fe2d9d92f459a55e0e899fc55
MD5 1f94d472b06096ebd05241016225b133
BLAKE2b-256 d497d37946c28a24a88626f9c15501af01fda8219a40bf03a434b534c383b41a

See more details on using hashes here.

Provenance

The following attestation bundles were made for polymo-0.1.2-py3-none-any.whl:

Publisher: release.yml on dan1elt0m/polymo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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