Subject: [Tools-discuss] List of all drafts in machine readable format

From: Eric Rescorla <[email-masked]>
Date: Sun, 15 Oct 2017 11:51:54 -0700

Does someone maintain a list of all the IDs in some sort of machine
readable format (JSON, XML, etc.)

-Ekr

---

From: "Paul Hoffman" <[email-masked]>
Date: Sun, 15 Oct 2017 12:27:20 -0700

> readable format (JSON, XML, etc.)

In the Internet Drafts directory that is rsyncable, there is 
ietf-id-status.json.

---

From: Eric Rescorla <[email-masked]>
Date: Sun, 15 Oct 2017 12:39:19 -0700

Hmm.... for some reason it doesn't show up in my rsync. I'm doing:

rsync -avz rsync.ietf.org::internet-drafts <directory>

Are you doing something else?

-Ekr

---

From: Carsten Bormann <[email-masked]>
Date: Sun, 15 Oct 2017 22:14:26 +0200

> On Oct 15, 2017, at 21:39, Eric Rescorla <[email-masked]> wrote:
> 

Neither does it in my copy.

The closest I’m aware of is all_id2.txt (also in the rsync), which is TSV (documentation at the start of the file).
This lists only the newest in a sequence of -nn versions, but it does lists replaced drafts etc.

Of course, all that information is in the datatracker; not sure whether there is an API for that.

Grüße, Carsten

---

From: Eric Rescorla <[email-masked]>
Date: Sun, 15 Oct 2017 13:29:46 -0700

On Sun, Oct 15, 2017 at 1:14 PM, Carsten Bormann <[email-masked]> wrote:

> The closest I’m aware of is all_id2.txt (also in the rsync), which is TSV
> (documentation at the start of the file).

Thanks. I can make that work (though it's not 100% awesome).

-Ekr

---

From: "Paul Hoffman" <[email-masked]>
Date: Sun, 15 Oct 2017 13:41:46 -0700

> Hmm.... for some reason it doesn't show up in my rsync.

Arrrgh, sorry, that was totally my fault. I create that file with the 
ietf-cli command.

On 15 Oct 2017, at 13:14, Carsten Bormann wrote:

> The closest I’m aware of is all_id2.txt (also in the rsync), which 
> is TSV (documentation at the start of the file).

In case it helps, here is some Python code for reading all_id2.txt and 
getting the fields out of it:

	try:
		AllIDStatusLines = open("all_id2.txt", mode="r").readlines()
	except:
		exit("Weird: could not read all_id2.txt to make the I-D status 
database. Exiting.")
	IDStatus = {}
	for ThisLine in AllIDStatusLines:
		if ThisLine[0] == "#": continue
		TheFields = ThisLine.split("\t")
		# The key is the draft name minus the "-nn"
		IDStatus[TheFields[0][0:-3]] = { \
			"status": TheFields[2], \
			"iesg-state": TheFields[3], \
			"became-rfc": TheFields[4], \
			"replaced-by": TheFields[5], \
			"last-revised": TheFields[6], \
			"wg-name": TheFields[7], \
			"area-name": TheFields[8], \
			"ad-name": TheFields[9], \
			"intended-level": TheFields[10], \
			"last-call-ends": TheFields[11], \
			"file-types": TheFields[12], \
			"title": TheFields[13], \
			"authors": TheFields[14].rstrip() }
	try:
		with open("ietf-id-status.json", mode="wb") as statusf:
			jsondump(IDStatus, statusf)
	except:
		exit("Could not dump status info to ietf-id-status.json. Exiting.")	

--Paul Hoffman

---

From: Eric Rescorla <[email-masked]>
Date: Sun, 15 Oct 2017 13:45:51 -0700

Thanks.

-Ekr

On Sun, Oct 15, 2017 at 1:41 PM, Paul Hoffman <[email-masked]> wrote:

>                 exit("Weird: could not read all_id2.txt to make the I-D
> status database. Exiting.")
>         IDStatus = {}

---

From: [email-masked] (Dale R. Worley)
Date: Mon, 16 Oct 2017 20:37:33 -0400

> readable format (JSON, XML, etc.)

I suppose it depends on what you mean by "machine readable".  I rsync
down the directory

    rsync -rltz \
        ftp.ietf.org::id-archive \
        ./ftp.ietf.org/id-archive

and then it's machine-readable...

Dale