PubPart#

class dibisoplot.pubpart.Collaborations(entity_id: str, year: int | None = None, secondary_entity_id: str | list[str] | None = None, secondary_entity_filter_field: str | list[str] | None = None, **kwargs)#

Bases: PubPart

A generic class for fetching and plotting data about collaborations.

__init__(entity_id: str, year: int | None = None, secondary_entity_id: str | list[str] | None = None, secondary_entity_filter_field: str | list[str] | None = None, **kwargs)#

Initialize the TopicsPotentialCollaborations class.

Parameters:
  • entity_id (str) – The OpenAlex ID for the secondary entity.

  • year (int | none, optional) – The year for which to fetch data. If None, uses the current year.

  • secondary_entity_id (str | list[str] | None) – The OpenAlex ID for the secondary entity or entities to analyze the topics of collaborations. If a work is present in several entities, it is counted only once.

  • secondary_entity_filter_field (str | list[str] | None, optional) – The OpenAlex filter field for the secondary entity or entities. If None, use the same as for the main entity. If a single string is provided, it is used for all secondary entities.

  • kwargs – Additional keyword arguments.

fetch_collab_data()#

Fetch data for plots about collaborations.

class dibisoplot.pubpart.InstitutionsLineageCollaborations(entity_id: str, year: int | None = None, secondary_entity_id: str | list[str] | None = None, secondary_entity_filter_field: str | list[str] | None = None, **kwargs)#

Bases: Collaborations

A class to fetch and plot data about institutions in the lineage in co-publications.

fetch_data() dict[str, Any]#

Fetch data about institutions in the lineage from OpenAlex

Returns:

The info about the fetched data.

Return type:

dict[str, Any]

class dibisoplot.pubpart.PubInstitutions(entity_id: str, year: int | None = None, collaboration_type: list[str] = None, countries_to_include: list[str] = None, countries_to_exclude: list[str] = None, ignore_institutions_from_lineage: bool = True, institutions_to_ignore: list[str] = None, **kwargs)#

Bases: PubPart

A class to fetch and plot data about institutions in publications.

__init__(entity_id: str, year: int | None = None, collaboration_type: list[str] = None, countries_to_include: list[str] = None, countries_to_exclude: list[str] = None, ignore_institutions_from_lineage: bool = True, institutions_to_ignore: list[str] = None, **kwargs)#

Initialize the PubInstitutions class.

Parameters:
  • entity_id (str) – The OpenAlex ID for the secondary entity.

  • year (int | none, optional) – The year for which to fetch data. If None, uses the current year.

  • collaboration_type (list[str]) – Type of collaborations (from the ROR type controlled vocabulary). Default to None. If None, use all types of institutions.

  • countries_to_include (list[str] | None, optional) – List of country codes to include in the plot. Default to None. If not None, only collaborations from countries in this list will be included in the plot.

  • countries_to_exclude (list[str] | None, optional) – List of country codes to exclude from the plot. Default to None. If not None, countries from the list will be excluded from the plot.

  • ignore_institutions_from_lineage (bool) – Whether to ignore institutions from the lineage. Default to True.

  • institutions_to_ignore (list[str]) – List of institutions to not plot.

  • args – Additional positional arguments.

  • kwargs – Additional keyword arguments.

fetch_data() dict[str, Any]#

Fetch data about collaborations from OpenAlex

Returns:

The info about the fetched data.

Return type:

dict[str, Any]

class dibisoplot.pubpart.PubPart(entity_id, year: int | None = None, barcornerradius: int = 10, dynamic_height: bool = True, dynamic_min_height: int | float = 150, dynamic_height_per_bar: int | float = 25, entity_openalex_filter_field: str = 'authorships.institutions.id', height: int = 600, language: str = 'fr', legend_pos: dict = None, main_color: str = 'blue', margin: dict = None, max_entities: int | None = 1000, max_plotted_entities: int = 25, template: str = 'simple_white', text_position: str = 'outside', title: str | None = None, width: int = 800)#

Bases: Dibisoplot

Base class for generating plots and tables from data fetched from OpenAlex for the PubPart report (Publications and Partnerships report). The fetch methods are located in each child class. This class is not designed to be called directly but rather to provide general methods to the different plot types.

Variables:
  • default_margin – Default margins for plots.

  • orientation – Orientation for plots (‘h’ for horizontal).

__init__(entity_id, year: int | None = None, barcornerradius: int = 10, dynamic_height: bool = True, dynamic_min_height: int | float = 150, dynamic_height_per_bar: int | float = 25, entity_openalex_filter_field: str = 'authorships.institutions.id', height: int = 600, language: str = 'fr', legend_pos: dict = None, main_color: str = 'blue', margin: dict = None, max_entities: int | None = 1000, max_plotted_entities: int = 25, template: str = 'simple_white', text_position: str = 'outside', title: str | None = None, width: int = 800)#

