Package: wto
A Python library for querying the World Trade Organization's (WTO) API.For information pertaining to the WTO API, please visithttps://apiportal.wto.org/.Installation:This package requires the requests library. You can install the WTO package from PyPI:pip install wtoHow to use this packageUsers can call any of the package's 17 defined functions. Each function queries the WTOâ€™s API and retrieves data as a timestamped JSON or CSV file. The functions are:get_time_series_datapoints()collects individual data point along a time series.get_time_series_data_count()provides a summary data count of the query.get_time_series_metadata()generates a list of metadata for a particular query.get_topics()creates a list of topics grouping indicators.get_frequencies()generates a list of frequencies, for example monthly vs. annual.get_periods()generates a list of time periods per frequency, for example January or Q1.get_units()makes a document describing the unit of measurement in which data points are expressed. For example, USD or tariff duty percent.get_indicator_categories()generates a list for grouping indicators and contains subcategories.get_indicators()compiles a list of indicators.get_regions()creates a list of geographic regions.get_economic_groups()lists territories that are not geographical.get_reporting_economies()outputs a datafile of territories that report data to the WTO.get_partner_economies()outputs territories that trade with a territory.get_classifications()generates a list of product classifications.get_products()produces a list of goods and services that can be used for queries.get_years()creates a list of years for which datapoints are available.get_value_flags()predefined metadata for values, such as an estimation.get_json_data()queries the api with a specific url address for json files. Once retrieved, the file is saved as a json file.get_csv_data()retrieves a csv query from a specific address. Then saves the query as a csv file.Documentation for each of the functions:More information regarding each query can be found athttps://apiportal.wto.org/.Theget_time_series_datapoint()function is used to query the WTO's API to retrieve. The function has 16 arguments. Two arguments are mandatory. Thirteen arguments are optional.
The mandatory arguments areindicator_codeandkey.indicator_codepertains to the specific variable that you would like to query.keyis the user's API key.There are thirteen remaining keyword arguments that have default values that users can potentially alter. Currently,
some of these argument are functioning, however not all are. The author hopes to resolve these issues in the future.
Optional arguments include:reporting_economy,partner_economy,time_period,product_sector,product_sub_sector,frmt,output_mode,decimals,offset,max_records,heading_style,language(English 1, French 2, Spanish 3)proxiesallows users to specify a proxy if needed.2. The `get_time_series_data_count()` function returns the total number of data points. The function has 8 arguments.Two arguments are mandatory.
* `indicator_code` pertains to the specific variable that you would like to query. <br>
* `key` is the user's API key.

six are optional.
1. `reporting_economy`, 
2. `partner_economy`, 
3. `time_period`,
4. `product_sector`, 
5. `product_sub_sector`
6. `proxies` allows users to specify a proxy if needed.3. The `get_time_series_metadata()` function returns the query's metadata. The function has 9 arguments.Two arguments are mandatory.
- `indicator_code` pertains to the specific variable that you would like to query. <br>
- `key` is the user's API key.

Seven are optional.
1. `reporting_economy`, 
2. `partner_economy`, 
3. `time_period`,
4. `product_sector`, 
5. `product_sub_sector`,
6. `language` (the default selection is English - 1, French - 2, Spanish - 3)
7. `proxies` allows users to specify a proxy if needed.4. The `get_topics()` function generates topics grouping indicators. The function has 3 arguments.One argument is mandatory.
- `key` is the user's API key.

Two argument is optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies` allows users to specify a proxy if needed.5. The `get_frequencies()` function outputs a list of frequencies available. The function has 3 arguments.One argument is mandatory.
- `key` is the user's API key. 

one argument is optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3)6. The `get_periods()` outputs periods per frequency, January 2019 or H1 2019 for example. The function has 2 arguments.One argument is mandatory. 
- `key` is the user's API key.

Two arguments are optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies` allows users to specify a proxy if needed.7. The `get_units()` outputs measurements in which datapoints are expressed and magnitude, for example millions of USD. The function has 2 arguments.One argument is mandatory. 
- `key` is the user's API key.

Two arguments are optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies`8. The `get_indicator_categories()` function generates a list for grouping indicators and contains subcategories. The function has 3 arguments.One argument is mandatory.
- `key` is the user's API key. 

Two arguments are optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies`9. The `get_indicators()` function compiles a list of indicators. The functin has 8 arguments.One argument is mandatory.
- `key` is the user's API key.

Seven arguments are optional.
1. `indicator_code` pertains to the specific variable that you would like to query. default value is 'all' <br>
2. `name` is a specific country or region. default value is none, but users can specify a string.
3. `topics` 
4. `product_classification`
5. `trade_partner`
6. `frequency`
7. `language`
8. `proxies`10. The `get_regions()` function creates a list of geographic regions. The function has 3 arguments.One argument is mandatory.
- `key` is the user's API key.

Two arguments are optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies`11. The `get_economic_groups()` lists territories that are not geographical. The function has 3 arguments.One argument is mandatory.
- `key` is the user's API key.

Two arguments are optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies`12. The `get_reporting_economies()` function outputs a datafile of territories that report data to the WTO. The function has 7 arguments.One argument is mandatory.
- `key` is the user's API key.

Six arguments are optional.
1. `name` is a specific reporting country or region. default value is none, but users can specify a string.
2. `economy` refers to the specific country or group of countries. Default value is 'all'
3. `region' 
4. `group`
5. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
6. `proxies`13. The `get_partner_economies()` outputs territories that trade with a particular territory. The function has 7 arguments.One argument is mandatory.<br>
- `key` is the user's API key. <br>
Six arguments are optional.
1. `name` is a specific reporting country or region. default value is none, but users can specify a string.
2. `economy` refers to the specific country or group of countries. Default value is 'all'
3. `region' 
4. `group`
5. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
6. `proxies`14. The `get_classifications()`generates a list of product classifications. The function has 3 arguments.One argument is mandatory. <br>
- `key` is the user's API key.

Two arguments are optional.
1. `language` (the default selection is English - 1, French - 2, Spanish - 3) <br>
2. `proxies`15. The `get_products()` function produces a list of goods and services that can be used for queries. The function has 5 arguments.One argument is mandatory.<br>
- `key` is the user's API key.

Four arguments are optional:
1. `name`
2. `product_classification` default value is 'all'
3. `language`
4. `proxies`16. The `get_years()` function creates a list of years for which datapoints are available. The function has 2 arguments.One argument is mandatory.<br>
- `key` is the user's API key.

One argument is optional:
1. `proxies`17. The `get_value_flags()` function creates a predefined metadata for values, such as an estimation.The function has 3 arguments.One argument is mandatory. 
- `key` is the user's API key. <br>

Two arguments are optional:
1. `language`
2. `proxies`18. `get_json_data()` queries the API for a specific url and saves the results as a json data file. The function accepts two arguments.
    1. `url`: which is the exact url to retrieve.
    2. `proxies`19. `get_csv_data()` queries the API for a specific url and saves the results as an uncompressed csv data file. The function accepts two arguments.
    1. `url`: which is the exact url to retrieve.
    2. `proxies`