Skip to content

Commit 1fab3cf

Browse files
committed
chore: restructure for packaging
1 parent 3a66f53 commit 1fab3cf

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ jobs:
2929
- name: Test basic restore and backup
3030
run: |
3131
mkdir dump && cp -a tests/testTable dump
32-
python dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a
33-
python dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a
32+
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a
33+
python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a
3434
python tests/test.py
3535
- name: Test wildcard restore and backup
3636
run: |
37-
python dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a
37+
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a
3838
rm -rf dump/test*
39-
python dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a
39+
python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a
4040
python tests/test.py
4141
- name: Test prefixed wildcard restore and backup
4242
run: |
43-
python dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator ""
43+
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator ""
4444
rm -rf dump/test*
45-
python dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator ""
45+
python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator ""
4646
python tests/test.py

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.9.6-alpine3.14
22

33
COPY ./requirements.txt /mnt/dynamodump/requirements.txt
4-
COPY ./dynamodump.py /usr/local/bin/dynamodump
4+
COPY ./dynamodump/dynamodump.py /usr/local/bin/dynamodump
55

66
RUN pip install -r /mnt/dynamodump/requirements.txt

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dynamodump supports local DynamoDB instances as well (tested with [DynamoDB Loca
1111
## Usage
1212

1313
```
14-
usage: dynamodump.py [-h] [-a {zip,tar}] [-b BUCKET]
14+
usage: dynamodump/dynamodump.py [-h] [-a {zip,tar}] [-b BUCKET]
1515
[-m {backup,restore,empty}] [-r REGION] [--host HOST]
1616
[--port PORT] [--accessKey ACCESSKEY]
1717
[--secretKey SECRETKEY] [-p PROFILE] [-s SRCTABLE]
@@ -96,73 +96,73 @@ As of v1.2.0, note that `--noConfirm` is required to perform data restores invol
9696
Single table backup/restore:
9797

9898
```
99-
python dynamodump.py -m backup -r us-west-1 -s testTable
99+
python dynamodump/dynamodump.py -m backup -r us-west-1 -s testTable
100100
101-
python dynamodump.py -m restore -r us-west-1 -s testTable
101+
python dynamodump/dynamodump.py -m restore -r us-west-1 -s testTable
102102
```
103103

104104
Multiple table backup/restore (assumes prefix of 'production-' of table names, use --prefixSeparator to specify a
105105
different separator):
106106

107107
```
108-
python dynamodump.py -m backup -r us-west-1 -s production*
108+
python dynamodump/dynamodump.py -m backup -r us-west-1 -s production*
109109
110-
python dynamodump.py -m restore -r us-west-1 -s production*
110+
python dynamodump/dynamodump.py -m restore -r us-west-1 -s production*
111111
```
112112

113113
The above, but between different environments (e.g. production-_ tables to development-_ tables):
114114

115115
```
116-
python dynamodump.py -m backup -r us-west-1 -s production*
116+
python dynamodump/dynamodump.py -m backup -r us-west-1 -s production*
117117
118-
python dynamodump.py -m restore -r us-west-1 -s production* -d development*
118+
python dynamodump/dynamodump.py -m restore -r us-west-1 -s production* -d development*
119119
```
120120

121121
Backup all tables and restore only data (will not delete and recreate schema):
122122

123123
```
124-
python dynamodump.py -m backup -r us-west-1 -s "*"
124+
python dynamodump/dynamodump.py -m backup -r us-west-1 -s "*"
125125
126-
python dynamodump.py -m restore -r us-west-1 -s "*" --dataOnly
126+
python dynamodump/dynamodump.py -m restore -r us-west-1 -s "*" --dataOnly
127127
```
128128

129129
Dump all table schemas and create the schemas (e.g. creating blank tables in a different AWS account):
130130

131131
```
132-
python dynamodump.py -m backup -r us-west-1 -p source_credentials -s "*" --schemaOnly
132+
python dynamodump/dynamodump.py -m backup -r us-west-1 -p source_credentials -s "*" --schemaOnly
133133
134-
python dynamodump.py -m restore -r us-west-1 -p destination_credentials -s "*" --schemaOnly
134+
python dynamodump/dynamodump.py -m restore -r us-west-1 -p destination_credentials -s "*" --schemaOnly
135135
```
136136

137137
Backup all tables based on AWS tag `key=value`
138138

139139
```
140-
python dynamodump.py -p profile -r us-east-1 -m backup -t KEY=VALUE
140+
python dynamodump/dynamodump.py -p profile -r us-east-1 -m backup -t KEY=VALUE
141141
```
142142

143143
Backup all tables based on AWS tag, compress and store in specified S3 bucket.
144144

145145
```
146-
python dynamodump.py -p profile -r us-east-1 -m backup -a tar -b some_s3_bucket -t TAG_KEY=TAG_VALUE
146+
python dynamodump/dynamodump.py -p profile -r us-east-1 -m backup -a tar -b some_s3_bucket -t TAG_KEY=TAG_VALUE
147147
148-
python dynamodump.py -p profile -r us-east-1 -m backup -a zip -b some_s3_bucket -t TAG_KEY=TAG_VALUE
148+
python dynamodump/dynamodump.py -p profile -r us-east-1 -m backup -a zip -b some_s3_bucket -t TAG_KEY=TAG_VALUE
149149
```
150150

151151
Restore from S3 bucket to specified destination table
152152

153153
```
154154
## source_table identifies archive file in S3 bucket from which backup data is restored
155-
python dynamodump.py -a tar -b some_s3_bucket -m restore -r us-east-1 -p profile -d destination_table -s source_table
155+
python dynamodump/dynamodump.py -a tar -b some_s3_bucket -m restore -r us-east-1 -p profile -d destination_table -s source_table
156156
```
157157

158158
## Local example
159159

160160
The following assumes your local DynamoDB is running on localhost:8000 and is accessible via 'a' as access/secret keys.
161161

162162
```
163-
python dynamodump.py -m backup -r local -s testTable --host localhost --port 8000 --accessKey a --secretKey a
163+
python dynamodump/dynamodump.py -m backup -r local -s testTable --host localhost --port 8000 --accessKey a --secretKey a
164164
165-
python dynamodump.py -m restore -r local -s testTable --host localhost --port 8000 --accessKey a --secretKey a
165+
python dynamodump/dynamodump.py -m restore -r local -s testTable --host localhost --port 8000 --accessKey a --secretKey a
166166
```
167167

168168
Multiple table backup/restore as stated in the AWS examples are also available for local.

dynamodump/__init__.py

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)