Skip to main content

Athena Usage Extractor

[license]

  • Athena helps you analyze unstructured, semi-structured, and structured data stored in Amazon S3. Examples include CSV, JSON, or columnar data formats such as Apache Parquet and Apache ORC. You can use Athena to run ad-hoc queries using ANSI SQL, without the need to aggregate or load the data into Athena.

  • Athena usage is simple python library that allows you to extract all usage information

Installation

[license]

AthenaUsageExtractor

  • Athena helps you analyze unstructured, semi-structured, and structured data stored in Amazon S3. Examples include CSV, JSON, or columnar data formats such as Apache Parquet and Apache ORC. You can use Athena to run ad-hoc queries using ANSI SQL, without the need to aggregate or load the data into Athena.

  • Athena usage is simple python library that allows you to extract all usage information

Installation

ac

pip install athena-usage-metrics-extractor

Usage

import sys
from AthenaUsageExtractor import AthenaUsageExtractor


def main():
    helper = AthenaUsageExtractor(
        aws_region='us-east-1',
        aws_access_key='XXXXX',
        aws_secret_key='XXXXX'
    )
    response = helper.get_usage_for_date(date='2022-08-12', workgroup='primary')
    while True:
        try:
            data = next(response)
            print(data)
        except StopIteration as e:
            break
        except Exception as e:
            break

main()

Json format Returned

{
   "QueryExecutionId":"490024e6-3e89-4ec4-9ffd-b1302a77d33d",
   "Query":"<YOU WILL GET THE QUERY USER RAN >",
   "StatementType":"DML",
   "WorkGroup":"primary",
   "OutputLocation":"<AWS S3 Output Path >",
   "Database":"default",
   "SelectedEngineVersion":"AUTO",
   "EffectiveEngineVersion":"Athena engine version 2",
   "EngineExecutionTimeInMillis":"14045",
   "DataScannedInBytes":"59597591861",
   "TotalExecutionTimeInMillis":"14292",
   "QueryQueueTimeInMillis":"214",
   "QueryPlanningTimeInMillis":"960",
   "ServiceProcessingTimeInMillis":"33",
   "State":"SUCCEEDED",
   "SubmissionDateTime":"2022-08-12 13:56:07.837000-04:00",
   "CompletionDateTime":"2022-08-12 13:56:22.129000-04:00"
}

Authors

  • Soumil Nitin Shah

Soumil Nitin Shah

Bachelor in Electronic Engineering | Masters in Electrical Engineering | Master in Computer Engineering |

I earned a Bachelor of Science in Electronic Engineering and a double master’s in Electrical and Computer Engineering. I have extensive expertise in developing scalable and high-performance software applications in Python. I have a YouTube channel where I teach people about Data Science, Machine learning, Elastic search, and AWS. I work as data collection and processing Team Lead at Jobtarget where I spent most of my time developing Ingestion Framework and creating microservices and scalable architecture on AWS. I have worked with a massive amount of data which includes creating data lakes (1.2T) optimizing data lakes query by creating a partition and using the right file format and compression. I have also developed and worked on a streaming application for ingesting real-time streams data via kinesis and firehose to elastic search

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Metadata

Release files for athena-usage-metrics-extractor 1.2.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 athena-usage-metrics-extractor 1.2.0
File Size Uploaded Provenance
athena-usage-metrics-extractor-1.2.0.tar.gz 17.3 kB Without provenance Details

Release files / athena-usage-metrics-extractor-1.2.0.tar.gz

Download URL athena-usage-metrics-extractor-1.2.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1971a90f8a1ae15b9a1688999ff2d0a777c1ae4bc4b5993b90350a1f42115cba
BLAKE2b-256 checksum
How to use checksums
dfb8f9aa037e5e51661355c59b6c2bd19648c3776faff11cbb2c2177715232a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.3

Security for athena-usage-metrics-extractor 1.2.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

1.2.0 This release

1 release file 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