Initialize the Biso class with the given parameters.

Parameters:
  • entity_id (str) – The OpenAlex ID for the secondary entity.

  • year (int | none, optional) – The year for which to fetch data. If None, uses the current year.

  • barcornerradius (int, optional) – Corner radius for bars in plots.

  • dynamic_height (bool, optional) – Whether to use dynamic height for the plot. Only implemented for horizontal bar plots.

  • dynamic_min_height (int | float, optional) – Minimum height for the plot when the height is set dynamically.

  • dynamic_height_per_bar (int | float, optional) – Height per bar for plots when the height is set dynamically.

  • entity_openalex_filter_field (str, optional) – Field to filter on in the OpenAlex API. Default to ‘authorships.institutions.id’. The list of possible values can be found in the OpenAlex documentation: https://docs.openalex.org/api-entities/works/filter-works

  • height (int, optional) – Height of the plot.

  • language (str, optional) – Language for the plot. Default to ‘fr’.

  • legend_pos (dict, optional) – Position of the legend.

  • main_color (str, optional) – Main color for the plot.

  • margin (dict, optional) – Margins for the plot.

  • max_entities (int | None, optional) – Default maximum number of entities used to create the plot. Default 1000. Set to None to disable the limit. This value limits the number of queried entities when doing analysis. For example, when creating the collaboration map, it limits the number of works to query from HAL to extract the collaborating institutions from.

  • max_plotted_entities (int, optional) – Maximum number of bars in the plot or rows in the table. Default to 25.

  • template (str, optional) – Template for the plot.

  • text_position (str, optional) – Position of the text on bars.

  • title (str | None, optional) – Title of the plot.

  • width (int, optional) – Width of the plot.

default_margin = {'b': 30, 'l': 30, 'pad': 4, 'r': 30, 't': 30}#
orientation = 'h'#
class dibisoplot.pubpart.PubTopics(entity_id, year: int | None = None, barcornerradius: int = 10, dynamic_height: bool = True, dynamic_min_height: int | float = 150, dynamic_height_per_bar: int | float = 25, entity_openalex_filter_field: str = 'authorships.institutions.id', height: int = 600, language: str = 'fr', legend_pos: dict = None, main_color: str = 'blue', margin: dict = None, max_entities: int | None = 1000, max_plotted_entities: int = 25, template: str = 'simple_white', text_position: str = 'outside', title: str | None = None, width: int = 800)#

Bases: PubPart

A class to fetch and plot data about openalex topics in publications.

fetch_data() dict[str, Any]#

Fetch data about topics from OpenAlex

Returns:

The info about the fetched data.

Return type:

dict[str, Any]

class dibisoplot.pubpart.TopicsCollaborations(entity_id: str, year: int | None = None, secondary_entity_id: str | list[str] | None = None, secondary_entity_filter_field: str | list[str] | None = None, **kwargs)#

Bases: Collaborations

A class to fetch and plot data about openalex topics of collaborations.

fetch_data() dict[str, Any]#

Fetch data about topics of collaborations from OpenAlex

Returns:

The info about the fetched data.

Return type:

dict[str, Any]

class dibisoplot.pubpart.TopicsPotentialCollaborations(entity_id: str, year: int | None = None, secondary_entity_id: str | list[str] | None = None, secondary_entity_filter_field: str | list[str] | None = None, **kwargs)#

Bases: Collaborations

A class to fetch and plot data about openalex topics of potential collaborations.

fetch_data() dict[str, Any]#

Fetch data about topics of collaborations from OpenAlex

Returns:

The info about the fetched data.

Return type:

dict[str, Any]

class dibisoplot.pubpart.WorksCollaborations(entity_id: str, year: int | None = None, metric: str = 'citation_normalized_percentile', **kwargs)#

Bases: Collaborations

A class to fetch and plot data about co-publications. By default, works are sorted by their citation_normalized_percentile value on OpenAlex, see documentation: https://docs.openalex.org/api-entities/works/work-object#citation_normalized_percentile Otherwise, it is possible to sort by the cited_by_count.

Variables:

default_margin – Default margins for plots.

__init__(entity_id: str, year: int | None = None, metric: str = 'citation_normalized_percentile', **kwargs)#

Initialize the WorksCollaborations class.

Parameters:
  • entity_id (str) – The OpenAlex ID for the secondary entity.

  • year (int | none, optional) – The year for which to fetch data. If None, uses the current year.

  • metric (str, optional) – The metric to use for sorting the works. Default to “citation_normalized_percentile”. Can be “cited_by_count” or “citation_normalized_percentile”.

  • kwargs – Additional keyword arguments.

default_margin = {'b': 30, 'l': 30, 'pad': 4, 'r': 45, 't': 30}#
fetch_data() dict[str, Any]#

Fetch data about co-publications from OpenAlex

Returns:

The info about the fetched data.

Return type:

dict[str, Any]