Skip to main content

informatica-sparker

A Python framework that converts Informatica PowerCenter workflow/mapping XML exports into PySpark code deployable to Databricks.

Features

  • Multi-Mapping Support: Handles any number of mappings per XML file, generating separate .py files for each mapping
  • Auto Source Detection: Automatically identifies source types and connection details:
    • SQL databases (SQL Server, Oracle, MySQL, PostgreSQL, DB2, Teradata, Netezza, Sybase, Informix)
    • File formats: CSV, Parquet, DAT, XML, JSON, Text, Fixed-Width, Avro, ORC, Excel
    • Files without extensions
    • JDBC/ODBC connections with driver JAR detection
  • Complete Output Package: Generates a full deployment-ready package:
    • mapping_name.py - PySpark script for each mapping
    • workflow.py - Workflow orchestration with dependency management
    • config.yml - Unified YAML configuration with environment variable support
    • all_sql_queries.sql - All extracted SQL queries organized by mapping
    • error_log.txt - Detailed conversion log with warnings, errors, and source detection results
  • Transformation Coverage: Supports Source Qualifier, Expression, Filter, Lookup, Joiner, Aggregator, Sorter, Union, Router, Sequence Generator, Update Strategy, Stored Procedure, Mapplet
  • Python 3.10+ Compatible

Installation

pip install informatica-sparker

Quick Start

Command Line

# Convert XML to PySpark
informatica-sparker convert mapping_export.xml -o output_dir

# Analyze XML without converting
informatica-sparker analyze mapping_export.xml

# Analyze with JSON output
informatica-sparker analyze mapping_export.xml --json

# Use custom config
informatica-sparker convert mapping_export.xml -o output_dir -c my_config.yml

Python API

from informatica_sparker import ConversionService, UserConfig

# Basic conversion
service = ConversionService()
result = service.convert_file("mapping_export.xml", output_dir="output")

print(f"Mappings converted: {result.mappings_processed}/{result.mapping_count}")
print(f"Files generated: {len(result.files)}")
print(f"SQL queries found: {len(result.sql_queries)}")

# Check source detections
for detection in result.source_detections:
    print(f"  {detection.source_name}: {detection.detected_type.value}")
    if detection.file_format:
        print(f"    Format: {detection.file_format.value}")
    for note in detection.detection_notes:
        print(f"    {note}")

# Inspect extracted SQL queries
for query in result.sql_queries:
    print(f"  [{query.query_type}] {query.step_name}: {query.query[:80]}...")

With Custom Configuration

from informatica_sparker import ConversionService, UserConfig

config = UserConfig(
    db_connections={
        "source_db": {
            "host": "myserver.database.windows.net",
            "database": "mydb",
            "user": "admin",
            "password": "secret",
        }
    }
)

service = ConversionService(user_config=config)
result = service.convert_file("export.xml", output_dir="spark_output")

Output Structure

output/
  mapping_1.py          # PySpark code for mapping 1
  mapping_2.py          # PySpark code for mapping 2
  mapping_N.py          # PySpark code for mapping N
  workflow.py           # Workflow orchestration (runs all mappings in order)
  config.yml            # Unified YAML config (connections, sources, targets)
  all_sql_queries.sql   # All SQL queries extracted from all mappings
  error_log.txt         # Conversion log with warnings, errors, detections

Source Type Detection

The framework automatically identifies what each source in the XML is:

Source Type Detection Method
SQL Server DATABASETYPE attribute, connection properties
Oracle DATABASETYPE attribute, JDBC driver class
Flat File (CSV) File extension, DATABASETYPE=Flat File, delimiter attributes
Parquet .parquet file extension in source attributes
DAT .dat file extension
XML .xml extension or DATABASETYPE=XML
JSON .json extension or DATABASETYPE=JSON
Text .txt/.text/.log extension
No Extension File source with no recognizable extension
Fixed Width DATABASETYPE=Fixed-Width or file type attribute

Connection details (JDBC URLs, driver JARs, host/port) are automatically extracted and included in the generated config.yml.

Supported Transformations

Informatica Transform PySpark Equivalent
Source Qualifier spark.read.format("jdbc") / spark.read.csv() etc.
Expression .withColumn() / .select() with expressions
Filter .filter() / .where()
Lookup .join() with broadcast hint
Joiner .join() (inner, left, right, full)
Aggregator .groupBy().agg()
Sorter .orderBy()
Union df1.unionByName(df2)
Router Multiple .filter() branches
Sequence Generator monotonically_increasing_id()
Update Strategy Insert/Update/Delete flags
Target .write.format("jdbc") / .write.format("delta")

Configuration File (config.yml)

The generated config.yml supports environment variable substitution:

spark:
  app_name: "my_workflow"
  master: "${SPARK_MASTER:local[*]}"

connections:
  CDM_PRE_LANDING:
    db_type: "sqlserver"
    host: "${MSSQL_HOST}"
    database: "msscdm_dev"
    user: "${MSSQL_USER}"
    password: "${MSSQL_PASSWORD}"
    driver: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    driver_jar: "${MSSQL_DRIVER_JAR:/opt/drivers/mssql-jdbc.jar}"

Requirements

  • Python >= 3.10
  • lxml >= 4.9.0
  • pydantic >= 2.0.0
  • jinja2 >= 3.1.0
  • networkx >= 3.0
  • pyyaml >= 6.0

License

MIT

Metadata

Release files for informatica-sparker 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for informatica-sparker 2.0.0
File Size Uploaded Provenance
informatica_sparker-2.0.0.tar.gz 78.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for informatica-sparker 2.0.0
File Interpreter ABI Platform
informatica_sparker-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 166.5 kB

Release files / informatica_sparker-2.0.0.tar.gz

Download URL informatica_sparker-2.0.0.tar.gz
Size 78.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b9f68065ccc01e6c982fae6e25853725043a4fcd77911e9c0b999217c633b0ff
BLAKE2b-256 checksum
How to use checksums
03b27714d5b0259ed7631fd4380968b5558ae9c9f6a399e3534df6a25dab31a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / informatica_sparker-2.0.0-py3-none-any.whl

Download URL informatica_sparker-2.0.0-py3-none-any.whl
Size 87.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03bd5973c0df5ff27bfa9bfef93cbd3cce63e0dda00ad9195fc9b5dff7138251
BLAKE2b-256 checksum
How to use checksums
d73697b78e976490d30c36e01c4b2c146c96529f95d04c36da5adee86489401a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Security for informatica-sparker 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page