published: python3 check-yt.py titles.txt run: python3 check-yt.py in/titles.txt OK | item 1 | 42 code points | 42 UTF-16 units | 42 UTF-8 bytes | at most 100 by every count OVER | item 2 | 101 code points | 101 UTF-16 units | 101 UTF-8 bytes | more than 100 by every count OK | item 3 | 100 code points | 100 UTF-16 units | 100 UTF-8 bytes | at most 100 by every count CHECK | item 4 | 95 code points | 110 UTF-16 units | 140 UTF-8 bytes | fits by code points, over 100 by UTF-16 units FAIL | item 5 | 26 code points | 26 UTF-16 units | 26 UTF-8 bytes | contains < > (the Data API forbids < and >) OK | item 6 | 20 code points | 20 UTF-16 units | 56 UTF-8 bytes | at most 100 by every count exit=1 published: python3 check-yt.py titles.txt run: printf "" > in/empty.txt; python3 check-yt.py in/empty.txt error: nothing to check in in/empty.txt exit=2 edge: an empty file: exit 2, nothing to check published: python3 check-yt.py titles.txt run: python3 check-yt.py in/missing.txt error: cannot read in/missing.txt ([Errno 2] No such file or directory: 'in/missing.txt') exit=2 edge: a file that does not exist: exit 2 with a message published: python3 check-yt.py --kind description description.txt run: python3 check-yt.py --kind description in/desc_ok.txt OK | item 1 | 1200 code points | 1200 UTF-16 units | 1200 UTF-8 bytes | under both limits exit=0 published: python3 check-yt.py --kind description description.txt run: python3 check-yt.py --kind description in/desc_cyr.txt API-OVER | item 1 | 3000 code points | 3000 UTF-16 units | 6000 UTF-8 bytes | within Help's 5,000 characters but over the API's 5000 bytes exit=1 edge: 3000 Cyrillic letters: 3000 characters, 6000 bytes published: python3 check-yt.py --kind description description.txt run: python3 check-yt.py --kind description in/desc_5000.txt OK | item 1 | 5000 code points | 5000 UTF-16 units | 5000 UTF-8 bytes | under both limits exit=0 edge: exactly 5000 ASCII characters (boundary) published: python3 check-yt.py --kind description description.txt run: python3 check-yt.py --kind description in/desc_5001.txt OVER | item 1 | 5001 code points | 5001 UTF-16 units | 5001 UTF-8 bytes | more than 5,000 characters exit=1 edge: 5001 ASCII characters (one over) published: python3 check-yt.py --csv sheet.csv --column Title run: python3 check-yt.py --csv in/sheet.csv --column Title OK | item 1 | 42 code points | 42 UTF-16 units | 42 UTF-8 bytes | at most 100 by every count OVER | item 2 | 101 code points | 101 UTF-16 units | 101 UTF-8 bytes | more than 100 by every count OK | item 3 | 23 code points | 23 UTF-16 units | 23 UTF-8 bytes | at most 100 by every count CHECK | item 4 | 95 code points | 110 UTF-16 units | 140 UTF-8 bytes | fits by code points, over 100 by UTF-16 units exit=1 edge: a CSV saved by Excel with a UTF-8 BOM, a quoted comma and a line break inside a cell published: python3 check-yt.py --csv sheet.csv --column Title run: python3 check-yt.py --csv in/sheet.csv --column Headline error: column Headline not found exit=2 edge: a column name that is not in the file: exit 2 published: python3 check-yt.py --csv sheet.csv --column Description --kind description run: python3 check-yt.py --csv in/sheet.csv --column Description --kind description OK | item 1 | 31 code points | 31 UTF-16 units | 31 UTF-8 bytes | under both limits OK | item 2 | 1 code points | 1 UTF-16 units | 1 UTF-8 bytes | under both limits OK | item 3 | 1 code points | 1 UTF-16 units | 1 UTF-8 bytes | under both limits OK | item 4 | 1 code points | 1 UTF-16 units | 1 UTF-8 bytes | under both limits exit=0 edge: description column of the same sheet published: python3 check-yt.py titles.txt --keyword "zoom" run: python3 check-yt.py in/titles.txt --keyword "zoom" OK | item 1 | 42 code points | 42 UTF-16 units | 42 UTF-8 bytes | at most 100 by every count | keyword not found OVER | item 2 | 101 code points | 101 UTF-16 units | 101 UTF-8 bytes | more than 100 by every count | keyword starts at code point 6 OK | item 3 | 100 code points | 100 UTF-16 units | 100 UTF-8 bytes | at most 100 by every count | keyword starts at code point 6 CHECK | item 4 | 95 code points | 110 UTF-16 units | 140 UTF-8 bytes | fits by code points, over 100 by UTF-16 units | keyword not found FAIL | item 5 | 26 code points | 26 UTF-16 units | 26 UTF-8 bytes | contains < > (the Data API forbids < and >) | keyword not found OK | item 6 | 20 code points | 20 UTF-16 units | 56 UTF-8 bytes | at most 100 by every count | keyword not found exit=1 edge: titles without the key word report none published: python3 check-yt.py --kind description description.txt run: printf "" > in/empty_desc.txt; python3 check-yt.py --kind description in/empty_desc.txt error: nothing to check in in/empty_desc.txt exit=2 edge: an empty description file: exit 2, nothing to check published: python3 check-yt.py titles.txt run: printf "short title\r\n\r\n \r\nsecond\r\n" > in/blank.txt; python3 check-yt.py in/blank.txt OK | item 1 | 11 code points | 11 UTF-16 units | 11 UTF-8 bytes | at most 100 by every count OK | item 2 | 6 code points | 6 UTF-16 units | 6 UTF-8 bytes | at most 100 by every count exit=0 edge: CRLF file with a blank and a spaces-only line: both skipped, two items published: python3 check-yt.py titles.txt --keyword "zoom" run: printf "😀😀 zoom tips\n" > in/emoji_kw.txt; python3 check-yt.py in/emoji_kw.txt --keyword ZOOM OK | item 1 | 12 code points | 14 UTF-16 units | 18 UTF-8 bytes | at most 100 by every count | keyword starts at code point 4 exit=0 edge: keyword after two emoji: position 4 in code points (6 in UTF-16 units) published: python3 check-yt.py --kind description description.txt run: python3 -c "print(\"é\"*2500)" > in/d_nl.txt; python3 check-yt.py --kind description in/d_nl.txt API-OVER | item 1 | 2501 code points | 2501 UTF-16 units | 5001 UTF-8 bytes | within Help's 5,000 characters but over the API's 5000 bytes exit=1 edge: 2500 two-byte letters plus the final newline most editors add: 5001 bytes, API-OVER published: python3 check-yt.py --kind description description.txt run: python3 -c "import sys; sys.stdout.write(\"é\"*2500)" > in/d_nonl.txt; python3 check-yt.py --kind description in/d_nonl.txt OK | item 1 | 2500 code points | 2500 UTF-16 units | 5000 UTF-8 bytes | under both limits exit=0 edge: the same 2500 letters saved without a final newline: 5000 bytes, OK published: python3 check-yt.py titles.txt --keyword "zoom" run: printf "İstanbul zoom\n" > in/tr_kw.txt; python3 check-yt.py in/tr_kw.txt --keyword zoom OK | item 1 | 13 code points | 13 UTF-16 units | 14 UTF-8 bytes | at most 100 by every count | keyword starts at code point 10 exit=0 edge: a capital İ lower-cases to two code points, so the position is found on the original text: 10, not 11 published: python3 check-yt.py --kind description description.txt run: python3 -c "import sys; sys.stdout.write(\"\U0001F600\"*2600)" > in/d_emo2600.txt; python3 check-yt.py --kind description in/d_emo2600.txt CHECK | item 1 | 2600 code points | 5200 UTF-16 units | 10400 UTF-8 bytes | fits by code points, over 5,000 by UTF-16 units and over the API's 5000 bytes exit=1 edge: 2600 emoji: 2600 code points, 5200 UTF-16 units, 10400 bytes: CHECK, and the line also names the byte overflow published: python3 check-yt.py --kind description description.txt run: python3 -c "import sys; sys.stdout.write(\"\U0001F600\"*1300)" > in/d_emo1300.txt; python3 check-yt.py --kind description in/d_emo1300.txt API-OVER | item 1 | 1300 code points | 2600 UTF-16 units | 5200 UTF-8 bytes | within Help's 5,000 characters but over the API's 5000 bytes exit=1 edge: 1300 emoji: 1300 code points, 2600 UTF-16 units, 5200 bytes: API-OVER