Jump to content

Module:EUPP seats/doc

From Wikipedia, the free encyclopedia


Description

[edit]

This module provides:

  • the number or share of seats occupied by European political parties in various European institutions (function main), as well as across lower and upper houses in EU member states, used by Template:EUPP seats;
  • composition bars displaying the number of seats of a European political party in a given institution (function composition_bar), as well as across lower and upper houses in EU member states, used by Template:EUPP composition bar; and
  • composition bars displaying the number of seats of a national political party member of a European political party in its member state's lower and upper houses or in the European Parliament (function national_party_composition_bar), used by Template:EUPP national party.

Data is obtained from Wikidata.

EU-level institutions covered are the European Parliament, the European Commission, the European Council, and the European Committee of the Regions.

Parties covered are all European political parties, meaning those duly registered with the Authority for European Political Parties and European Political Foundations, as well as some European political alliances.

The module seeks to replace and improve upon:

The module has two testcase pages:

Usage

[edit]

Acronyms

[edit]

The following acronyms are used for institutions:

  • European Parliament: EP
  • European Commission: EC
  • European Council: EUCO
  • European Committee of the Regions: COR
  • Lower houses in EU member states: ms-lower-house (alternatively, "lower-house" and "lower" also work)
  • Upper houses in EU member states: ms-upper-house (alternatively, "upper-house" and "upper" also work)

The following acronyms are used for European parties:

In addition, the following European political alliances are covered:

In addition, four special parameters can be used instead of parties:

  • all: for the seats of all European parties combined;
  • none: for the seats not occupied by members of European parties (not for lower and upper houses);
  • ind: for independent politicians on the European Council (only); and
  • thisparty: to be used instead of a specific party name when the module is called from the page of a European political party.

In order to return the share of seats instead of their number, "%" or "share" must be added as a third parameter.

Notes:

  • the capitalisation of parameters does not matter;
  • given the cost of calling Wikidata when using a specific eID (i.e., not calling Wikidata from a linked Wikipedia page), the special parameter "thisparty" should be used whenever this module is called from the page of a European party; and
  • since the listed European political alliances are not European political parties, they do not count towards to sum of seats occupied by European political parties, nor the seats not occupied by European political parties.

Function main

[edit]

Structure

[edit]

The structure of the function is as follows:

