tools.generate_dict¶
Classes¶
GenerateDataDict ¶
GenerateDataDict(
conferences_or_journals,
inproceedings_or_article,
json_dict,
for_vue=True,
path_spidered_conferences_or_journals=None,
)
Generate data dictionaries from JSON input for conferences and journals.
This class processes JSON data containing conference or journal information and generates structured dictionaries for markdown table generation, including publisher metadata, keyword-based indexing, and Mermaid diagram data.
Attributes:
| Name | Type | Description |
|---|---|---|
cj | str | Type of publication ('conferences' or 'journals'). |
ia | str | Publication type ('inproceedings' or 'article'). |
json_dict | dict | Input JSON data containing publication information. |
path_spidered_cj | Optional[str] | Path to spidered conference/journal data. |
for_vue | bool | Whether to generate Vue.js-compatible format. |
Example
generator = GenerateDataDict( ... conferences_or_journals="conferences", ... inproceedings_or_article="inproceedings", ... json_dict=publication_data, ... for_vue=True ... ) publisher_meta, publisher_abbr, keyword_abbr = generator.generate()
Initialize the GenerateDataDict instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conferences_or_journals | str | Type of publication ('conferences' or 'journals'). | required |
inproceedings_or_article | str | Publication type ('inproceedings' or 'article'). | required |
json_dict | dict | Input JSON data containing publication information. | required |
for_vue | bool | Whether to generate Vue.js-compatible format. Defaults to True. | True |
path_spidered_conferences_or_journals | Optional[str] | Path to spidered conference/journal data. Defaults to None. | None |
Source code in pyformatjson/tools/generate_dict.py
Functions¶
conference_or_journal ¶
Process conference or journal data and generate formatted information.
This method processes individual conference or journal data, validates name lengths, extracts information, formats URLs, and generates table row data for markdown output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
publisher_url | str | Publisher's URL for markdown linking. | required |
abbr | str | Abbreviation identifier for the publication. | required |
abbr_dict | dict | Dictionary containing publication details including names, URLs, dates, scores, and keywords. | required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple | tuple[dict[str, Any], list[str]] | A tuple containing: - dict: Contains formatted about text, remarks, and table row data - list: Sorted list of keywords for the publication |
Raises:
| Type | Description |
|---|---|
ValueError | If full and abbreviated names have mismatched lengths. |
Example
result = generator.conference_or_journal( ... "https://publisher.com", "ICML", conf_data ... ) abouts, keywords = result
Source code in pyformatjson/tools/generate_dict.py
generate ¶
Generate publisher metadata and keyword-based publication information.
This method processes the JSON data to create three main dictionaries: 1. Publisher metadata with URLs and descriptions 2. Publisher abbreviation metadata with detailed publication info 3. Keyword-based metadata for easy searching and categorization
Returns:
| Name | Type | Description |
|---|---|---|
tuple | tuple[dict, dict, dict] | A tuple containing three dictionaries: - publisher_meta_dict: Publisher metadata including URLs and descriptions - publisher_abbr_meta_dict: Publication details indexed by publisher and abbreviation - keyword_abbr_meta_dict: Publication details indexed by keywords |
Example
generator = GenerateDataDict(...) pub_meta, pub_abbr, keyword_abbr = generator.generate()
Source code in pyformatjson/tools/generate_dict.py
generate_mermaid_data ¶
Generate Mermaid diagram data from spidered README files.
This method reads spidered data from README files and generates Mermaid chart configuration for visualizing publication statistics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
publisher | str | Publisher name. | required |
abbr | str | Publication abbreviation. | required |
inproceedings_or_article | str | Publication type. | required |
Returns:
| Type | Description |
|---|---|
list[str] | list[str]: Mermaid chart configuration lines, or empty list if no data found. |
Source code in pyformatjson/tools/generate_dict.py
Functions¶
conference_journal_header ¶
Generate markdown table headers for conferences and journals.
This function creates the appropriate markdown table headers for displaying conference and journal information in tabular format.
Returns:
| Name | Type | Description |
|---|---|---|
tuple | tuple[list[str], list[str]] | A tuple containing two lists: - conference_header: Markdown table headers for conferences - journal_header: Markdown table headers for journals |
Example
conf_header, journal_header = conference_journal_header() print(conf_header[0]) |Publishers|Full/Homepage|Abbr/About|Acronym/Archive|Period/DBLP|...