Skip to content

keturk/hvc.DynamoDBReport

Repository files navigation

Open Source Attributions

For domain specific language parsing, hvc.DynamoDBReport uses Antlr4. Antrl4 is a BSD licensed open source parser generator started by Professor Terence J. Parr

hvc.DynamoDBReport uses C# files generated by Antlr4. hvc.DynamoDBReport.Parser references to Antlr4.Runtime.Standard 4.9.3 nuget package.

For parts of code generation, hvc.DynamoDBReport uses StringTemplate4 template engine which was also started by Professor Parr.

Generated code uses PrettyTable python module to display reports as visually appealing ASCII tables.

What is hvc.DynamoDBReport?

Simply, hvc.DynamoDBReport parses queries defined in a simple domain specific language (DSL) and generates Python script(s) which can be used to query an AWS DynamoDB table using Boto3 and PrettyTable.

From report definition below, hvc.DynamoDBReport generates a Python script that can be used to generate PrettyTable report and/or CSV file as output.


Report CreditCardOffers {
    Select PK, SK, CreatedBy, CreatedDate, LastModified: Descending, OfferDescription, OfferEffectiveDate, OfferExpiryDate, OfferId, OfferSubType, OfferType, OfferUrl From CreditCardOffers
    With PK == '{pk}' And SK Begins With '{sk}'
}


python .\credit_card_offers.py --pk ACCT#49864709 --sk O
Querying CreditCardOffers table
+---------------+-----------+-----------+---------------------+-----------------------+----------------+---------+-----------+----------+------------------+
|       PK      |     SK    | AccountId | AccountOfferEndDate | AccountOfferStartDate |     GSI1SK     | OfferId | OfferType |  Status  | StatusChangeDate |
+---------------+-----------+-----------+---------------------+-----------------------+----------------+---------+-----------+----------+------------------+
| ACCT#49864709 | OFR#10003 |  49864709 |      2020-12-01     |       2020-03-01      |  DECLINED#BAL  |  10003  |    BAL    | DECLINED |    2020-03-25    |
| ACCT#49864709 | OFR#10021 |  49864709 |      2020-12-01     |       2020-03-01      | DECLINED#PROMO |  10021  |   PROMO   | DECLINED |    2020-03-25    |
+---------------+-----------+-----------+---------------------+-----------------------+----------------+---------+-----------+----------+------------------+
Number of records: 2

Target Platforms

hvc.DynamoDBReport is developed with .NET 6 as a cross-platform project. .Net 6 supports Microsoft Windows, Linux, and Mac operating systems as is the x64 architecture and ARM of Windows and Linux are supported.

hvc.DynamoDBReport Project Dependency Diagram

Project Dependency Diagram

Project Details

You can find more details in following links.

PartiQL

As of now, hvc.DynamoDBReport generates a Python script that uses Boto3 table.query method. The generated code does NOT support PartiQL.

Although, it doesn't support PartiQL yet, hvc.DynamoDBReport is not developed as an alternative to PartiQL. Future versions of hvc.DynamoDBReport may add PartiQL support if there is enough interest for it.

hvc Libraries used by hvc.DynamoDBReport

hvc.DynamoDBReport uses other hvc nuget packages which contain common functionality which is used by other hvc generators.

Links to public GitHub repositories are as follows: hvc.Extensions Common extension methods for various BCL classes. hvc.DataStructures Common data structures for modelling various entities. hvc.Generator Common code for hvc code generators. hvc.Parser Common code for parsing simple domain specific languages with Antlr4.

About

Generates DynamoDB reports as Python scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published