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:
- Download the source code:
git clone https://github.com/albertquiroga/EasyGlue.git - Go into the project's directory, and build it into a wheel file:
python setup.py build bdist_wheel - A new
distdirectory 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 - In your ETL Job code, simply add a
import easyglueline at the top
How does this work?
This project uses class extension methods to simply add methods to the GlueContext class:
- In Python this is not supported as neatly as in other programming languages, but it's doable through
setattr. - In Scala, this is directly supported.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d24fe152c2c3a069521a96459e034dcd9266130bd4fd6424b43c128789112854
|
|
| MD5 |
30c756d4b67346f35eff388d76d1ced2
|
|
| BLAKE2b-256 |
2b2793d41301cf80d8be4a54b75874983908e7a96fc1eb96fb69cb82aee6a6a0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e834e4b1c7660c537003eea68802174638a835430b934c3ce33584a9b692b55
|
|
| MD5 |
a54e4fe065da8be4fae3432652605529
|
|
| BLAKE2b-256 |
b4db3a4c5df79b619198e82e97d63bacd389f1496bcdd597094c88e9fb794f3f
|