printipy 0.0.1__tar.gz
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.
- printipy-0.0.1/LICENSE +21 -0
- printipy-0.0.1/PKG-INFO +258 -0
- printipy-0.0.1/README.md +239 -0
- printipy-0.0.1/printipy/__init__.py +0 -0
- printipy-0.0.1/printipy/api.py +937 -0
- printipy-0.0.1/printipy.egg-info/PKG-INFO +258 -0
- printipy-0.0.1/printipy.egg-info/SOURCES.txt +10 -0
- printipy-0.0.1/printipy.egg-info/dependency_links.txt +1 -0
- printipy-0.0.1/printipy.egg-info/requires.txt +2 -0
- printipy-0.0.1/printipy.egg-info/top_level.txt +1 -0
- printipy-0.0.1/setup.cfg +4 -0
- printipy-0.0.1/setup.py +32 -0
printipy-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Lawrence Weikum
|
|
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.
|
printipy-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: printipy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Printify API for Python
|
|
5
|
+
Home-page: https://github.com/lawrencemq/printipy
|
|
6
|
+
Author: Lawrence Weikum
|
|
7
|
+
Keywords: printify,print on demand,api
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Topic :: Internet
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
|
|
20
|
+
# PrintiPy
|
|
21
|
+
The Printify API for Python
|
|
22
|
+
|
|
23
|
+
Tested with Python 3.8+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## documentation - to do
|
|
27
|
+
|
|
28
|
+
## create product
|
|
29
|
+
|
|
30
|
+
Example:
|
|
31
|
+
Even though the data below has more information than the API needs, the extraneous data will be filtered out automatically and the call will be sucessfully made.
|
|
32
|
+
```python
|
|
33
|
+
new_product_data = {
|
|
34
|
+
"title": "Testy McTestFace",
|
|
35
|
+
"description": "suc test. wow!",
|
|
36
|
+
"tags": [
|
|
37
|
+
"Home & Living",
|
|
38
|
+
"Paper",
|
|
39
|
+
"Sustainable",
|
|
40
|
+
"Greeting Card",
|
|
41
|
+
"Postcard",
|
|
42
|
+
"Card",
|
|
43
|
+
"Post cards",
|
|
44
|
+
"Postcards",
|
|
45
|
+
"Made in USA"
|
|
46
|
+
],
|
|
47
|
+
"blueprint_id": 1094,
|
|
48
|
+
"print_provider_id": 228,
|
|
49
|
+
"variants": [
|
|
50
|
+
{
|
|
51
|
+
"id": 81870,
|
|
52
|
+
"price": 999,
|
|
53
|
+
"is_enabled": True,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": 81871,
|
|
57
|
+
"price": 2499,
|
|
58
|
+
"is_enabled": True,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": 81872,
|
|
62
|
+
"price": 4399,
|
|
63
|
+
"is_enabled": True,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": 81873,
|
|
67
|
+
"price": 5599,
|
|
68
|
+
"is_enabled": True,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
"print_areas": [
|
|
72
|
+
{
|
|
73
|
+
"variant_ids": [
|
|
74
|
+
81810,
|
|
75
|
+
81811,
|
|
76
|
+
81812,
|
|
77
|
+
81813,
|
|
78
|
+
81822,
|
|
79
|
+
81823,
|
|
80
|
+
81824,
|
|
81
|
+
81825,
|
|
82
|
+
81814,
|
|
83
|
+
81815,
|
|
84
|
+
81816,
|
|
85
|
+
81817,
|
|
86
|
+
81818,
|
|
87
|
+
81819,
|
|
88
|
+
81820,
|
|
89
|
+
81821,
|
|
90
|
+
81874,
|
|
91
|
+
81875,
|
|
92
|
+
81876,
|
|
93
|
+
81877,
|
|
94
|
+
81886,
|
|
95
|
+
81887,
|
|
96
|
+
81888,
|
|
97
|
+
81889,
|
|
98
|
+
81878,
|
|
99
|
+
81879,
|
|
100
|
+
81880,
|
|
101
|
+
81881,
|
|
102
|
+
81882,
|
|
103
|
+
81883,
|
|
104
|
+
81884,
|
|
105
|
+
81885,
|
|
106
|
+
81890,
|
|
107
|
+
81891,
|
|
108
|
+
81892,
|
|
109
|
+
81893,
|
|
110
|
+
81902,
|
|
111
|
+
81903,
|
|
112
|
+
81904,
|
|
113
|
+
81905,
|
|
114
|
+
81894,
|
|
115
|
+
81895,
|
|
116
|
+
81896,
|
|
117
|
+
81897,
|
|
118
|
+
81898,
|
|
119
|
+
81899,
|
|
120
|
+
81900,
|
|
121
|
+
81901,
|
|
122
|
+
81906,
|
|
123
|
+
81907,
|
|
124
|
+
81908,
|
|
125
|
+
81909,
|
|
126
|
+
81918,
|
|
127
|
+
81919,
|
|
128
|
+
81920,
|
|
129
|
+
81921,
|
|
130
|
+
81910,
|
|
131
|
+
81911,
|
|
132
|
+
81912,
|
|
133
|
+
81913,
|
|
134
|
+
81914,
|
|
135
|
+
81915,
|
|
136
|
+
81916,
|
|
137
|
+
81917,
|
|
138
|
+
81962,
|
|
139
|
+
81963,
|
|
140
|
+
81964,
|
|
141
|
+
81965,
|
|
142
|
+
81974,
|
|
143
|
+
81975,
|
|
144
|
+
81976,
|
|
145
|
+
81977,
|
|
146
|
+
81966,
|
|
147
|
+
81967,
|
|
148
|
+
81968,
|
|
149
|
+
81969,
|
|
150
|
+
81970,
|
|
151
|
+
81971,
|
|
152
|
+
81972,
|
|
153
|
+
81973,
|
|
154
|
+
81826,
|
|
155
|
+
81827,
|
|
156
|
+
81828,
|
|
157
|
+
81829,
|
|
158
|
+
81838,
|
|
159
|
+
81839,
|
|
160
|
+
81840,
|
|
161
|
+
81841,
|
|
162
|
+
81830,
|
|
163
|
+
81831,
|
|
164
|
+
81832,
|
|
165
|
+
81833,
|
|
166
|
+
81834,
|
|
167
|
+
81835,
|
|
168
|
+
81836,
|
|
169
|
+
81837,
|
|
170
|
+
81842,
|
|
171
|
+
81843,
|
|
172
|
+
81844,
|
|
173
|
+
81845,
|
|
174
|
+
81854,
|
|
175
|
+
81855,
|
|
176
|
+
81856,
|
|
177
|
+
81857,
|
|
178
|
+
81846,
|
|
179
|
+
81847,
|
|
180
|
+
81848,
|
|
181
|
+
81849,
|
|
182
|
+
81850,
|
|
183
|
+
81851,
|
|
184
|
+
81852,
|
|
185
|
+
81853,
|
|
186
|
+
81858,
|
|
187
|
+
81859,
|
|
188
|
+
81860,
|
|
189
|
+
81861,
|
|
190
|
+
81870,
|
|
191
|
+
81871,
|
|
192
|
+
81872,
|
|
193
|
+
81873,
|
|
194
|
+
81862,
|
|
195
|
+
81863,
|
|
196
|
+
81864,
|
|
197
|
+
81865,
|
|
198
|
+
81866,
|
|
199
|
+
81867,
|
|
200
|
+
81868,
|
|
201
|
+
81869
|
|
202
|
+
],
|
|
203
|
+
"placeholders": [
|
|
204
|
+
{
|
|
205
|
+
"position": "inside",
|
|
206
|
+
"images": [
|
|
207
|
+
{
|
|
208
|
+
"id": "63e7f5fbf08c3242e6859f58",
|
|
209
|
+
"name": "bday_0030_back.jpg",
|
|
210
|
+
"type": "image/jpeg",
|
|
211
|
+
"height": 3849,
|
|
212
|
+
"width": 2750,
|
|
213
|
+
"x": 0.7440094762474443,
|
|
214
|
+
"y": 0.4906514988405507,
|
|
215
|
+
"scale": 0.49589968099975856,
|
|
216
|
+
"angle": 0
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "63e7f5fbf08c3242e6859f58",
|
|
220
|
+
"name": "bday_0030_back.jpg",
|
|
221
|
+
"type": "image/jpeg",
|
|
222
|
+
"height": 3849,
|
|
223
|
+
"width": 2750,
|
|
224
|
+
"x": 0.24780487804878043,
|
|
225
|
+
"y": 0.4903646422579296,
|
|
226
|
+
"scale": 0.49560975609756086,
|
|
227
|
+
"angle": 0
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"position": "cover",
|
|
233
|
+
"images": [
|
|
234
|
+
{
|
|
235
|
+
"id": "63e7f5bb3ff59340bd57938f",
|
|
236
|
+
"name": "bday_0030_front.jpg",
|
|
237
|
+
"type": "image/jpeg",
|
|
238
|
+
"height": 3849,
|
|
239
|
+
"width": 2750,
|
|
240
|
+
"x": 0.7390939252654081,
|
|
241
|
+
"y": 0.49405654771100854,
|
|
242
|
+
"scale": 0.48716923114741456,
|
|
243
|
+
"angle": 0
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
new_product = CreateProduct.from_dict(new_product_data)
|
|
252
|
+
print(api.create_product(7370017, new_product))
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
## Running Tests
|
|
257
|
+
|
|
258
|
+
`pipenv run pytest`
|
printipy-0.0.1/README.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# PrintiPy
|
|
2
|
+
The Printify API for Python
|
|
3
|
+
|
|
4
|
+
Tested with Python 3.8+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## documentation - to do
|
|
8
|
+
|
|
9
|
+
## create product
|
|
10
|
+
|
|
11
|
+
Example:
|
|
12
|
+
Even though the data below has more information than the API needs, the extraneous data will be filtered out automatically and the call will be sucessfully made.
|
|
13
|
+
```python
|
|
14
|
+
new_product_data = {
|
|
15
|
+
"title": "Testy McTestFace",
|
|
16
|
+
"description": "suc test. wow!",
|
|
17
|
+
"tags": [
|
|
18
|
+
"Home & Living",
|
|
19
|
+
"Paper",
|
|
20
|
+
"Sustainable",
|
|
21
|
+
"Greeting Card",
|
|
22
|
+
"Postcard",
|
|
23
|
+
"Card",
|
|
24
|
+
"Post cards",
|
|
25
|
+
"Postcards",
|
|
26
|
+
"Made in USA"
|
|
27
|
+
],
|
|
28
|
+
"blueprint_id": 1094,
|
|
29
|
+
"print_provider_id": 228,
|
|
30
|
+
"variants": [
|
|
31
|
+
{
|
|
32
|
+
"id": 81870,
|
|
33
|
+
"price": 999,
|
|
34
|
+
"is_enabled": True,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": 81871,
|
|
38
|
+
"price": 2499,
|
|
39
|
+
"is_enabled": True,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": 81872,
|
|
43
|
+
"price": 4399,
|
|
44
|
+
"is_enabled": True,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": 81873,
|
|
48
|
+
"price": 5599,
|
|
49
|
+
"is_enabled": True,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
"print_areas": [
|
|
53
|
+
{
|
|
54
|
+
"variant_ids": [
|
|
55
|
+
81810,
|
|
56
|
+
81811,
|
|
57
|
+
81812,
|
|
58
|
+
81813,
|
|
59
|
+
81822,
|
|
60
|
+
81823,
|
|
61
|
+
81824,
|
|
62
|
+
81825,
|
|
63
|
+
81814,
|
|
64
|
+
81815,
|
|
65
|
+
81816,
|
|
66
|
+
81817,
|
|
67
|
+
81818,
|
|
68
|
+
81819,
|
|
69
|
+
81820,
|
|
70
|
+
81821,
|
|
71
|
+
81874,
|
|
72
|
+
81875,
|
|
73
|
+
81876,
|
|
74
|
+
81877,
|
|
75
|
+
81886,
|
|
76
|
+
81887,
|
|
77
|
+
81888,
|
|
78
|
+
81889,
|
|
79
|
+
81878,
|
|
80
|
+
81879,
|
|
81
|
+
81880,
|
|
82
|
+
81881,
|
|
83
|
+
81882,
|
|
84
|
+
81883,
|
|
85
|
+
81884,
|
|
86
|
+
81885,
|
|
87
|
+
81890,
|
|
88
|
+
81891,
|
|
89
|
+
81892,
|
|
90
|
+
81893,
|
|
91
|
+
81902,
|
|
92
|
+
81903,
|
|
93
|
+
81904,
|
|
94
|
+
81905,
|
|
95
|
+
81894,
|
|
96
|
+
81895,
|
|
97
|
+
81896,
|
|
98
|
+
81897,
|
|
99
|
+
81898,
|
|
100
|
+
81899,
|
|
101
|
+
81900,
|
|
102
|
+
81901,
|
|
103
|
+
81906,
|
|
104
|
+
81907,
|
|
105
|
+
81908,
|
|
106
|
+
81909,
|
|
107
|
+
81918,
|
|
108
|
+
81919,
|
|
109
|
+
81920,
|
|
110
|
+
81921,
|
|
111
|
+
81910,
|
|
112
|
+
81911,
|
|
113
|
+
81912,
|
|
114
|
+
81913,
|
|
115
|
+
81914,
|
|
116
|
+
81915,
|
|
117
|
+
81916,
|
|
118
|
+
81917,
|
|
119
|
+
81962,
|
|
120
|
+
81963,
|
|
121
|
+
81964,
|
|
122
|
+
81965,
|
|
123
|
+
81974,
|
|
124
|
+
81975,
|
|
125
|
+
81976,
|
|
126
|
+
81977,
|
|
127
|
+
81966,
|
|
128
|
+
81967,
|
|
129
|
+
81968,
|
|
130
|
+
81969,
|
|
131
|
+
81970,
|
|
132
|
+
81971,
|
|
133
|
+
81972,
|
|
134
|
+
81973,
|
|
135
|
+
81826,
|
|
136
|
+
81827,
|
|
137
|
+
81828,
|
|
138
|
+
81829,
|
|
139
|
+
81838,
|
|
140
|
+
81839,
|
|
141
|
+
81840,
|
|
142
|
+
81841,
|
|
143
|
+
81830,
|
|
144
|
+
81831,
|
|
145
|
+
81832,
|
|
146
|
+
81833,
|
|
147
|
+
81834,
|
|
148
|
+
81835,
|
|
149
|
+
81836,
|
|
150
|
+
81837,
|
|
151
|
+
81842,
|
|
152
|
+
81843,
|
|
153
|
+
81844,
|
|
154
|
+
81845,
|
|
155
|
+
81854,
|
|
156
|
+
81855,
|
|
157
|
+
81856,
|
|
158
|
+
81857,
|
|
159
|
+
81846,
|
|
160
|
+
81847,
|
|
161
|
+
81848,
|
|
162
|
+
81849,
|
|
163
|
+
81850,
|
|
164
|
+
81851,
|
|
165
|
+
81852,
|
|
166
|
+
81853,
|
|
167
|
+
81858,
|
|
168
|
+
81859,
|
|
169
|
+
81860,
|
|
170
|
+
81861,
|
|
171
|
+
81870,
|
|
172
|
+
81871,
|
|
173
|
+
81872,
|
|
174
|
+
81873,
|
|
175
|
+
81862,
|
|
176
|
+
81863,
|
|
177
|
+
81864,
|
|
178
|
+
81865,
|
|
179
|
+
81866,
|
|
180
|
+
81867,
|
|
181
|
+
81868,
|
|
182
|
+
81869
|
|
183
|
+
],
|
|
184
|
+
"placeholders": [
|
|
185
|
+
{
|
|
186
|
+
"position": "inside",
|
|
187
|
+
"images": [
|
|
188
|
+
{
|
|
189
|
+
"id": "63e7f5fbf08c3242e6859f58",
|
|
190
|
+
"name": "bday_0030_back.jpg",
|
|
191
|
+
"type": "image/jpeg",
|
|
192
|
+
"height": 3849,
|
|
193
|
+
"width": 2750,
|
|
194
|
+
"x": 0.7440094762474443,
|
|
195
|
+
"y": 0.4906514988405507,
|
|
196
|
+
"scale": 0.49589968099975856,
|
|
197
|
+
"angle": 0
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "63e7f5fbf08c3242e6859f58",
|
|
201
|
+
"name": "bday_0030_back.jpg",
|
|
202
|
+
"type": "image/jpeg",
|
|
203
|
+
"height": 3849,
|
|
204
|
+
"width": 2750,
|
|
205
|
+
"x": 0.24780487804878043,
|
|
206
|
+
"y": 0.4903646422579296,
|
|
207
|
+
"scale": 0.49560975609756086,
|
|
208
|
+
"angle": 0
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"position": "cover",
|
|
214
|
+
"images": [
|
|
215
|
+
{
|
|
216
|
+
"id": "63e7f5bb3ff59340bd57938f",
|
|
217
|
+
"name": "bday_0030_front.jpg",
|
|
218
|
+
"type": "image/jpeg",
|
|
219
|
+
"height": 3849,
|
|
220
|
+
"width": 2750,
|
|
221
|
+
"x": 0.7390939252654081,
|
|
222
|
+
"y": 0.49405654771100854,
|
|
223
|
+
"scale": 0.48716923114741456,
|
|
224
|
+
"angle": 0
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
new_product = CreateProduct.from_dict(new_product_data)
|
|
233
|
+
print(api.create_product(7370017, new_product))
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
## Running Tests
|
|
238
|
+
|
|
239
|
+
`pipenv run pytest`
|
|
File without changes
|