Skip to content

Commit

Permalink
#103 Merge pull request from astropenguin/astropenguin/issue102
Browse files Browse the repository at this point in the history
Release v0.6.4
  • Loading branch information
astropenguin committed Jul 29, 2022
2 parents a166bed + 3e4ad90 commit 1a93a5e
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 42 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"settings": {
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"python.analysis.typeCheckingMode": "basic",
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"[python]": {
Expand Down
45 changes: 39 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Editor settings
.vscode
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -23,7 +24,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -53,6 +53,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -74,9 +75,9 @@ instance/
# Sphinx documentation
docs/_apidoc/
docs/_build/
docs/readme.rst

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -87,7 +88,9 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -96,7 +99,22 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -132,3 +150,18 @@ dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# End of https://www.toptal.com/developers/gitignore/api/python
9 changes: 9 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"creators": [
{
"name": "Akio Taniguchi",
"affiliation": "Nagoya University",
"orcid": "0000-0002-9695-6183"
}
]
}
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# arxiv-post

[![PyPI](https://img.shields.io/pypi/v/arxiv-post.svg?label=PyPI&style=flat-square)](https://pypi.org/project/arxiv-post/)
[![Python](https://img.shields.io/pypi/pyversions/arxiv-post.svg?label=Python&color=yellow&style=flat-square)](https://pypi.org/project/arxiv-post/)
[![Test](https://img.shields.io/github/workflow/status/astropenguin/arxiv-post/Test?logo=github&label=Test&style=flat-square)](https://github.com/astropenguin/arxiv-post/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&style=flat-square)](LICENSE)
[![Release](https://img.shields.io/pypi/v/arxiv-post?label=Release&color=cornflowerblue&style=flat-square)](https://pypi.org/project/arxiv-post/)
[![Python](https://img.shields.io/pypi/pyversions/arxiv-post?label=Python&color=cornflowerblue&style=flat-square)](https://pypi.org/project/arxiv-post/)
[![Downloads](https://img.shields.io/pypi/dm/arxiv-post?label=Downloads&color=cornflowerblue&style=flat-square)](https://pepy.tech/project/arxiv-post)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.6127352-cornflowerblue?style=flat-square)](https://doi.org/10.5281/zenodo.6127352)
[![Tests](https://img.shields.io/github/workflow/status/astropenguin/arxiv-post/Tests?label=Tests&style=flat-square)](https://github.com/astropenguin/arxiv-post/actions)

Translate and post arXiv articles to various apps
Translate and post arXiv articles to Slack and various apps

## Installation

Expand All @@ -16,7 +17,7 @@ $ playwright install chromium

## Usage

After installation, command line interface `arxiv-post` is available, with which you can translate and post arXiv articles to various apps.
Command line interface `arxiv-post` is available after installation, with which you can translate and post arXiv articles to various apps.
Note that only `slack` app is currently available.
You need to [create a custom Slack app to get an URL of incoming webhook](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack).

Expand All @@ -39,8 +40,8 @@ $ arxiv-post slack --help

## Example

It may be nice to regularly run the command by some automation tools such as GitHub Actions.
Here is a live example in which daily (2 days ago) arXiv articles in [astro-ph.GA](https://arxiv.org/list/astro-ph.GA/new) and [astro-ph.IM](https://arxiv.org/list/astro-ph.IM/new) are posted to different channels of a Slack workspace.
It would be nice to regularly run the command by some automation tools such as GitHub Actions.
Here is a live example where daily arXiv articles in [astro-ph.GA](https://arxiv.org/list/astro-ph.GA/new), [astro-ph.IM](https://arxiv.org/list/astro-ph.IM/new), and [astro-ph.HE](https://arxiv.org/list/astro-ph.HE/new) are posted to different channels of a Slack workspace.

- [a-lab-nagoya/astro-ph-slack: Translate and post arXiv articles to Slack](https://github.com/a-lab-nagoya/astro-ph-slack)

Expand Down
11 changes: 5 additions & 6 deletions arxiv_post/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# flake8: noqa
__author__ = "Akio Taniguchi"
__version__ = "0.6.3"


# submodules
# type: ignore
from . import apps
from . import arxiv
from . import article
from . import cli
from . import consts
from . import deepl


# metadata
__version__ = "0.6.4"
11 changes: 11 additions & 0 deletions docs/_static/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project information
author = "Akio Taniguchi"
copyright = "2021 Akio Taniguchi"
copyright = "2021-2022 Akio Taniguchi"


# General configuration
Expand All @@ -17,9 +17,12 @@

# Options for HTML output
html_static_path = ["_static"]
html_logo = "_static/logo.svg"
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"logo": {
"image_light": "logo-light.svg",
"image_dark": "logo-dark.svg",
},
"github_url": "https://github.com/astropenguin/arxiv-post/",
"twitter_url": "https://twitter.com/astropengu_in/",
}
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
```

```{toctree}
---
hidden:
---
Home <self>
Package guide <_apidoc/arxiv_post>
```
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "arxiv-post"
version = "0.6.3"
description = "Translate and post arXiv articles to various apps"
version = "0.6.4"
description = "Translate and post arXiv articles to Slack and various apps"
authors = ["Akio Taniguchi <taniguchi@a.phys.nagoya-u.ac.jp>"]
keywords = ["arxiv", "deepl", "slack", "translation"]
license = "MIT"
Expand Down
9 changes: 7 additions & 2 deletions tests/test_arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
KEYWORDS = ("galaxy",)
START_DATE = "2021-01-01 in UTC"
END_DATE = "2021-01-02 in UTC"
N_ARTICLES = 4
EXPECTED_URLS = [
"http://arxiv.org/abs/2101.00188v2",
"http://arxiv.org/abs/2101.00158v1",
"http://arxiv.org/abs/2101.00253v3",
"http://arxiv.org/abs/2101.00283v1",
]


# test functions
def test_search() -> None:
articles = search(CATEGORIES, KEYWORDS, START_DATE, END_DATE)
assert len(articles) == N_ARTICLES
assert [a.arxiv_url for a in articles] == EXPECTED_URLS
16 changes: 0 additions & 16 deletions tests/test_metadata.py

This file was deleted.

0 comments on commit 1a93a5e

Please sign in to comment.