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.1.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.1-py3-none-any.whl (168.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polymo-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f7c36c633a99677f6a8783628350b994c80afdd96ef250e34aa41e35f88e6c4f
MD5 e64cc4c95bf45d305773263bd82ec667
BLAKE2b-256 b53a0d1c92fc2acd4dad8ea86a2ef2d552b8f178031c832f59692318747e65c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for polymo-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: polymo-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1604a14ded996984597e4a9159c16b599ddb21b0c62d06bb0654893aa1c2725b
MD5 35c2c2fb3f2661223bd2bad712950eda
BLAKE2b-256 e29db069bc258262f26534e926ea4d989430f16129e5e0ab5ef016faab12065f

See more details on using hashes here.

Provenance

The following attestation bundles were made for polymo-0.1.1-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