This page was moved from MetaWiki.
It probably requires cleanup – please feel free to help out. In addition, some links on the page may be red; respective pages might be found at Meta. Remove this template once cleanup is complete.
Pagefromfile.py is part of the Pywikipedia bot framework.
With this script you can create pages from a textfile.
The file should be in UTF-8 and if you want to create multiple pages from a file you should separate the articles as specified by the -start and -end arguments.
The pagename will be the first headword in your textfile (the first word between ''' '''). It is currently automatically inserted in the uploaded page.
WARNING: the script parses the input text in a recursive way, so it can easily run out of memory if the text contains several pages. It is advisable to break the input text into single pages and upload them individually.
Specify the text that is the beginning of a page
Specify the text that is the end of a page
Give the filename we are getting our material from
The beginning and end text should be included in the page.
do not include
Do not include the title line in the page.
include title line
Use xxx in place of ''' for identifying the beginning of the page title
Use xxx in place of ''' for identifying the end of the page title
Use xxx as the summary for the upload.
(a translation of) "Automated import of articles"
Use mediawiki default summary
Set minor edit flag on page edits.
Do not really upload pages, just check and report messages.
If the page to be uploaded already exists, do nothing, i.e. skip it.
If the page to be uploaded already exists, add the text to the top of it.
If the page to be uploaded already exists, add the text to the bottom of it.
If the page to be uploaded already exists, overwrite the existing page.
Make the program output more detailed messages than usual to the standard output about its current work, or progress, while it is proceeding. This may be helpful when debugging or dealing with unusual situations.