Lahap
Lahap is a utility package for AWS Athena and AWS Glue.
Usage
In order to run Lahap functions you must instantiate a Lahap session, a boto3.Session wrapper to manage boto3 calls. Use can provide any valid boto3.Session parameter to it.
from lahap import create_session
lahap = create_session(region_name="us-east-1", profile_name="profile") # using profile
lahap = create_session(region_name="us-east-1", aws_access_key_id="access-key",
aws_secret_access_key="secret-key") # using explicit key credentials
Truncate table
Deletes all S3 files located in a Glue Table's S3 location. Be careful.
lahap.truncate_table(database="catalog-database", table="catalog-table")
Drop table
Drops Glue Table with or without its respective data in S3. Be careful.
lahap.drop_table(database="catalog-database", table="catalog-table", only_schema=False)
Convert table to Parquet
Copies a table storing it as Parquet files through CTA.
lahap.convert_table_to_parquet(
query_database="source-database",
query_table="source-table",
compression="parquet-compression", # "UNCOMPRESSED", "SNAPPY", "LZO", "GZIP"
result_database="result-database",
result_table="result-table-parquet",
external_location="s3://my-bucket/path",
)
Convert query to Parquet
Create a new table from query and storing it as Parquet files through CTA.
lahap.convert_query_to_parquet(
query="SELECT * FROM database.table",
compression="parquet-compression", # "UNCOMPRESSED", "SNAPPY", "LZO", "GZIP"
result_database="result-database",
result_table="result-table-parquet",
external_location="s3://my-bucket/path",
)
References
Amazon Athena CTA
https://docs.aws.amazon.com/athena/latest/ug/create-table-as.html
Metadata
Release files for Lahap 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Lahap-0.2.1.tar.gz | 3.8 kB | Without provenance | Details for Lahap-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Lahap-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for Lahap-0.2.1-py3-none-any.whl |
Total release size: 9.8 kB
Release files / Lahap-0.2.1.tar.gz
| Download URL | Lahap-0.2.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f221317bdee3990262ea099e153d451a0129798e63d87c73e847433bcc54787
|
|
BLAKE2b-256 checksum How to use checksums |
a956766387387907e37021cdb8017266c91eefa013c3d7540f431f56603b4c6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.6.8
|
Release files / Lahap-0.2.1-py3-none-any.whl
| Download URL | Lahap-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a78c5ca878a7917d99aba456e0aa7a57ea99b8f7a38e6c97880701f51c1062ef
|
|
BLAKE2b-256 checksum How to use checksums |
111c22086b51ded1810e8bf18377c276c062a7f8b6444689ee8f11af7d4dbed2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.6.8
|
Security for Lahap 0.2.1
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.