Skip to content

Commit

Permalink
Standardize on HTTPS over HTTP (#131)
Browse files Browse the repository at this point in the history
Co-authored-by: Joel Barmettler <[email protected]>
  • Loading branch information
lukasschwab and joelbarmettlerUZH authored Oct 16, 2023
1 parent 4743957 commit 821cca9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# arxiv.py
[![PyPI](https://img.shields.io/pypi/v/arxiv)](https://pypi.org/project/arxiv/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/arxiv) [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/lukasschwab/arxiv.py/python-package.yml?branch=master)](https://github.com/lukasschwab/arxiv.py/actions?query=branch%3Amaster)

Python wrapper for [the arXiv API](http://arxiv.org/help/api/index).
Python wrapper for [the arXiv API](https://arxiv.org/help/api/index).

## Quick links

+ [Full package documentation](http://lukasschwab.me/arxiv.py/index.html)
+ [Full package documentation](https://lukasschwab.me/arxiv.py/index.html)
+ [Example: fetching results](#example-fetching-results): the most common usage.
+ [Example: downloading papers](#example-downloading-papers)
+ [Example: fetching results with a custom client](#example-fetching-results-with-a-custom-client)

## About arXiv

[arXiv](http://arxiv.org/) is a project by the Cornell University Library that provides open access to 1,000,000+ articles in Physics, Mathematics, Computer Science, Quantitative Biology, Quantitative Finance, and Statistics.
[arXiv](https://arxiv.org/) is a project by the Cornell University Library that provides open access to 1,000,000+ articles in Physics, Mathematics, Computer Science, Quantitative Biology, Quantitative Finance, and Statistics.

## Usage

Expand Down Expand Up @@ -85,7 +85,7 @@ The `Result` objects yielded by `(Search).results()` include metadata about each

The meaning of the underlying raw data is documented in the [arXiv API User Manual: Details of Atom Results Returned](https://arxiv.org/help/api/user-manual#_details_of_atom_results_returned).

+ `result.entry_id`: A url `http://arxiv.org/abs/{id}`.
+ `result.entry_id`: A url `https://arxiv.org/abs/{id}`.
+ `result.updated`: When the result was last updated.
+ `result.published`: When the result was originally published.
+ `result.title`: The title of the result.
Expand Down
8 changes: 4 additions & 4 deletions arxiv/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Result(object):
"""

entry_id: str
"""A url of the form `http://arxiv.org/abs/{id}`."""
"""A url of the form `https://arxiv.org/abs/{id}`."""
updated: datetime
"""When the result was last updated."""
published: datetime
Expand Down Expand Up @@ -173,10 +173,10 @@ def get_short_id(self) -> str:
"""
Returns the short ID for this result.
+ If the result URL is `"http://arxiv.org/abs/2107.05580v1"`,
+ If the result URL is `"https://arxiv.org/abs/2107.05580v1"`,
`result.get_short_id()` returns `2107.05580v1`.
+ If the result URL is `"http://arxiv.org/abs/quant-ph/0201082v1"`,
+ If the result URL is `"https://arxiv.org/abs/quant-ph/0201082v1"`,
`result.get_short_id()` returns `"quant-ph/0201082v1"` (the pre-March
2007 arXiv identifier format).
Expand Down Expand Up @@ -506,7 +506,7 @@ class Client(object):
`Client.results`.
"""

query_url_format = "http://export.arxiv.org/api/query?{}"
query_url_format = "https://export.arxiv.org/api/query?{}"
"""The arXiv query API endpoint format."""
page_size: int
"""Maximum number of results fetched in a single API request."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# metadata for upload to PyPI
author="Lukas Schwab",
author_email="[email protected]",
description="Python wrapper for the arXiv API: http://arxiv.org/help/api/",
description="Python wrapper for the arXiv API: https://arxiv.org/help/api/",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_invalid_id(self):

def test_nonexistent_id_in_list(self):
# Assert _from_feed_entry throws MissingFieldError.
feed = feedparser.parse("http://export.arxiv.org/api/query?id_list=0808.05394")
feed = feedparser.parse("https://export.arxiv.org/api/query?id_list=0808.05394")
with self.assertRaises(arxiv.Result.MissingFieldError):
arxiv.Result._from_feed_entry(feed.entries[0])
# Assert thrown error is handled and hidden by generator.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_result_shape(self):

def test_from_feed_entry(self):
feed = arxiv.Client()._parse_feed(
"http://export.arxiv.org/api/query?search_query=testing"
"https://export.arxiv.org/api/query?search_query=testing"
)
feed_entry = feed.entries[0]
result = arxiv.Result._from_feed_entry(feed_entry)
Expand Down

0 comments on commit 821cca9

Please sign in to comment.