{{#invoke:EUPP seats|main|<institution>|<party or special parameter>|<share>}}
  • the first argument is mandatory is must be a recognised institution from the list above;
  • the second argument is optional and can be a recognised European party or a special parameter from the list above; and
  • the third argument is option and returns the share, instead of the absolute number.

Calls are structured as follows:

Code Output
{{#invoke:EUPP seats|main|institution}} total number of seats of the institution given in argument
{{#invoke:EUPP seats|main|institution|party}} number of seats of the European party in the institution given in argument
{{#invoke:EUPP seats|main|institution|all}} number of seats of all European parties in the institution given in argument
{{#invoke:EUPP seats|main|institution|none}} number of seats not occupied by European parties in the institution given in argument
{{#invoke:EUPP seats|main|EUCO|ind}} number of independent politicians in the European Council (only applicable to the European Council)
{{#invoke:EUPP seats|main|institution|thisparty}} number of seats of the European party from which page the module is called in the institution given in argument
{{#invoke:EUPP seats|main|institution|party|%}} share of seats of the European party in the institution given in argument -- this works mutatis mutandis with the four special parameters

Note: "%" and "share" can be used interchangeably.

Examples

[edit]
Code Result Output
{{#invoke:EUPP seats|main|EP}} 720 total number of seats of the European Parliament
{{#invoke:EUPP seats|main|EC|EPP}} 11 number of seats of the EPP in the European Commission
{{#invoke:EUPP seats|main|EUCO|PES|%}} 14.81 share of seats of the PES in the European Council
{{#invoke:EUPP seats|main|EP|all}} 635 total number of seats occupied by European parties in the European Parliament
{{#invoke:EUPP seats|main|EC|all|share}} 77.78 total share of seats occupied by European parties in the European Commission
{{#invoke:EUPP seats|main|COR|none}} 28 number of seats not occupied by European parties in the European Committee of the Regions
{{#invoke:EUPP seats|main|COR|none|%}} 8.51 share of seats not occupied by European parties in the European Committee of the Regions
{{#invoke:EUPP seats|main|EUCO|IND}} 4 number of seats occupied by independent Heads of State or Government in the European Council
{{#invoke:EUPP seats|main|ms-lower-house|ALDE}} 411 number of seats occupied by national member parties of ALDE in lower houses of EU member states
{{#invoke:EUPP seats|main|EP|thisparty}} Error: {{EUPP seats}}: not called from the page of a European party (help) number of seats occupied by in the European Parliament by the European party from which page the module is called (here, the module adequately gives out an error message)

Function composition_bar

[edit]

Additional parameters

[edit]

For this function, the module allows for additional parameters:

  • width: the size of the composition bar;
  • percent: option to display the percentage;
  • reference: option to display a trailing reference from Wikidata;
  • bar-color: option to override the default colour (either the official colour of the European party, or grey for all, none, and ind);
  • background-color: colour of the background of the composition bar; and
  • border: colour of the border of the composition bar.

Structure

[edit]

The structure of the call is as follows:

{{#invoke:EUPP seats|composition_bar|<institution>|<party>|width=<width>|percent=yes|reference=yes|bar-color=<color>|background-color=<color>|border=<color>}}
  • the first argument is mandatory and must always be an institution, as listed above;
  • the second argument is mandatory and must always be a European party or special parameter, as listed above; and
  • the remaining arguments are optional, have no specific order, and are referred to using their name:
    • width can have the following formats: "80" (default unit is pixel), "80px", "80em", or "80%" (without spaces);
    • percent will display the percentage for "yes" (regardless of capitalisation), and ignore all other values;
    • reference will display the reference for "yes" (regardless of capitalisation), and ignore all other values; and
    • bar-color, background-color, and border will override default colours when provided an hexadecimal value (e.g."#123ABC", including the pound sign) or a recognised colour (e.g. "red").
Code Output
{{#invoke:EUPP seats|composition_bar|institution}} composition bar of total number of seats of the institution given in argument
{{#invoke:EUPP seats|composition_bar|institution|party}} composition bar of the seats of a European party in the institution given in argument
{{#invoke:EUPP seats|composition_bar|institution|all}} composition bar of the seats of all European parties in the institution given in argument
{{#invoke:EUPP seats|composition_bar|institution|none}} composition bar of the seats not occupied by European parties in the institution given in argument
{{#invoke:EUPP seats|composition_bar|EUCO|ind}} composition bar of the seats of independent politicians in the European Council (only applicable to the European Council)
{{#invoke:EUPP seats|composition_bar|institution|thisparty}} composition bar of the seats of the European party from which page the module is called in the institution given in argument

Examples

[edit]
Code Result Output
{{#invoke:EUPP seats|composition_bar|EC|EPP}}
11 / 27
composition bar for the number of seats of the EPP in the European Commission
{{#invoke:EUPP seats|composition_bar|EP|all}}
635 / 720
composition bar for the total number of seats occupied by European parties in the European Parliament
{{#invoke:EUPP seats|composition_bar|COR|none}}
28 / 329
composition bar for the number of seats not occupied by European parties in the European Committee of the Regions
{{#invoke:EUPP seats|composition_bar|EUCO|IND}}
4 / 27
composition bar for the number of seats occupied by independent Heads of State or Government in the European Council
{{#invoke:EUPP seats|composition_bar|ms-lower-house|ALDE}}
411 / 6,318
composition bar for the number of seats occupied by national member parties of ALDE in lower houses of EU member states
{{#invoke:EUPP seats|composition_bar|EC|EPP|width=50%}}
11 / 27
composition bar with a size of 50%
{{#invoke:EUPP seats|composition_bar|EP|PES|width=50%|percent=yes}}
136 / 720 (19%)
composition bar with display of the share
{{#invoke:EUPP seats|composition_bar|EP|EPP|width=4em|percent=yes|reference=yes}}
182 / 720 (25%)
[1]
composition bar with display of the reference
{{#invoke:EUPP seats|composition_bar|EP|EPP|bar-colour=red}}
182 / 720
composition bar with overriding bar colour
{{#invoke:EUPP seats|composition_bar|EP|EPP|background-color=#334477}}
182 / 720
composition bar with background colour
{{#invoke:EUPP seats|composition_bar|EP|EPP|background-color=#334477|border=green}}
182 / 720
composition bar with background colour and border
{{#invoke:EUPP seats|composition_bar|EC|thisparty}} Error: {{EUPP composition bar}}: not called from the page of a European party (help) composition bar for the number of seats occupied by in the European Parliament by the European party from which page the module is called (here, the module adequately gives out an error message)

Function national_party_composition_bar

[edit]

Additional parameters

[edit]

This function uses the same parameters as the previous one:

  • width: the size of the composition bar;
  • percent: option to display the percentage;
  • reference: option to display a trailing reference from Wikidata;
  • bar-color: option to override the default colour (either the official colour of the European party, or grey for all, none, and ind);
  • background-color: colour of the background of the composition bar; and
  • border: colour of the border of the composition bar.

In addition, constituency gives the possibility to override the number of seats of the lower or upper house, which can be used when the composition bar aims at reflecting a subset of seats (for instance, when a party is active in a specific constituency).

Structure

[edit]

The structure of the call is as follows:

{{#invoke:EUPP seats|national_party_composition_bar|<institution>|constituency=<constituency>|width=<width>|percent=yes|reference=yes|bar-color=<color>|background-color=<color>|border=<color>}}
  • the first argument is mandatory and can be "ms-lower-house", "ms-upper-house", or "EP";
  • the second argument is optional and must be a number;
  • the remaining arguments are optional, have no specific order, and are referred to using their name:
    • width can have the following formats: "80" (default unit is pixel), "80px", "80em", or "80%" (without spaces);
    • percent will display the percentage for "yes" (regardless of capitalisation), and ignore all other values;
    • reference will display the reference for "yes" (regardless of capitalisation), and ignore all other values; and
    • bar-color, background-color, and border will override default colours when provided an hexadecimal value (e.g."#123ABC", including the pound sign) or a recognised colour (e.g. "red").

Note that the function must be called from the page of the party in question, so as to get this party's qID.

Code Output
{{#invoke:EUPP seats|national_party_composition_bar|ms-lower-house}} composition bar of the number of seats of a political party in its lower house
{{#invoke:EUPP seats|national_party_composition_bar|ms-upper-house|constituency=80}} composition bar of the number of seats of a political party in its upper house, with an overriding constituency size

Examples

[edit]

This function is exclusively called from the page of the political party in question.

Code Result Output
{{#invoke:EUPP seats|national_party_composition_bar|ms-lower-house}} Error: {{EUPP national party}}: not called from the page of a member party of a European political party, see https://www.wikidata.org/wiki/$1 (help) composition bar of the number of seats of a political party in its lower house (here, the module adequately gives out an error message)
  1. ^ "European People's Party". Authority for European Political Parties and European Political Foundations. Retrieved 4 November 2024.