Module pywikipedia.table2wiki
Nifty script to convert HTML-tables to Wikipedia's syntax.
-file:filename
will read any [[wikipedia link]] and use these articles
-sql:XYZ
reads a local SQL cur dump, available at http://download.wikimedia.org/.
Searches for pages with HTML tables, and tries to convert them on the live
wiki. Example:
python table2wiki.py -sql:20040711_cur_table.sql.sql -lang:de
SQL-Query
SELECT CONCAT('[[', cur_title, ']]')
FROM cur
WHERE (cur_text LIKE '%<table%'
OR cur_text LIKE '%<TABLE%')
AND cur_title REGEXP "^[A-N]"
AND cur_namespace=0
ORDER BY cur_title
LIMIT 500
FEATURES
Save against missing </td>
Corrects attributes of tags
KNOWN BUGS
Broken HTML-tables will most likely result in broken wiki-tables!
Please check every article you change.
- Imported modules:
-
pywikipedia.config
,
pywikipedia.pagegenerators
,
re
,
sys
,
time
,
pywikipedia.wikipedia
- Imported variables:
-
__version__
,
msg_multiple_warnings
,
msg_no_warnings
,
msg_one_warning