Skip to main content

Glue DynamicFrame syntax closer to DataFrames

Project description

EasyGlue

This project aims to make the usage of AWS Glue's DynamicFrame more similar to that of Apache Spark's DataFrame, so that it's easier to remember and read. Let's take a simple S3 read of a JSON dataset for instance:

In Spark, this would be a DataFrame S3 read:

spark.read().json('s3://test_path/')

In Glue, this would be a DynamicFrame S3 read:

glue.create_dynamic_frame.from_options(connection_type='s3', connection_options={'paths': ['s3://test_path/']}, format='json', transformation_ctx='datasource0')

As you can see, the syntax here is quite different - and in the case of Glue, way more verbose. With EasyGlue, you can turn the DynamicFrame read operation into something way more similar:

glue.read().json('s3://test_path/')

Currently-supported options

The project currently supports:

  • Reading/writing from/to:
    • S3, in any of the file formats supported by Glue
    • JDBC
    • RDDs
    • DynamoDB
    • DocumentDB and MongoDB
  • Secrets Manager integration for JDBC read/writes

Usage

You can either use the pre-built PyPi package, or build it yourself to a wheel file:

Using from PyPi

To use EasyGlue in your projects, simply add the following properties to your job:

key: --additional-python-modules
value: easyglue

Then add an import easyglue statement at the beginning of your job's code. That's it.

Building to a wheel file

If you prefer to build from source and pass the module as a wheel file, do the following:

  1. Download the source code: git clone https://github.com/albertquiroga/EasyGlue.git
  2. Go into the project's directory, and build it into a wheel file: python setup.py build bdist_wheel
  3. A new dist directory will have been created, inside you'll find the built wheel file. Upload this to S3 and add it as a library to your Glue ETL Job
  4. In your ETL Job code, simply add a import easyglue line at the top

How does this work?

This project uses class extension methods to simply add methods to the GlueContext class:

Roadmap

Check the roadmap in GitHub 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

easyglue-0.0.9.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

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

easyglue-0.0.9-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file easyglue-0.0.9.tar.gz.

File metadata

  • Download URL: easyglue-0.0.9.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for easyglue-0.0.9.tar.gz
Algorithm Hash digest
SHA256 d24fe152c2c3a069521a96459e034dcd9266130bd4fd6424b43c128789112854
MD5 30c756d4b67346f35eff388d76d1ced2
BLAKE2b-256 2b2793d41301cf80d8be4a54b75874983908e7a96fc1eb96fb69cb82aee6a6a0

See more details on using hashes here.

File details

Details for the file easyglue-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: easyglue-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for easyglue-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6e834e4b1c7660c537003eea68802174638a835430b934c3ce33584a9b692b55
MD5 a54e4fe065da8be4fae3432652605529
BLAKE2b-256 b4db3a4c5df79b619198e82e97d63bacd389f1496bcdd597094c88e9fb794f3f

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