All Projects → dhorions → DynamodbToCSV4j

dhorions / DynamodbToCSV4j

Licence: Apache-2.0 license
Dump DynamoDB data into a CSV file using java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to DynamodbToCSV4j

typedorm
Strongly typed ORM for DynamoDB - Built with the single-table-design pattern in mind.
Stars: ✭ 224 (+1144.44%)
Mutual labels:  dynamodb, aws-dynamodb
cognito-to-dynamodb-lambda
Copy newly-confirmed users from Cognito to DynamoDB
Stars: ✭ 68 (+277.78%)
Mutual labels:  dynamodb, aws-dynamodb
aws-dynamodb-java-example-local-testing
Example Gradle Java project for using AWS DynamoDB for local testing.
Stars: ✭ 22 (+22.22%)
Mutual labels:  dynamodb, aws-dynamodb
terraform-aws-backup
Terraform module to provision AWS Backup, a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services such as EBS volumes, RDS databases, DynamoDB tables, EFS file systems, and AWS Storage Gateway volumes.
Stars: ✭ 62 (+244.44%)
Mutual labels:  dynamodb, aws-dynamodb
dynamodb-simple
Type-safe Haskell framework for AWS DynamoDB
Stars: ✭ 16 (-11.11%)
Mutual labels:  dynamodb, aws-dynamodb
telegram-stepfunctions-bot
Serverless Telegram bot made on 4 AWS Lambda chained by AWS Step Functions. All of this written on Serverless Framework using plugins.
Stars: ✭ 26 (+44.44%)
Mutual labels:  dynamodb, aws-dynamodb
react-native-appsync-s3
React Native app for image uploads to S3 and storing their records in Amazon DynamoDB using AWS Amplify and AppSync SDK
Stars: ✭ 18 (+0%)
Mutual labels:  dynamodb, aws-dynamodb
var-trumper
Make VarDumper great again
Stars: ✭ 16 (-11.11%)
Mutual labels:  dump
ddes
JS/TypeScript framework for Distributed Event Sourcing & CQRS
Stars: ✭ 28 (+55.56%)
Mutual labels:  dynamodb
aiohttp-client-cache
An async persistent cache for aiohttp requests
Stars: ✭ 63 (+250%)
Mutual labels:  dynamodb
laravel-dynamodb-session-driver
DynamoDB Session Driver for Laravel 5
Stars: ✭ 15 (-16.67%)
Mutual labels:  dynamodb
dynalock
This is a small lock library written Go, which uses AWS DynamoDB as the data store.
Stars: ✭ 15 (-16.67%)
Mutual labels:  dynamodb
lifemanager
⏱ 한 일을 기록하면 시각화 해서 보여주는 웹 앱⏱
Stars: ✭ 85 (+372.22%)
Mutual labels:  aws-dynamodb
minidyn
A go library for testing Amazon DynamoDB.
Stars: ✭ 22 (+22.22%)
Mutual labels:  dynamodb
dynamoit
A simple AWS DynamoDB viewer
Stars: ✭ 32 (+77.78%)
Mutual labels:  dynamodb
dynamo-node
DynamoDB mapper
Stars: ✭ 12 (-33.33%)
Mutual labels:  dynamodb
go-localstack
Go Wrapper for using localstack
Stars: ✭ 56 (+211.11%)
Mutual labels:  dynamodb
binance-pump-bot
Automation for Binance p&d(pump and dump) activity, ensures fastest purchase and provides auto selling functionality to lockdown profit during these events.
Stars: ✭ 112 (+522.22%)
Mutual labels:  dump
redimo.go
Use the power of DynamoDB with the ease of the Redis API
Stars: ✭ 29 (+61.11%)
Mutual labels:  dynamodb
Amazon
Simple access to Amazon's web services.
Stars: ✭ 20 (+11.11%)
Mutual labels:  dynamodb

DynamodbToCSV4j

Crates.io

This application will export the content of a DynamoDB table into a CSV (Comma delimited value) output. All you need to do is create a config.json file in that same directory where you configure your accessKeyId, secretAccessKey and region as such:

{
  "accessKeyId": "REPLACE",
  "secretAccessKey": "REPLACE",
  "region": "eu-west-1",
  "tableName":"testtable"
}

Usage

Command Line

  • java DynamodbToCSV4j

This will use the config.json file on your path.

  • java DynamodbToCSV4j myConfig.json

This will use the myConfig.json file.

Configuration

Mandatory Configuration settings

parameter Description
accessKeyId Your AWS access key
secretAccessKey Your AWS secret access key
region The AWS Region name
tableName The name of the dynamodb table

Optional Configuration settings

parameter Description
outputfile The outputfile. Default will be tablename.csv
delimiter The column delimiter, default will be ,
quotechar The csv quote character
headers If set to anything but "true", the column headers will not be in the output
nullstring String to put in columns that have no value
filterExpression The filter expression for the scan operation to get the data from dynamodb
expressionAttributeValues The values for the filterExpression
expressionAttributeNames The names for the filterExpression

Examples

The examples will use a very simple table, with mixed records that contain maps and lists. Screenshot of testtable

Example 1

Configuration

{
  "accessKeyId": "REPLACE",
  "secretAccessKey": "REPLACE",
  "region": "eu-west-1",
  "tableName":"testtable",
  "outputfile":"example_1.csv",
  "delimiter":";",
  "quotechar":"\"",
  "headers":"true",
  "nullstring":"N/A",
  "filterExpression":"#lastName = :lastName",
  "expressionAttributeValues" : 
		[
			{"name":":lastName", "value":"Steinbeck", "type":"S"}
		],
	"expressionAttributeNames" : 
		[
			{"name":"#lastName", "value":"lastName"}
		]
}

Output

lastName;firstName;books.0;books.1;books.2;secondary_key;primary_key
Steinbeck;John;Of Mice and Man;Travels With Charlie;Tortilla Flat;1;1

Example 2

Configuration

{
  "accessKeyId": "REPLACE",
  "secretAccessKey": "REPLACE",
  "region": "eu-west-1",
  "tableName":"testtable",
  "outputfile":"example_2.csv",
  "delimiter":";",
  "quotechar":"\"",
  "headers":"true",
  "nullstring":"N/A"
}

Output

lastName;firstName;books.0;books.1;books.2;books.3;books.4;secondary_key;Genre.subtype;Genre.type;primary_key
Hamilton;Peter;Pandora's Star;Judas Unchained;The Dreaming Void;The Temportal Void;The Evolutionary Void;2;Space Opera;Science Fiction;2
Steinbeck;John;Of Mice and Man;Travels With Charlie;Tortilla Flat;N/A;N/A;1;N/A;N/A;1

Maven

The project can be used as a Maven dependency by using jitpack.io.

  • add the repository :
<repository>
  <id>jitpack.io</id>
  <url>https://jitpack.io</url>
</repository>
  • add the dependency
<dependencies>
	<dependency>
	    <groupId>com.github.dhorions</groupId>
	    <artifactId>DynamodbToCSV4j</artifactId>
	    <version>v0.1</version>
	</dependency>
</dependencies>

Usage in your java code

JSONObject config = new JSONObject();
config.put("accessKeyId","REPLACE");
config.put("secretAccessKey","REPLACE");
config.put("region","eu-west-1");
config.put("tableName","testtable");
d2csv d = new d2csv(config);

Alternative options to export data from dynamodb to csv

This article on medium gives an overview of alternative options to export data to comma separated files from dynamodb.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].