Skip to main content

Formats spark schema output into a schema definition

Project description

Summary


Sometimes when converting a Pandas DataFrame to a Spark DataFrame variables are not interpreted correctly
which can lead a programmer to have to type many lines of code and then provide the schema when building the
Spark DataFrame.

Additionally this is true for defining a Delta Table before loading your parquet files. This package contains
two functions aimed at creating these definitions which will hopefully cut down on a lot of typing and speed
up development time for the user.

Installation

pip install SparkSchemafy

Usage

from schemafy import make_spark_schema, make_delta_schema

Make a Spark DataFrame Schema from a Pandas DataFrame

make_spark_schema(str(spark.sql.DataFram().schema))

Make a delta table schema from parquet file

make_delta_schema('.parquet')

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

SparkSchemafy-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

SparkSchemafy-0.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: SparkSchemafy-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for SparkSchemafy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0e7329cb9d45bafbf60d4a790654cbdca97d2d8280b7769f5b034e598ec5944
MD5 e8992e7986a81b04491a654ca47cdd3d
BLAKE2b-256 4644dc27dce904f69b1e6450cbe162e347d7ea86069381a5ad456f0dab5bcb72

See more details on using hashes here.

File details

Details for the file SparkSchemafy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: SparkSchemafy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for SparkSchemafy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2e54c006f82a2ce499b8f7e602e0b34937799b7fd2eef5de6b00a5b175f758
MD5 9d13b477a212b4d3ff4c752b58f73ea8
BLAKE2b-256 ce989ea3e3ede4249ee5f2c3cc9a3c15777ef91ed81b9a6bdc0146ecdb82b213

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