stdpy.diff
application/octet-stream
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| contrib/isn/update_isbn.py | 6 | 6 |
diff --git a/contrib/isn/update_isbn.py b/contrib/isn/update_isbn.py
index 5b44b5c18ff..856a6828c5d 100644
--- a/contrib/isn/update_isbn.py
+++ b/contrib/isn/update_isbn.py
@@ -1,7 +1,8 @@
-# Update ISBN.h from primary source.
+#!/usr/bin/env python3
+# Update ISBN.h from primary source.
import re
-import requests
+from urllib.request import Request, urlopen
import xml.etree.ElementTree as ET
SOURCE_URL = "https://www.isbn-international.org/export_rangemessage.xml"
@@ -72,10 +73,9 @@ def generate_table(root, gs1_prefix):
return table_lines, index_lines
def fetch_and_parse_source_data():
- #return ET.parse('x.xml').getroot()
- response = requests.get(SOURCE_URL)
- response.raise_for_status()
- return ET.fromstring(response.text)
+ with urlopen(SOURCE_URL) as response:
+ data = response.read()
+ return ET.fromstring(data)
def merge_isbn(input_lines):
root = fetch_and_parse_source_data()