amplify-excel-migrator 1.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amplify_client.py +941 -0
- amplify_excel_migrator-1.1.5.dist-info/METADATA +219 -0
- amplify_excel_migrator-1.1.5.dist-info/RECORD +9 -0
- amplify_excel_migrator-1.1.5.dist-info/WHEEL +5 -0
- amplify_excel_migrator-1.1.5.dist-info/entry_points.txt +2 -0
- amplify_excel_migrator-1.1.5.dist-info/licenses/LICENSE +21 -0
- amplify_excel_migrator-1.1.5.dist-info/top_level.txt +3 -0
- migrator.py +437 -0
- model_field_parser.py +314 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: amplify-excel-migrator
|
|
3
|
+
Version: 1.1.5
|
|
4
|
+
Summary: A CLI tool to migrate Excel data to AWS Amplify
|
|
5
|
+
Home-page: https://github.com/EyalPoly/amplify-excel-migrator
|
|
6
|
+
Author: Eyal Politansky
|
|
7
|
+
Author-email: 10eyal10@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: pandas>=1.3.0
|
|
15
|
+
Requires-Dist: requests>=2.26.0
|
|
16
|
+
Requires-Dist: boto3>=1.18.0
|
|
17
|
+
Requires-Dist: pycognito>=2023.5.0
|
|
18
|
+
Requires-Dist: PyJWT>=2.0.0
|
|
19
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
20
|
+
Requires-Dist: openpyxl>=3.0.0
|
|
21
|
+
Requires-Dist: inflect>=7.0.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
27
|
+
Requires-Dist: setuptools>=80.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: wheel>=0.40.0; extra == "dev"
|
|
29
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
30
|
+
Dynamic: author
|
|
31
|
+
Dynamic: author-email
|
|
32
|
+
Dynamic: classifier
|
|
33
|
+
Dynamic: description
|
|
34
|
+
Dynamic: description-content-type
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: provides-extra
|
|
38
|
+
Dynamic: requires-dist
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
Dynamic: summary
|
|
41
|
+
|
|
42
|
+
# Amplify Excel Migrator
|
|
43
|
+
|
|
44
|
+
[](https://badge.fury.io/py/amplify-excel-migrator)
|
|
45
|
+
[](https://pypi.org/project/amplify-excel-migrator/)
|
|
46
|
+
[](https://pepy.tech/project/amplify-excel-migrator)
|
|
47
|
+
[](https://opensource.org/licenses/MIT)
|
|
48
|
+
|
|
49
|
+
A CLI tool to migrate data from Excel files to AWS Amplify GraphQL API.
|
|
50
|
+
Developed for the MECO project - https://github.com/sworgkh/meco-observations-amplify
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
### From PyPI (Recommended)
|
|
55
|
+
|
|
56
|
+
Install the latest stable version from PyPI:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install amplify-excel-migrator
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### From GitHub
|
|
63
|
+
|
|
64
|
+
Install directly from GitHub:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install git+https://github.com/EyalPoly/amplify-excel-migrator.git
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### From Source
|
|
71
|
+
|
|
72
|
+
Clone the repository and install:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
git clone https://github.com/EyalPoly/amplify-excel-migrator.git
|
|
76
|
+
cd amplify-excel-migrator
|
|
77
|
+
pip install .
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### For Development
|
|
81
|
+
|
|
82
|
+
Install with development dependencies:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install -e ".[dev]"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This installs the package in editable mode with pytest and other development tools.
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
The tool has three subcommands:
|
|
93
|
+
|
|
94
|
+
### 1. Configure (First Time Setup)
|
|
95
|
+
|
|
96
|
+
Save your AWS Amplify configuration:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
amplify-migrator config
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
This will prompt you for:
|
|
103
|
+
- Excel file path
|
|
104
|
+
- AWS Amplify API endpoint
|
|
105
|
+
- AWS Region
|
|
106
|
+
- Cognito User Pool ID
|
|
107
|
+
- Cognito Client ID
|
|
108
|
+
- Admin username
|
|
109
|
+
|
|
110
|
+
Configuration is saved to `~/.amplify-migrator/config.json` (passwords are never saved).
|
|
111
|
+
|
|
112
|
+
### 2. Show Configuration
|
|
113
|
+
|
|
114
|
+
View your current saved configuration:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
amplify-migrator show
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 3. Run Migration
|
|
121
|
+
|
|
122
|
+
Run the migration using your saved configuration:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
amplify-migrator migrate
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
You'll only be prompted for your password (for security, passwords are never cached).
|
|
129
|
+
|
|
130
|
+
### Quick Start
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# First time: configure the tool
|
|
134
|
+
amplify-migrator config
|
|
135
|
+
|
|
136
|
+
# View current configuration
|
|
137
|
+
amplify-migrator show
|
|
138
|
+
|
|
139
|
+
# Run migration (uses saved config)
|
|
140
|
+
amplify-migrator migrate
|
|
141
|
+
|
|
142
|
+
# View help
|
|
143
|
+
amplify-migrator --help
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Example: Configuration
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
╔════════════════════════════════════════════════════╗
|
|
150
|
+
║ Amplify Migrator - Configuration Setup ║
|
|
151
|
+
╚════════════════════════════════════════════════════╝
|
|
152
|
+
|
|
153
|
+
📋 Configuration Setup:
|
|
154
|
+
------------------------------------------------------
|
|
155
|
+
Excel file path [data.xlsx]: my-data.xlsx
|
|
156
|
+
AWS Amplify API endpoint: https://xxx.appsync-api.us-east-1.amazonaws.com/graphql
|
|
157
|
+
AWS Region [us-east-1]:
|
|
158
|
+
Cognito User Pool ID: us-east-1_xxxxx
|
|
159
|
+
Cognito Client ID: your-client-id
|
|
160
|
+
Admin Username: admin@example.com
|
|
161
|
+
|
|
162
|
+
✅ Configuration saved successfully!
|
|
163
|
+
💡 You can now run 'amplify-migrator migrate' to start the migration.
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Example: Migration
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
╔════════════════════════════════════════════════════╗
|
|
170
|
+
║ Migrator Tool for Amplify ║
|
|
171
|
+
╠════════════════════════════════════════════════════╣
|
|
172
|
+
║ This tool requires admin privileges to execute ║
|
|
173
|
+
╚════════════════════════════════════════════════════╝
|
|
174
|
+
|
|
175
|
+
🔐 Authentication:
|
|
176
|
+
------------------------------------------------------
|
|
177
|
+
Admin Password: ********
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Requirements
|
|
181
|
+
|
|
182
|
+
- Python 3.8+
|
|
183
|
+
- AWS Amplify GraphQL API
|
|
184
|
+
- AWS Cognito User Pool
|
|
185
|
+
- Admin access to the Cognito User Pool
|
|
186
|
+
|
|
187
|
+
## Features
|
|
188
|
+
|
|
189
|
+
- **Configuration caching** - Save your setup, reuse it for multiple migrations
|
|
190
|
+
- **Interactive prompts** - Easy step-by-step configuration
|
|
191
|
+
- **Custom types and enums** - Full support for Amplify custom types
|
|
192
|
+
- **Duplicate detection** - Automatically skips existing records
|
|
193
|
+
- **Async uploads** - Fast parallel uploads for better performance
|
|
194
|
+
- **MFA support** - Works with multi-factor authentication
|
|
195
|
+
- **Automatic type parsing** - Smart field type detection and conversion
|
|
196
|
+
|
|
197
|
+
## Excel File Format
|
|
198
|
+
|
|
199
|
+
The Excel file should have:
|
|
200
|
+
- One sheet per Amplify model (sheet name must match model name)
|
|
201
|
+
- Column names matching the model field names
|
|
202
|
+
- First row as headers
|
|
203
|
+
|
|
204
|
+
### Example Excel Structure
|
|
205
|
+
|
|
206
|
+
**Sheet: User**
|
|
207
|
+
| name | email | age |
|
|
208
|
+
|------|-------|-----|
|
|
209
|
+
| John | john@example.com | 30 |
|
|
210
|
+
| Jane | jane@example.com | 25 |
|
|
211
|
+
|
|
212
|
+
**Sheet: Post**
|
|
213
|
+
| title | content | userId |
|
|
214
|
+
|-------|---------|--------|
|
|
215
|
+
| First Post | Hello World | john@example.com |
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
amplify_client.py,sha256=NjX3aICsMdHHwh-i5zGNIr2Cl95Bv87faYBcjVYI8nM,35633
|
|
2
|
+
migrator.py,sha256=6MhxR280-J7g2EqgMsevXEvxZRgZ0re92G-rajmDO_0,17203
|
|
3
|
+
model_field_parser.py,sha256=e4CUo0v3SvKq2VkkLgAPPD-LA3syYoPCQC81WI2QL9Y,11841
|
|
4
|
+
amplify_excel_migrator-1.1.5.dist-info/licenses/LICENSE,sha256=i8Sf8mXscGI9l-HTQ5RLQkAJU6Iv5hPYctJksPY70U0,1071
|
|
5
|
+
amplify_excel_migrator-1.1.5.dist-info/METADATA,sha256=-25R9Cc_qZpr998NazevvJvpwsfa8VhkmqnXM1uxCWI,6239
|
|
6
|
+
amplify_excel_migrator-1.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
amplify_excel_migrator-1.1.5.dist-info/entry_points.txt,sha256=Ifd7YnV4lNbjFbbnjsmlHWiIAfIpiC5POgJtxfSlDT4,51
|
|
8
|
+
amplify_excel_migrator-1.1.5.dist-info/top_level.txt,sha256=C-ffRe3F26GYiM7f6xy-pPvbwnh7Wnieyt-jS-cbdTU,43
|
|
9
|
+
amplify_excel_migrator-1.1.5.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Eyal Politansky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|