API
Arxiv.ApiArxiv.IdArxiv.PaperArxiv.idstringArxiv.infoArxiv.islatestArxiv.latestArxiv.opensiteArxiv.openvanityArxiv.openwithArxiv.printidArxiv.queryArxiv.rawqueryArxiv.vanityurlDownloads.downloadArxiv.@arXiv_str
Main
Arxiv.Id — TypeArxiv.IdAn arXiv reference identifier. See the identifier schema.
Constructors
Id(y, m, n; version=0, legacy_category="")
Id(t::Date, n; version=0, legacy_category="")
Id(id::Id; version=0)
arXiv"2103.17058" # the arXiv string macro can also be usedArguments
y: The publication year as an integer. E.g.2023and23are equivalent.m: The publication month as an integer.n: The ID number, e.g. this number for2304.00319is2304.0319.version: The version of the paper,0to indicate "latest".legacy_category: The category used by the old form arxiv identifiers.id: AnotherIdcan be used to create a similarIdwith a different version.
Arxiv.Paper — TypePaperA data structure representing an arxiv paper. This contains all of the metadata on the paper which can be obtained via the arxiv API, and can be used to easily download the paper.
Properties
The following can be accessed with getproperty, e.g. p.id.
id: TheIdof the paper.updated: The timestamp of the most recent update.published: The timestamp of the publication.title: The title of the paper.summary: A summary description of the paper (usually the abstract).authors: AVector{String}listing the paper's authorsdoi: The digital object identifier of the publication.comment: Usually this lists the number of pages and lists what was included in version changes.primary_category: A string giving the arxiv.org primary category of the paper.categories: AVector{String}list of all arxiv.org categories to which the paper belongs.link_doi: The DOI in URL form, as aURIornothing.link_text: The URL of the arxiv.org website for the paper, as aURIornothing.link_pdf: The URL of the PDF download for the paper, as aURIornothing.
Constructors
All constructors generate an HTTP call to the host specified by api (i.e. arxiv.org).
Paper(api, id)
Paper(id)Arguments
Arxiv.@arXiv_str — MacroarXiv"1111.2222"Creates an arxiv Id from a string.
Downloads.download — Functiondownload(p::Paper, out; kw...)Downloads the paper p to out (e.g. a string or IO). See the documentation for Downloads.download for all available options.
Arxiv.openwith — Functionopenwith(p::Paper, cmd; wait=false, detach=true, kw...)Download the PDF of the paper to a temporary file and open it with the command cmd. cmd can either be a string, array of strings or Cmd. If wait=true execution will block until the process returns. If detach=true the command will run in a new process group. Additional keyword arguments are passed to Downloads.download.
Examples
p = Paper(arxiv"2303.17626")
openwith(p, "rifle")
openwith(p, "zathura")Arxiv.opensite — Functionopensite(p::Paper)Open the landing site for the paper in a browser.
NOTE: This uses xdg-open and only works on linux.
Arxiv.vanityurl — Functionvanityurl(p::Paper)Get the URL for the arxiv-vanity.com site of the paper.
Arxiv.openvanity — Functionopenvanity(p::Paper)Open the paper in a browser in arxiv-vanity.com.
NOTE: This uses xdg-open and only works on linux.
Arxiv.printid — Functionprintid([io::IO,] id::Id)Print the identifier without the arXiv: prefix.
printid(arXiv"2103.17058") # prints "2103.17058"Arxiv.idstring — Functionidstring(id::Id)Returns a string giving the identifier without the arXiv prefix.
Arxiv.query — Functionquery([api::Arxiv.Api]; search="", ids=[], max_results=10, start=0)Find papers with search string search with identifiers ids. Each of search, ids will only be used if non-empty. The returned value is an array of Paper with maximum length max_results.
ids should be an iterable of either Arxiv.Id or strings.
Arxiv.islatest — Functionislatest(id::Id)Checks whether the arxiv identifier is for the latest version. This means that the identifier does not specify the version, so that when API calls are made with this identifier, the arxiv server interprets it as the latest version. This will return false for a specific version that happens to be the latest.
Arxiv.latest — Functionlatest(id::Id)Returns the identifier for the latest version. For example latest(arXiv"2303.17626v3") == arXiv"2303.17626".
Arxiv.info — Functioninfo([api::Api], ids)Get the information dictionaries for papers with ids in the iterable ids.
Internals
Arxiv.Api — TypeApiData structure representing an arxiv API. The default can be created with Api(). Note that most functions that can take an Api as an argument can omit that argument to use the default.
Arxiv.rawquery — Functionrawquery(URI, api; search_query="", id_list=[], start=0, max_results=0)
rawquery(HTTP.Response, api; kw...)
rawquery(String, api; kw...)
rawquery(api; kw...)Performs a raw query of the arXiv search API with search arguments given by search_query, id_list, start and max_results.