The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::Scraper::Wikipedia::ISO3166::Database::Export - Export www.scraper.wikipedia.iso3166.sqlite as CSV and HTML

Synopsis

See "Synopsis" in WWW::Scraper::Wikipedia::ISO3166.

Description

Documents the methods end-users need to export the SQLite database, www.scraper.wikipedia.iso3166.sqlite, which ships with this distro, as either CSV or HTML.

See scripts/export.as.csv.pl and scripts/export.as.html.pl.

The input to these scripts is shipped as share/www.scraper.wikipedia.iso3166.sqlite.

The output of these scripts is shipped as:

o data/countries.csv
o data/iso.3166-2.html

This file is on-line at: http://savage.net.au/Perl-modules/html/WWW/Scraper/Wikipedia/ISO3166/iso.3166-2.html.

o data/subcountries.csv
o data/subcountry_categories.csv
o data/subcountry_info.csv

This data comes from the 3rd column of the country table at https://en.wikipedia.org/wiki/ISO_3166-2.

Distributions

This module is available as a Unix-style distro (*.tgz).

See http://savage.net.au/Perl-modules.html for details.

See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing.

Constructor and initialization

new(...) returns an object of type WWW::Scraper::Wikipedia::ISO3166::Database::Export.

This is the class's contructor.

Usage: WWW::Scraper::Wikipedia::ISO3166::Database::Export -> new().

This method takes a hash of options.

Call new() as new(option_1 => value_1, option_2 => value_2, ...).

Available options (these are also methods):

o countries_file => $a_csv_file_name

Specify the name of the CSV file to which country data is exported.

Default: 'countries.csv'.

o subcountries_file => $a_csv_file_name

Specify the name of the CSV file to which subcountry data is exported.

Default: 'subcountries.csv'.

o subcountry_categories_file => $a_csv_file_name

Specify the name of the CSV file to which subcountry category data is exported.

Default: 'subcountry_categories.csv'.

o subcountry_info_file => $a_csv_file_name

Specify the name of the CSV file to which subcountry info data is exported.

Default: 'subcountry_info.csv'.

o web_page_file => $a_html_file_name

Specify the name of the HTML file to which country and subcountry data is exported.

See htdocs/assets/templates/www/scraper/wikipedia/iso3166/iso3166.report.tx for the web page template used.

*.tx files are processed with Text::Xslate.

Default: 'iso.3166-2.html'.

Methods

This module is a sub-class of WWW::Scraper::Wikipedia::ISO3166::Database and consequently inherits its methods.

as_csv()

Export the SQLite database to 2 CSV files.

as_html()

Export the SQLite database to 1 HTML file.

countries_file($file_name)

Get or set the name of the CSV file to which country data is exported.

countries_file is an option to "new()".

new()

See "Constructor and initialization".

subcountries_file($file_name)

Get or set the name of the CSV file to which subcountry data is exported.

subcountries_file is an option to "new()".

subcountry_categories_file($file_name)

Get or set the name of the CSV file to which subcountry category data is exported.

subcountry_info_file is an option to "new()".

subcountry_info_file($file_name)

Get or set the name of the CSV file to which subcountry info data is exported.

subcountry_info_file is an option to "new()".

web_page_file($file_name)

Get or set the name of the HTML file to which country and subcountry data is exported.

web_page_file is an option to "new()".

FAQ

For the database schema, etc, see "FAQ" in WWW::Scraper::Wikipedia::ISO3166.

References

See "References" in WWW::Scraper::Wikipedia::ISO3166.

Support

Email the author, or log a bug on RT:

https://rt.cpan.org/Public/Dist/Display.html?Name=WWW::Scraper::Wikipedia::ISO3166.

Author

WWW::Scraper::Wikipedia::ISO3166 was written by Ron Savage <ron@savage.net.au> in 2012.

Home page: http://savage.net.au/index.html.

Copyright

Australian copyright (c) 2012 Ron Savage.

        All Programs of mine are 'OSI Certified Open Source Software';
        you can redistribute them and/or modify them under the terms of
        The Artistic License, a copy of which is available at:
        http://www.opensource.org/licenses/index.html