You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A [Wiley Online Library](https://onlinelibrary.wiley.com/) (WOL) Account
69
-
*A TDM API Token, available from the WOL [TDM resources page](https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining) using your WOL Account
77
+
*Your TDM API Token (UUID format), available from the WOL [TDM resources page](https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining) using your WOL Account
70
78
* Access to the content you wish to download
71
79
* Access will be determined via your [public IP address](https://api.ipify.org/?format=json)
72
80
@@ -76,11 +84,12 @@ You will require the following:
76
84
77
85
Set the environment variable `TDM_API_TOKEN` to your API token:
`TDMClient` exposes several options to control where files are saved, how requests are paced, and what gets recorded. All paths are relative to your current working directory unless you use an absolute path.
145
+
146
+
### API token
147
+
148
+
The TDM API token is a UUID issued via the [TDM resources page](https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining). Provide it via the `TDM_API_TOKEN` environment variable (recommended) or pass it directly:
149
+
150
+
```python
151
+
from wiley_tdm import TDMClient
152
+
153
+
tdm = TDMClient(api_token="your-uuid-token-here")
154
+
```
155
+
156
+
### Download directory
157
+
158
+
PDFs are saved to a `downloads` folder by default. Set a custom directory when creating the client, or change it later:
Files are named `<doi>.pdf` in the download directory.
172
+
173
+
### Rate limiting
174
+
175
+
Batch downloads (`download_pdfs`) wait between API requests to stay within Wiley's rate limits. The default pause is **5 seconds**; you can increase it, but not set it below the default:
176
+
177
+
```python
178
+
tdm = TDMClient()
179
+
tdm.api_rate_limit =10.0# Wait 10 seconds between downloads in a batch
180
+
```
181
+
182
+
Single-article downloads (`download_pdf`) are not delayed.
183
+
184
+
### Per-download callback
185
+
186
+
For batch downloads, pass an `on_result` callback to `download_pdfs`. It is called after each DOI finishes, so you can inject your own code into the loop without waiting for the whole batch to complete.
The callback receives the same `DownloadResult` returned by `download_pdf`. `download_pdfs` still returns the full list when the batch completes.
200
+
201
+
### Skip existing files
202
+
203
+
By default, `skip_existing_files` is `True`: if `<doi>.pdf` already exists in the download directory, the client skips the API call and records the file as already present. Set to `False` to re-download:
204
+
205
+
```python
206
+
tdm = TDMClient()
207
+
tdm.skip_existing_files =False
208
+
tdm.download_pdf("10.1111/jtsb.12390")
209
+
```
210
+
211
+
### Download results
212
+
213
+
Each download returns a `DownloadResult` with status, file path, and timing. Access accumulated results via `tdm.results`, or save only failures:
214
+
215
+
```python
216
+
from wiley_tdm import DownloadStatus, TDMClient
217
+
218
+
tdm = TDMClient()
219
+
tdm.only_record_errors =True# Default is False — only failures kept in tdm.results
tdm.save_results("my-results.csv") # Default is results.csv
227
+
```
228
+
133
229
## Known Limitations
134
230
135
-
There are two known limitations of the TDM Client (/TDM API)
231
+
There are two known limitations of the TDM Client (/TDM API):
136
232
137
-
### Access is IP address based only.
233
+
### Access is IP address based only
138
234
139
235
The following scenarios are not supported:
140
-
* Your WOL customer account doesn't have IP based access configured. (e.g. SSO only)
141
-
*You do have IP based access but you are on a different network or subnet to the one configured. (e.g. Off campus)
236
+
* Your WOL customer account **doesn't** have IP based access configured. (e.g. SSO only)
237
+
*Your WOL customer account **does**have IP based access configured but you are outside the configured IP range. (e.g. Executing code off campus or in the Cloud)
142
238
143
-
Ask your WOL Account Admin to confirm your access model. See [Troubleshooting]([#Troubleshooting) for further assistance.
239
+
Ask your WOL Account Admin to confirm your access model. See [Troubleshooting](#troubleshooting) for further assistance.
144
240
145
-
Potential Workarounds:
146
-
* Return to campus.
241
+
**Potential Workarounds:**
242
+
243
+
**IP access available:**
244
+
* Run code within configured IP range (e.g. Return to campus)
147
245
* Manually download entitled content on WOL, via https://onlinelibrary.wiley.com/doi/epdf/{doi}
246
+
247
+
**IP access not available:**
148
248
* Request IP based access via your WOL Account Admin.
149
-
* Request feed-based (non‑API‑based) content dissemination for TDM with Wiley's Digital Licensing team.
249
+
* Request feed-based (non‑API‑based) content dissemination for TDM via your WOL Account Admin.
150
250
151
-
### SICI DOIs are not supported.
251
+
### SICI DOIs are not supported
152
252
153
-
The TDM APIs cannot support [SICI](https://en.wikipedia.org/wiki/Serial_Item_and_Contribution_Identifier) DOIs. For example:
253
+
The TDM APIs cannot support [SICI](https://en.wikipedia.org/wiki/Serial_Item_and_Contribution_Identifier) DOIs, containing semicolons. For example:
# Save the download results to a CSV file: 'results.csv'
272
+
tdm = TDMClient()
273
+
# ... run downloads ...
170
274
tdm.save_results()
171
275
```
172
276
277
+
Review the console logs and results.csv. For deeper analysis set `level=logging.DEBUG`
278
+
173
279
### Installation
174
280
175
281
If you encounter installation issues:
@@ -200,11 +306,13 @@ If problems persist, please [open an issue](https://github.com/WileyLabs/tdm-cli
200
306
201
307
### Access denied
202
308
309
+
The majority of reported issues relate to access problems. Please note that only IP based access is supported, see [Known Limitations](#known-limitations). If you do have IP based access and are still experiencing issues try the following:
310
+
203
311
Check access directly on [Wiley Online Library](https://onlinelibrary.wiley.com/).
204
312
- If access denied: contact your Institution/Wiley and check your subscription is active.
205
313
- If access granted: ensure you are accessing the TDM API from a known IP address (see below).
206
314
207
-
It is possible that the IP address you are accessing WOL from is different to where you are running your TDM code. Observe your IP address in the TDM console log and compare to the IP address in your [browser](https://api.ipify.org?format=json).
315
+
It is possible that the IP address you are accessing WOL from is different to where you are running your TDM code. Enable TDM logging (see [Troubleshooting](#troubleshooting)), observe your IP address in the TDM console log and compare to the IP address in your [browser](https://api.ipify.org?format=json).
208
316
209
317
Example console output:
210
318
```
@@ -213,14 +321,25 @@ Example console output:
213
321
214
322
Example Browser output:
215
323
324
+
https://api.ipify.org/?format=json
325
+
216
326
```json
217
-
// https://api.ipify.org/?format=json
218
327
{
219
328
"ip": "XX.XX.XX.XX"
220
329
}
221
330
```
331
+
If the IP addresses are different then seek guidance from your network administrator.
332
+
333
+
### Other issues
334
+
335
+
For other issues please contact: tdm@wiley.com and provide the following information:
336
+
337
+
* TDM API Token (UUID)
338
+
* results.csv
339
+
* console log
340
+
* dois.txt (problematic DOIs)
341
+
* Summary of problem
222
342
223
-
If problems persist, please contact: tdm@wiley.com
0 commit comments