# HEP Paper Manager (HPM)
![workflow](https://imgur.com/u8SVtjE.png)
HPM is a command-line tool that helps adds Inspire literature to a
Notion database.
It has features as following:
- Retrieve HEP papers by Inspire ID, or Arxiv ID, or DOI.
- Customizable paper template for creating pages in a Notion database.
- Interactive CLI for easy setup and usage.
## Installation
```
pip install hep-paper-manager
```
## Let's add a paper to a Notion database!
In this step-by-step guide, we will together add "[1511.05190] Jet image -- deep
learning edition"([link](https://inspirehep.net/literature/1405106)) to a Notion
database.
### Step 0: Create an integration in Notion
1. Open [My Integrations](https://www.notion.so/my-integrations).
2. Click `+ New integration`.
3. Enter a name for your integration.
4. Copy the integration secret as your token.
Check the official guide for integrations [here](https://developers.notion.com/docs/create-a-notion-integration).
![integration](https://imgur.com/RXib1zV.gif)
### Step 1: Create a Notion database
A database is the place where we'll put all papers of interest in. Create an
empty page and make it a database.
![database](https://imgur.com/jLBqKYg.gif)
Each item represents a paper. Below is what we want to record for each
paper:
| Property | Type | Comment |
| ---------- | ------------ | ----------------------------------------------- |
| Date | Date | When the paper appears in the Inspire. |
| Citations | Number | More citations, more likely to be a good paper. |
| Title | Title | |
| Type | Select | An article, a thesis, or a conference paper. |
| Journal | Select | The journal where the paper is published. |
| Authors | Multi-select | |
| Link | URL | The Inspire link to the paper. |
| Abstract | Text | |
| Bibtex | Text | |
| Inspire ID | Text | |
| Arxiv ID | Text | |
| DOI | Text | |
The "Type" above is what we call a "property" in Notion. You can add a new
property by clicking `+` in the database page. Or click an existing property
to modify its type.
![FeqCkhW](https://github.com/Star9daisy/hep-paper-manager/assets/47071425/81630270-ea99-41d6-a4a2-33ddbe0c4b88)
Open a blank page, it should look like this:
![blank page](https://imgur.com/qPGOU7C.png)
To complete the database setup, we need to add the integration to the database.
![add integration](https://imgur.com/CBCgY81.gif)
### Step 2: Set up `hpm`
To let `hpm` add papers for you, we need to install and initialize it first.
```bash
pip install hep-paper-manager
hpm init
```
![hpm init](https://imgur.com/uxBkbW6.gif)
If you want to change the default template, use `hpm info` to find the location
of the template file. Then modify the template file directly.
![hpm info](https://imgur.com/QuVPVK4.png)
### Step 3: Add the paper to the database
Usually, we search for papers on Inspire. The Inspire ID is the number in the
URL.
![inpsire](https://imgur.com/E3meDtH.gif)
In the command line, we use `hpm add` to add the paper to the database.
```bash
hpm add 1405106
```
Let's go back and check the database page. The paper is right there!
![database](https://imgur.com/r9bWdlm.png)
Of course, you can also add papers by Arxiv ID or DOI.
```bash
hpm add 1511.05190 --id-type arxiv
hpm add "10.1007/JHEP07(2016)069" --id-type doi
```
![other id](https://imgur.com/j4zi8ws.png)
You can now add more papers to your Notion database.
### Step 4: Update the paper
After a while, the paper may have newer information like citation number. You
can update the paper in the database by `hpm update`.
```bash
hpm update 1405106
```
Just like `hpm add`, you can also update papers by Arxiv ID or DOI.
```bash
hpm update 1511.05190 --id-type arxiv
hpm update "10.1007/JHEP07(2016)069" --id-type doi
```
Note, the columns in the database but not in the template will not be updated.
So you can add more columns to the database without worrying about losing
information.
## Engines
- `Inspire`: It fetches papers from the [Inspire HEP](https://inspirehep.net/).
It serves the default engine for `hpm`. `InspirePaper` has the following
properties:
- date: str
- citations: int
- title: str
- type: str
- journal: str
- authors: list[str]
- link: str
- abstract: str
- bibtex: str
- inspire_id: str
- arxiv_id: str
- doi: str
## Templates
Template saves the mapping from paper properties to Notion database properties.
You can adjust the properties within the template.
Below is the default template for `Inspire` engine which holds all properties
of `InspirePaper`:
- `paper.yml`
```yaml
engine: Inspire
database_id: <database_id>
properties:
date: Date
citations: Citations
title: Title
type: Type
journal: Journal
authors: Authors
link: Link
abstract: Abstract
bibtex: Bibtex
inspire_id: Inspire ID
arxiv_id: Arxiv ID
doi: DOI
```
These properties match the properties of the InpspirePaper class. You can
modify the template to fit your needs.
! Remember the last three lines are necessary. You can't remove them.
## Updates
### v0.2.2
- Fix the error when `hpm add` some conference papers that may have no publication info.
### v0.2.1
- Fix the bug that `hpm add` only checks the first 100 pages in the database.
- Fix the checkmark style.
### v0.2.0
- Refactor the codebase by introducing `notion_database`.
- Add `hpm update` to update one paper in the database.
- Add `hpm info` to show the information of this app.
### v0.1.4
- Update print style.
- Add friendly error message when the `database_id` is not specified.
### v0.1.3
- Update `hpm add` to check if the paper already exists in the database.
- You can now create a database with more properties then the template.
### v0.1.2
- Update paper from Inspire engine to include url, bibtex, and source.
### v0.1.1
- Add `hpm init` for interactive setup.
- Add `hpm add` for adding a paper to a Notion database.
- Introduce the default `Inspire` engine and `paper.yml` template.
Raw data
{
"_id": null,
"home_page": "https://github.com/Star9daisy/hep-paper-manager",
"name": "hep-paper-manager",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "high-energy-physics,inspire-hep,notion,cli",
"author": "Star9daisy",
"author_email": "star9daisy@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/00/1e/0370e9a6def975b8d2f46d755e196ce8c119462fdbee0087e51b6f626ad8/hep_paper_manager-0.2.2.tar.gz",
"platform": null,
"description": "# HEP Paper Manager (HPM)\n\n![workflow](https://imgur.com/u8SVtjE.png)\n\nHPM is a command-line tool that helps adds Inspire literature to a\nNotion database. \n\nIt has features as following:\n- Retrieve HEP papers by Inspire ID, or Arxiv ID, or DOI.\n- Customizable paper template for creating pages in a Notion database.\n- Interactive CLI for easy setup and usage.\n\n## Installation\n```\npip install hep-paper-manager\n```\n\n## Let's add a paper to a Notion database!\nIn this step-by-step guide, we will together add \"[1511.05190] Jet image -- deep\nlearning edition\"([link](https://inspirehep.net/literature/1405106)) to a Notion\ndatabase.\n\n### Step 0: Create an integration in Notion\n1. Open [My Integrations](https://www.notion.so/my-integrations).\n2. Click `+ New integration`.\n3. Enter a name for your integration.\n4. Copy the integration secret as your token.\n\nCheck the official guide for integrations [here](https://developers.notion.com/docs/create-a-notion-integration).\n\n![integration](https://imgur.com/RXib1zV.gif)\n\n### Step 1: Create a Notion database\nA database is the place where we'll put all papers of interest in. Create an\nempty page and make it a database.\n\n![database](https://imgur.com/jLBqKYg.gif)\n\nEach item represents a paper. Below is what we want to record for each\npaper:\n| Property | Type | Comment |\n| ---------- | ------------ | ----------------------------------------------- |\n| Date | Date | When the paper appears in the Inspire. |\n| Citations | Number | More citations, more likely to be a good paper. |\n| Title | Title | |\n| Type | Select | An article, a thesis, or a conference paper. |\n| Journal | Select | The journal where the paper is published. |\n| Authors | Multi-select | |\n| Link | URL | The Inspire link to the paper. |\n| Abstract | Text | |\n| Bibtex | Text | |\n| Inspire ID | Text | |\n| Arxiv ID | Text | |\n| DOI | Text | |\n\nThe \"Type\" above is what we call a \"property\" in Notion. You can add a new\nproperty by clicking `+` in the database page. Or click an existing property\nto modify its type.\n![FeqCkhW](https://github.com/Star9daisy/hep-paper-manager/assets/47071425/81630270-ea99-41d6-a4a2-33ddbe0c4b88)\n\nOpen a blank page, it should look like this:\n![blank page](https://imgur.com/qPGOU7C.png)\n\nTo complete the database setup, we need to add the integration to the database.\n![add integration](https://imgur.com/CBCgY81.gif)\n\n### Step 2: Set up `hpm`\nTo let `hpm` add papers for you, we need to install and initialize it first.\n```bash\npip install hep-paper-manager\nhpm init\n```\n![hpm init](https://imgur.com/uxBkbW6.gif)\n\nIf you want to change the default template, use `hpm info` to find the location\nof the template file. Then modify the template file directly.\n\n![hpm info](https://imgur.com/QuVPVK4.png)\n\n \n### Step 3: Add the paper to the database\nUsually, we search for papers on Inspire. The Inspire ID is the number in the\nURL.\n![inpsire](https://imgur.com/E3meDtH.gif)\n\nIn the command line, we use `hpm add` to add the paper to the database.\n```bash\nhpm add 1405106\n```\n\nLet's go back and check the database page. The paper is right there!\n![database](https://imgur.com/r9bWdlm.png)\n\nOf course, you can also add papers by Arxiv ID or DOI.\n```bash\nhpm add 1511.05190 --id-type arxiv\nhpm add \"10.1007/JHEP07(2016)069\" --id-type doi\n```\n![other id](https://imgur.com/j4zi8ws.png)\n\nYou can now add more papers to your Notion database.\n\n### Step 4: Update the paper\nAfter a while, the paper may have newer information like citation number. You\ncan update the paper in the database by `hpm update`.\n```bash\nhpm update 1405106\n```\n\nJust like `hpm add`, you can also update papers by Arxiv ID or DOI.\n```bash\nhpm update 1511.05190 --id-type arxiv\nhpm update \"10.1007/JHEP07(2016)069\" --id-type doi\n```\n\nNote, the columns in the database but not in the template will not be updated.\nSo you can add more columns to the database without worrying about losing\ninformation.\n\n## Engines\n- `Inspire`: It fetches papers from the [Inspire HEP](https://inspirehep.net/).\n It serves the default engine for `hpm`. `InspirePaper` has the following\n properties:\n - date: str\n - citations: int\n - title: str\n - type: str\n - journal: str\n - authors: list[str]\n - link: str\n - abstract: str\n - bibtex: str\n - inspire_id: str\n - arxiv_id: str\n - doi: str\n\n\n## Templates\nTemplate saves the mapping from paper properties to Notion database properties.\nYou can adjust the properties within the template.\n\nBelow is the default template for `Inspire` engine which holds all properties\nof `InspirePaper`:\n- `paper.yml`\n ```yaml\n engine: Inspire\n database_id: <database_id>\n properties:\n date: Date\n citations: Citations\n title: Title\n type: Type\n journal: Journal\n authors: Authors\n link: Link\n abstract: Abstract\n bibtex: Bibtex\n inspire_id: Inspire ID\n arxiv_id: Arxiv ID\n doi: DOI\n ```\n These properties match the properties of the InpspirePaper class. You can\n modify the template to fit your needs. \n\n ! Remember the last three lines are necessary. You can't remove them.\n\n## Updates\n### v0.2.2\n- Fix the error when `hpm add` some conference papers that may have no publication info.\n\n### v0.2.1\n- Fix the bug that `hpm add` only checks the first 100 pages in the database.\n- Fix the checkmark style.\n\n### v0.2.0\n- Refactor the codebase by introducing `notion_database`.\n- Add `hpm update` to update one paper in the database.\n- Add `hpm info` to show the information of this app.\n\n### v0.1.4\n- Update print style.\n- Add friendly error message when the `database_id` is not specified.\n### v0.1.3\n- Update `hpm add` to check if the paper already exists in the database.\n- You can now create a database with more properties then the template.\n### v0.1.2\n- Update paper from Inspire engine to include url, bibtex, and source. \n### v0.1.1\n- Add `hpm init` for interactive setup.\n- Add `hpm add` for adding a paper to a Notion database.\n- Introduce the default `Inspire` engine and `paper.yml` template.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "HPM is a command-line tool that adds High Energy Physics (HEP) papers to a Notion database.",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/Star9daisy/hep-paper-manager",
"Repository": "https://github.com/Star9daisy/hep-paper-manager"
},
"split_keywords": [
"high-energy-physics",
"inspire-hep",
"notion",
"cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82bbc56310236481776e581083227c3d073aa01ac5b2dc3208efc1f0f8c34457",
"md5": "c2ec45ebeec0e80bed3bdad997d40324",
"sha256": "0a7dbc29189eef1ccd9b2479c997ea688c189a66098d0fde000a6c95fe5776b1"
},
"downloads": -1,
"filename": "hep_paper_manager-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c2ec45ebeec0e80bed3bdad997d40324",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 10336,
"upload_time": "2023-12-19T04:36:23",
"upload_time_iso_8601": "2023-12-19T04:36:23.272280Z",
"url": "https://files.pythonhosted.org/packages/82/bb/c56310236481776e581083227c3d073aa01ac5b2dc3208efc1f0f8c34457/hep_paper_manager-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "001e0370e9a6def975b8d2f46d755e196ce8c119462fdbee0087e51b6f626ad8",
"md5": "b41044bbadc5a6ca3affe2dbc4c4c12d",
"sha256": "587dce68277cb1afae1660645e2f59076617abb955d989ade99796447cd7964d"
},
"downloads": -1,
"filename": "hep_paper_manager-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "b41044bbadc5a6ca3affe2dbc4c4c12d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 11036,
"upload_time": "2023-12-19T04:36:25",
"upload_time_iso_8601": "2023-12-19T04:36:25.954669Z",
"url": "https://files.pythonhosted.org/packages/00/1e/0370e9a6def975b8d2f46d755e196ce8c119462fdbee0087e51b6f626ad8/hep_paper_manager-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-19 04:36:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Star9daisy",
"github_project": "hep-paper-manager",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hep-paper-manager"
}