Reference
Data
- class openalex_analysis.data.entities_data.AnalysisConfig
Bases:
dict
OpenAlex Analysis configuration class. This class contains the settings used by openalex-analysis (some settings are passed to pyalex).
Tu use it, import the class and set the parameters as follows:
from openalex_analysis.plot import config config.n_max_entities = 10000
email (str) - Your Email for the OpenAlex API. Allows you to use the polite pool (see OpenAlex documentation). The default value is None (not using the polite pool).
api_key (str) - Your OpenAlex API key, if you have one. The default value is None.
openalex_url (str) - OpenAlex API URL or your self-hosted API URL. The default value is “https://api.openalex.org”.
http_retry_times (int) - maximum number of retries when querying the OpenAlex API in HTTP. The default value is 3.
disable_tqdm_loading_bar (bool) - To disable the tqdm loading bar. The default is False.
n_max_entities (int) - Maximum number of entities to download (the default value is to download maximum 10 000 entities). If set to None, no limitation will be applied.
project_data_folder_path (str) - Path to the folder containing the data downloaded from the OpenAlex API (these data are stored in compressed parquet files and used as a cache). The default path is “~/openalex-analysis/data”.
parquet_compression (str) - Type of compression for the parquet files used as cache (see the Pandas documentation). The default value is “brotli”.
max_storage_percent (int) - When the disk capacity reaches this percentage, cached parquet files will be deleted. The default value is 95.
max_storage_files (int) - When the cache folder reaches this number of files, cached parquet files will be deleted. The default value is 10000.
max_storage_size (int) - When the cache folder reached this size (in bytes), cached parquet files will be deleted. The default value is 5e9 (5 GB).
min_storage_files (int) - Before deleting files, we check if we exceed the minimum number of files and folder size. If one of those minimum if exceeded, we allow the program to delete cached parquet files. This is to avoid the setting max_storage_percent to delete every cached file when the disk is almost full. The default value is 1000.
min_storage_size (int) - Before deleting files, we check if we exceed the minimum number of files and folder size. If one of those minimum if exceeded, we allow the program to delete cached parquet files. This is to avoid the setting max_storage_percent to delete every cached file when the disk is almost full. The default value is 5e8 (500 MB).
cache_max_age (int) - Maximum age of the cache in days. The default value is 365.
log_level (str) - The log detail level for openalex-analysis (library specific). The log_level must be ‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’ or ‘CRITICAL’. The default value ‘WARNING’.
- class openalex_analysis.data.entities_data.AuthorsData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Authors
This class contains specific methods for Authors entity data. Not used for now.
- EntityOpenAlex
alias of
Authors
- class openalex_analysis.data.entities_data.ConceptsData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Concepts
This class contains specific methods for Concepts entity data. Not used for now.
- EntityOpenAlex
alias of
Concepts
- class openalex_analysis.data.entities_data.EntitiesData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
object
This class contains methods to download data from the OpenAlex API and manage + cache those datasets locally
- __init__(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
- Parameters:
entity_from_id (str | None) – The entity identifier (e.g. an institution id) from which to take the entities (e.g. the works of this institution) to analyze. If not provided, the default value is None and the entities will be downloaded based on the extra_filters value.
extra_filters (dict | None) – Optional filters, refer to the documentation of openalex and pyalex for the format. The default value is None.
entities_from_id_list (list[str] | None) – Similar to entity_from_id but to explicitly specify the ids of the entities to query. When specified, entity_from_id and extra_filters must be None. For now, only DOIs are supported.
database_file_path (str | None) – The database file (parquet or csv) path to force the analysis over datas in a specific file. The default value is None to use the data from the OpenAlex API or the cached data.
create_dataframe (bool) – Create the dataframe at the initialisation (and download the data if allowed and entity_from_id or extra_filters is provided). The default value is True.
load_only_columns (str | None) – Load only the specified columns from the parquet file. Everything will be downloaded anyway. The default value is None.
- auto_remove_databases_saved()
Remove databases files (the cached data downloaded from OpenAlex) if the storage is full, if there are too many files or if the cache uses too much space. It keeps the last accessed files with a minimum of files number, and folder size.
- convert_entities_list_to_df(entities_list: list) DataFrame
Converts a list of entities (a list of PyAlex objects) downloaded from the OpenAlex API into a dataframe.
- Parameters:
entities_list – The list of entities (PyAlex objects).
entities_list – list
- Returns:
The entities in a DataFrame.
- Return type:
pd.DataFrame
- download_list_entities()
Downloads the entities which match the parameters of the instance, and store the dataset as a parquet file .
- filter_and_format_entity_data_from_api_response(entity: dict)
Filter and format the data downloaded from the API. This is a placeholder as not all entity types have this function defined.
- get_api_query() dict
Gets the api query from the parameters of the instance.
- Returns:
The api query
- Return type:
dict
- get_count_entities_matched(query_filters: dict) int
Gets and return the number of entities which match the query filters.
- Parameters:
query_filters (dict) – The query filters.
- Returns:
The entities count matched.
- Return type:
int
- get_database_file_name(db_format: str = 'parquet') str
Gets the database file name according to the parameters of the instance.
- Parameters:
db_format (str) – The database file format. The default is “parquet”.
- Returns:
The database file name
- Return type:
str
- get_entity_type_from_id(entity: str | None = None) BaseOpenAlex
Gets the entity type from the entity id string.
- Parameters:
entity (str | None) – The entity id. If nothing is provided, the instance entity id will be used. Default is None.
- Returns:
The entity type
- Return type:
pyalex.api.BaseOpenAlex
- get_entity_type_string_name(entity: BaseOpenAlex | None = None) str
Gets the entity type in the format of a string.
- Parameters:
entity (pyalex.api.BaseOpenAlex | None) – The entity type. If nothing is provided, the instance entity type will be used. Default is None.
- Returns:
The entity type name in a string
- Return type:
str
- get_info_about_entity(entity: str | None = None, infos: list[str] | None = None, return_as_pd_series: bool = True) dict | Series
Get information about the entity (eg. name, publication_date…). If no entity is provided, the entity_from_id will be used.
- Parameters:
entity (str | None) – The entity id, if not provided, use the one from the instance. Default is None.
infos (list[str] | None) – The information fields to get. Default is None, which will get [“display_name”].
return_as_pd_series (bool) – True to return the results as a Pandas Series. Otherwise, a dictionary is returned. Default is True.
- Returns:
- Return type:
- get_multiple_entities_from_id(ids: list[str], ordered: bool = True, return_dataframe: bool = True) DataFrame | list
Get multiple entities from their OpenAlex IDs by querying them to the OpenAlex API 100 by 100.
- Parameters:
ids (list[str]) – the list of OpenAlex IDs to query
ordered (bool) – keep the order of the input list in the output list. Default is True.
return_dataframe (bool) – Return a Dataframe. If True, the DataFrame returned will also be stored in self.entities_df and the cache system will be used. If False, a list will be returned. Default is True.
- Returns:
the list of entities as pyalex objects (dictionaries) or DataFrame.
- Return type:
pd.DataFrame | list
- get_name_of_entity(entity: str | None = None) str
Gets the name of entity from its id.
- Parameters:
entity (str) – The entity id, if not provided, use the one from the instance. Default is None.
- Returns:
The name of the entity.
- Return type:
str
- load_entities_dataframe()
Loads an entities’ dataset from a file (or download it if needed and allowed by the instance) to the dataframe of the instance.
- class openalex_analysis.data.entities_data.InstitutionsData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Institutions
This class contains specific methods for Institutions entity data. Not used for now.
- EntityOpenAlex
alias of
Institutions
- class openalex_analysis.data.entities_data.PublishersData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Publishers
This class contains specific methods for Publishers entity data. Not used for now.
- EntityOpenAlex
alias of
Publishers
- class openalex_analysis.data.entities_data.SourcesData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Sources
This class contains specific methods for Sources entity data. Not used for now.
- EntityOpenAlex
alias of
Sources
- class openalex_analysis.data.entities_data.TopicsData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Topics
This class contains specific methods for Topics entity data. Not used for now.
- EntityOpenAlex
alias of
Topics
- class openalex_analysis.data.entities_data.WorksData(entity_from_id: str | None = None, extra_filters: dict | None = None, entities_from_id_list: list[str] | None = None, database_file_path: str | None = None, create_dataframe: bool = True, load_only_columns: list[str] | None = None)
Bases:
EntitiesData
,Works
This class contains specific methods for Works entity data.
- EntityOpenAlex
alias of
Works
- add_authorships_citation_style()
Add the author_citation_style column to the DataFrame entities_df
- filter_and_format_entity_data_from_api_response(entity: dict)
Filter and format the works data downloaded from the API. :param entity: The works data from the API. :type entity: dict :return: The works datas. :rtype: dict
- get_multiple_works_from_doi(dois: list[str], ordered: bool = True, return_dataframe: bool = True) DataFrame | list
Get multiple works from their DOI by querying them to the OpenAlex API 60 by 60.
- Parameters:
dois (list[str]) – the list of DOIs to query
ordered (bool) – keep the order of the input list in the output list. Default is True.
return_dataframe (bool) – Return a Dataframe. If True, the DataFrame returned will also be stored in self.entities_df and the cache system will be used. If False, a list will be returned. Default is True.
- Returns:
the list of works as pyalex objects (dictionaries) or DataFrame.
- Return type:
pd.DataFrame | list
- openalex_analysis.data.entities_data.check_if_entity_exists(entity: str) bool
Check if the entity exists. TODO: check status code for existence of entity as other errors can occur.
- Parameters:
entity (str) – The entity id.
- Returns:
True if the entity exists.
- Return type:
bool
- openalex_analysis.data.entities_data.extract_authorships_citation_style(authorships: dict) str
Create a string to cite the authors from an authorships dictionary.
- Parameters:
authorships (dict) – The authorships dictionary.
- Returns:
The citation string.
- Return type:
str
- openalex_analysis.data.entities_data.get_entity_type_from_id(entity: str) BaseOpenAlex
Gets the entity type from the entity id string.
- Parameters:
entity (str | None) – The entity id, if not provided, use the one from the instance. Default is None.
- Returns:
The entity type
- Return type:
pyalex.api.BaseOpenAlex
- openalex_analysis.data.entities_data.get_info_about_entity(entity: str, infos: list[str] | None = None, return_as_pd_series: bool = True) str | Series
- Parameters:
entity (str) – The entity id.
infos (list[str] | None) – The information to get (see OpenAlex API documentation). You can also request “author_citation_style” to get a citation string for the authors. The default is None, which will get [“display_name”].
return_as_pd_series (bool) – True to return the results as a Pandas Series. Otherwise, a dictionary is returned. Default is True.
- Returns:
The entity information.
- Return type:
str | pd.Series
- openalex_analysis.data.entities_data.get_name_of_entity(entity: str) str
Gets the name of the entity from the api.
- Parameters:
entity (str) – The entity id.
- Returns:
The name of the entity.
- Return type:
str
- openalex_analysis.data.entities_data.load_config_from_file(config_path: str)
Load and set the configration of the library from a .toml file. If the file doesn’t exist, a warning is raised. If a value isn’t specified in the configuration file, the default value is used (see set_default_config()). When the library is imported, if a configuration file exists at “~/openalex-analysis/openalex-analysis-conf.toml”, it is automatically loaded.
- Parameters:
config_path (str) – The path of the configuration file.
- openalex_analysis.data.entities_data.set_default_config()
Set the default configuration of the library. This function is called is no configuration file is found.
Analysis
- class openalex_analysis.analysis.entities_analysis.AuthorsAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,AuthorsData
This class contains specific methods for Authors entity analysis. Not used for now.
- class openalex_analysis.analysis.entities_analysis.ConceptsAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,ConceptsData
This class contains specific methods for Concepts entity analysis. Not used for now.
- class openalex_analysis.analysis.entities_analysis.EntitiesAnalysis(*args, **kwargs)
Bases:
EntitiesData
This class contains generic methods to analyse entities.
- __init__(*args, **kwargs)
- Parameters:
entity_from_id (str | None) – The entity identifier (e.g. an institution id) from which to take the entities (e.g. the works of this institution) to analyze. If not provided, the default value is None and the entities will be downloaded based on the extra_filters value.
extra_filters (dict | None) – Optional filters, refer to the documentation of openalex and pyalex for the format. The default value is None.
entities_from_id_list (list[str] | None) – Similar to entity_from_id but to explicitly specify the ids of the entities to query. When specified, entity_from_id and extra_filters must be None. For now, only DOIs are supported.
database_file_path (str | None) – The database file (parquet or csv) path to force the analysis over datas in a specific file. The default value is None to use the data from the OpenAlex API or the cached data.
create_dataframe (bool) – Create the dataframe at the initialisation (and download the data if allowed and entity_from_id or extra_filters is provided). The default value is True.
load_only_columns (str | None) – Load only the specified columns from the parquet file. Everything will be downloaded anyway. The default value is None.
- get_collaborations_with_institutions(entities_from: list[str] | None = None, institutions_to_exclude: dict[str, list[str]] | None = None, year: int | str | None = None, extra_filters_for_entities_from: dict | None = None) DataFrame
Create the collaborations_with_institutions_df DataFrame.
- Parameters:
entities_from (list[str]) – The list of entities to use to count the collaborations. If None, the entity_from_id is used.
institutions_to_exclude (dict[str, list[str]]) – For each entities_from (key), the list of institutions (value) to exclude when counting the collaborations. For example, it is usefull to exclude the parent institution.
year (int | str | None) – The years for which to look for the collaborations. Can be an integer or a string. You can provide a range of years as a string (e.g. “2020-2023”)
extra_filters_for_entities_from (dict | None) – Filters to be used when downloading the datasets of works to extract the collaboration. If you want to use {‘publication_year’:2023}, you should use the year parameter and not provide extra_filters_for_entities_from. The extra filter won’t be used to generate the links on the plot to check the collaboration works
- Returns:
The collaborations_with_institutions_df DataFrame
- Return type:
pd.DataFrame
- class openalex_analysis.analysis.entities_analysis.InstitutionsAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,InstitutionsData
This class contains specific methods for Institutions entity analysis. Not used for now.
- class openalex_analysis.analysis.entities_analysis.PublishersAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,PublishersData
This class contains specific methods for Publishers entity analysis. Not used for now.
- class openalex_analysis.analysis.entities_analysis.SourcesAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,SourcesData
This class contains specific methods for Sources entity analysis. Not used for now.
- class openalex_analysis.analysis.entities_analysis.TopicsAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,TopicsData
This class contains specific methods for Topics entity analysis. Not used for now.
- class openalex_analysis.analysis.entities_analysis.WorksAnalysis(*args, **kwargs)
Bases:
EntitiesAnalysis
,WorksData
This class contains specific methods for Works entity analysis.
- add_statistics_to_element_count_array(sort_by: str = 'h_used_all_l_use_main', sort_by_ascending: bool = False)
Adds a statistics to the element count array (statistics between the main entity to compare (second column in the dataframe) and the sum of the other entities). Note: This function is still experimental and might change in future versions.
- Parameters:
sort_by (str) – The key to sort the dataframe. The default value is ‘h_used_all_l_use_main’.
sort_by_ascending (bool) – Whenever to sort the dataframe ascending. The default value is False.
- count_yearly_entity_usage(entity: str, count_years: list[int]) list[int]
Counts the yearly number of time the entity is used in entities_df.
- Parameters:
entity (str) – The entity (id) to count.
count_years (list[int]) – The years for which we need to count the entity.
- Returns:
The number of time the entity is used on a yearly basis.
- Return type:
list[int]
- count_yearly_works(count_years: list[int]) list[int]
Return the number of works present per year in entities_df.
- Parameters:
count_years (list[int]) – The years for which we need to count the works
- Returns:
Number of works per year.
- Return type:
list[int]
- create_element_used_count_array(element_type: str, entities_from: list[dict] | None = None, count_years: list[int] | None = None)
Creates the element used count array. Count the number of times each element (e.g. references, concepts…) are used. You must provide at least ‘element_type’ (‘reference’ or ‘concept’). If you only provide ‘element_type’ the default behavior is to count the number of time the element_type are used (e.g. the number of times each reference is used) in the dataset loaded (‘entities_df’). If you provide ‘entities_from’, the count will be done for the dataset ‘entities_df’ if it exists and each entity in the list ‘entities_from’. By default, one count is made by entity, but if you provide ‘count_years’ the count will be done for each given year. The result is saved in ‘element_count_df’.
- Parameters:
element_type (str) – The element type (‘reference’ or ‘concept’).
entities_from (list[dict]) – The extra entities to which to count the concepts.
count_years (list[int]) – If given, it will compute the count for each year separately
- get_authors_count(cols: list[str] | None) DataFrame
Count the number of times each author appears in entities_df and return the result as a pd.DataFrame.
- Parameters:
cols (list[str]) – Columns to return in the DataFrame. Must be existing columns names of authorships. The default value is None which correspond to [‘author.id’, ‘count’, ‘raw_affiliation_string’, ‘author.display_name’, ‘author.orcid’].
- Returns:
The authors count.
- Return type:
pd.DataFrame
- get_df_yearly_usage_of_entities(count_years: list[int], entity_used_ids: str | list[str], entity_from_legend: str = 'Custom dataset') DataFrame
Gets the dataframe with the yearly usage by works of entity_used_ids.
- Parameters:
count_years (list[int]) – The years for which we need to count the entity.
entity_used_ids (str | list[str]) – The entity ids to count.
entity_from_legend (str) – The legend on the plot for the entity_from dataset. The default value is “Custom dataset”. If the default value is unchanged and entitie_from_id was specified, entitie_from_id will be used.
- Returns:
The df yearly usage by works.
- Return type:
pd.DataFrame
- get_df_yearly_usage_of_entities_by_multiples_entities(count_years: list[int], entity_used_ids: str | list[str], entity_from_ids: str | list[str] | None = None) DataFrame
Gets the dataframe with the yearly usage by works of entity_used_ids, works for multiple entities from.
- Parameters:
count_years (list[int]) – The years for which we need to count the entities.
entity_used_ids (str | list[str]) – The entity ids to count.
entity_from_ids (str | list[str] | None) – The entity from identifiers, aka the entities dataset in which we need to count the entity_used_ids. When the default value None is used, the entitie_from_id will be used.
- Returns:
The DataFrame of the yearly usage of entity_used_ids by entity_from_ids
- Return type:
pd.DataFrame
- get_element_count(element_type: str, count_years: list[int] | None = None) Series
Count the number of times each element (for now references or concepts) is used by the works in self.entities_df in total or by year (optional).
- Parameters:
element_type (str) – The element type (‘reference’ or ‘concept’).
count_years (list[int]) – List of years to count the concepts. The default value is None to not count by years.
- Returns:
The element count.
- Return type:
pd.Series
- sort_count_array(sort_by: str = 'h_used_all_l_use_main', sort_by_ascending: bool = False)
Sort the dataframe with the count array (element_count_df).
- Parameters:
sort_by (str) – The key to sort the dataframe. The default value is ‘h_used_all_l_use_main’.
sort_by_ascending (bool) – Whenever to sort the dataframe ascending. The default value is False.
Plot
- class openalex_analysis.plot.entities_plot.AuthorsPlot(*args, **kwargs)
Bases:
EntitiesPlot
,AuthorsAnalysis
This class contains specific methods for Authors plot. Not used for now.
- class openalex_analysis.plot.entities_plot.ConceptsPlot(*args, **kwargs)
Bases:
EntitiesPlot
,ConceptsAnalysis
This class contains specific methods for Concepts plot. Not used for now.
- class openalex_analysis.plot.entities_plot.EntitiesPlot
Bases:
object
EntitiesPlot class which contains generic methods to do plots of OpenAlex entities.
- get_figure_collaborations_with_institutions(plot_title: str | None = None, markers_size_scale: float = 0.3) Figure
Get the figure with the collaborations with institutions.
- Parameters:
plot_title (str | None) – The plot title. The default value is None to generate an appropriate title.
markers_size_scale (float) – The size scale of the markers. The default value is 0.3.
- Returns:
The figure
- Return type:
go.Figure
- get_figure_entities_of_a_concept_color_country(concept: str, plot_parameters: dict | None = None) Figure
Gets the figure with the entities of a concept, and with the country as color.
- Parameters:
concept (str) – The concept id.
plot_parameters (dict | None) – The plot parameters.
- Returns:
The figure.
- Return type:
go.Figure
- get_figure_time_series_element_used_by_entities(element: str | None = None, plot_title: str | None = None, x_datas: str = 'year', x_legend: str = 'Year', y_datas: list[str] | None = None) Figure
Get the figure with the time series usage of a element (eg. reference, concept) by entities.
- Parameters:
element (str | None) – The element id. The default value is None. When the element is None, the first element id in the element_count_df is selected.
plot_title (str | None) – The plot title. The default value is None to generate an appropriate title.
x_datas (str) – The x datas. The default value is ‘year’.
x_legend (str) – The x legend. The default value is “Year”.
y_datas (list[str] | None) – The y datas (the entities to plot). The default value is None to use all the entities in the dataframe.
- Returns:
The figure.
- Return type:
go.Figure
- class openalex_analysis.plot.entities_plot.InstitutionsPlot(*args, **kwargs)
Bases:
EntitiesPlot
,InstitutionsAnalysis
This class contains specific methods for Institutions plot.
- getCustomData(concept: str) list[str]
Get the custom data for the plot.
- Parameters:
concept (str) – The concept id.
- Returns:
The list of custom data for Institutions.
- Return type:
list[str]
- getHoverTemplate(concept: str) list[str]
Get the hover template for the plot.
- Parameters:
concept (str) – The concept id.
- Returns:
The hover template.
- Return type:
list[str]
- class openalex_analysis.plot.entities_plot.PublishersPlot(*args, **kwargs)
Bases:
EntitiesPlot
,PublishersAnalysis
This class contains specific methods for Publishers plot. Not used for now.
- class openalex_analysis.plot.entities_plot.SourcesPlot(*args, **kwargs)
Bases:
EntitiesPlot
,SourcesAnalysis
This class contains specific methods for Sources plot. Not used for now.
- class openalex_analysis.plot.entities_plot.TopicsPlot(*args, **kwargs)
Bases:
EntitiesPlot
,TopicsAnalysis
This class contains specific methods for Topics plot. Not used for now.
- class openalex_analysis.plot.entities_plot.WorksPlot(*args, **kwargs)
Bases:
EntitiesPlot
,WorksAnalysis
This class contains specific methods for Works plot.
- getCustomData(concept: str) list[str]
Get the custom data for the plot.
- Parameters:
concept (str) – The concept id.
- Returns:
The list of custom data for Works.
- Return type:
list[str]
- getHoverTemplate(concept: str) list[str]
Get the hover template for the plot.
- Parameters:
concept (str) – The concept id.
- Returns:
The hover template.
- Return type:
list[str]
- get_figure_entities_yearly_position(count_years: list[int], entity_used_ids: str, entity_from_ids: str | list[str] | None = None) Figure
Get the plot figure with the yearly usage of an entity (concept, work) in the works from another entity (institution, author).
- Parameters:
count_years (list[int]) – The years to count.
entity_used_ids (str) – The entity used.
entity_from_ids (str | list[str] | None) – The entities which used the entities to count. The default value is None. If None, the entitie_from_id is used.
- Returns:
The figure.
- Return type:
go.Figure
- get_figure_entities_yearly_usage(count_years: list[int], entity_used_ids: str | list[str], entity_from_ids: str | list[str] | None = None) Figure
Get the plot bar figure with the yearly usage of an entity (concept, work) in the works from another entity (institution, author).
- Parameters:
count_years (list[int]) – The years to count.
entity_used_ids (str | list[str]) – The entities used.
entity_from_ids (str | list[str] | None) – The entities which used the entities to count. The default value is None. If None, the entitie_from_id is used.
- Returns:
The figure.
- Return type:
go.Figure
- get_figure_nb_time_used(element_type: str) Figure
Gets the figure with the number of time each reference is used in a list of works. Also work with concepts.
- Parameters:
element_type (str) – The element type (‘reference’ or ‘concept’).
- Returns:
The figure.
- Return type:
go.Figure