Skip to content

Commit 114b1af

Browse files
authored
Register Package
Performed final check and Registering the package.
1 parent def9008 commit 114b1af

File tree

7 files changed

+104
-51
lines changed

7 files changed

+104
-51
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# EconJobMarket.jl
22

3-
[![License: ISC - Permissive License](https://img.shields.io/badge/License-ISC-green?style=plastic)](https://img.shields.io/github/license/Nosferican/EconJobMarket.jl)
4-
![OSS Lifecycle](https://img.shields.io/osslifecycle/Nosferican/EconJobMarket.jl?style=plastic)
5-
[![Documentation: dev](https://img.shields.io/badge/docs-dev-blue?style=plastic)](https://nosferican.github.io/EconJobMarket.jl/dev)
6-
[![Build Status](https://github.com/Nosferican/EconJobMarket.jl/workflows/CI/badge.svg)](https://github.com/Nosferican/EconJobMarket.jl/actions?workflow=CI)
7-
[![Code Coverage](https://codecov.io/gh/Nosferican/EconJobMarket.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/Nosferican/EconJobMarket.jl)
3+
An interface for the EconJobMarket [API](https://backend.econjobmarket.org/) for the Julia programing language.
4+
5+
| **Documentation** | **Continous Integration** | **Terms and Support** |
6+
|:-----------------:|:-------------------------:|:---------------------:|
7+
| [![][dsi]][dsu] | [![][bsi]][bsu] | [![][li]][lu] |
8+
| [![][ddi]][ddu] | [![][cci]][ccu] | [![][lci]][lcu] |
89

910
## Related Repositories
1011

@@ -13,3 +14,16 @@
1314
- [Victoria Marone / Pull_EJM_listings.py](https://www.dropbox.com/s/e8mi47jnst07c4e/Pull_EJM_listings.py?dl=0)
1415
- Similar functionality for R
1516
- [tyleransom/econJobMarket](https://github.com/tyleransom/econJobMarket)
17+
18+
[bsi]: https://github.com/Nosferican/EconJobMarket.jl/workflows/CI/badge.svg
19+
[bsu]: https://github.com/Nosferican/EconJobMarket.jl/actions?workflow=CI
20+
[cci]: https://codecov.io/gh/Nosferican/EconJobMarket.jl/branch/master/graph/badge.svg
21+
[ccu]: https://codecov.io/gh/Nosferican/EconJobMarket.jl
22+
[ddi]: https://img.shields.io/badge/docs-dev-blue?style=plastic
23+
[ddu]: https://nosferican.github.io/EconJobMarket.jl/dev
24+
[dsi]: https://img.shields.io/badge/docs-stable-blue?style=plastic
25+
[dsu]: https://nosferican.github.io/EconJobMarket.jl/stable
26+
[li]: https://img.shields.io/github/license/Nosferican/EconJobMarket.jl?style=plastic
27+
[lu]: https://github.com/Nosferican/EconJobMarket.jl/blob/master/LICENSE.md
28+
[lci]: https://img.shields.io/osslifecycle/Nosferican/EconJobMarket.jl?style=plastic
29+
[lcu]: https://tldrlegal.com/license/-isc-license

docs/jmd/index.jmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ Waiting for access to a recruiter account to implemented the recruiter-only acce
1919

2020
## Getting Started
2121

22-
Install the project either though
22+
Install the package either though
2323

2424
```
25-
]add https://github.com/Nosferican/EconJobMarket.jl # Use ] to access the Pkg REPL
25+
]add EconJobMarket # Use ] to access the Pkg REPL
2626
```
2727

2828
or
29+
2930
```
3031
using Pkg
31-
Pkg.add(PackageSpec(url = "https://github.com/Nosferican/EconJobMarket.jl"))
32+
Pkg.add("EconJobMarket")
3233
```
3334

34-
See the next section for functionality.
35+
See the next section for the functionality.

docs/make.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
using Documenter, Weave, EconJobMarket
2+
const DOCSPATH = realpath(joinpath(dirname(pathof(EconJobMarket)), "..", "docs"))
3+
joinpath(DOCSPATH, "src") |>
4+
(dir -> isdir(dir) || mkdir(dir))
5+
foreach(rm, joinpath(DOCSPATH, "src", file) for file readdir(joinpath(DOCSPATH, "src")))
6+
foreach(filepath -> weave(joinpath(DOCSPATH, "jmd", filepath),
7+
out_path = joinpath(DOCSPATH, "src"),
8+
doctype = "github"),
9+
readdir(joinpath(DOCSPATH, "jmd")))
210
DocMeta.setdocmeta!(EconJobMarket, :DocTestSetup, :(using EconJobMarket), recursive = true)
3-
for file readdir(joinpath(dirname(pathof(EconJobMarket)), "..", "docs", "jmd"))
4-
weave(joinpath(dirname(pathof(EconJobMarket)), "..", "docs", "jmd", file),
5-
out_path = joinpath(dirname(pathof(EconJobMarket)), "..", "docs", "src"),
6-
doctype = "github")
7-
end
8-
makedocs(format = Documenter.HTML(),
11+
makedocs(root = DOCSPATH,
12+
format = Documenter.HTML(),
913
modules = [EconJobMarket],
1014
sitename = "EconJobMarket.jl",
1115
pages = ["Introduction" => "index.md",
12-
"API" => "api.md"]
13-
)
16+
"API" => "api.md"])
1417
deploydocs(repo = "github.com/Nosferican/EconJobMarket.jl.git")

src/utils.jl renamed to src/01_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ julia> EconJobMarket.clean_name(Symbol("3This is a Cat:egory!4cΩ"))
88
```
99
"""
1010
clean_name(obj)::Symbol =
11-
join(isascii(x) ? lowercase(x) : x for x in string(obj)) |>
11+
join(isascii(elem) ? lowercase(elem) : elem for elem string(obj)) |>
1212
normalizename

src/job_ads.jl renamed to src/02_job_ads.jl

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
22
OPENINGS_URL::String
3-
URL for accessing the public data for job opening advertisements in JSON format from EconJobMarket.
3+
[URL](https://backend.econjobmarket.org/data/zz_public/json/Ads) for accessing the public data for job opening advertisements in JSON format from EconJobMarket.
44
"""
55
const OPENINGS_URL = "https://backend.econjobmarket.org/data/zz_public/json/Ads"
66
"""
77
CATEGORIES_URL::String
8-
URL for accessing the public data for job opening categories in JSON format from EconJobMarket.
8+
[URL](https://backend.econjobmarket.org/data/zz_public/json/Categories) for accessing the public data for job opening categories in JSON format from EconJobMarket.
99
"""
1010
const CATEGORIES_URL = "https://backend.econjobmarket.org/data/zz_public/json/Categories"
1111
"""
@@ -19,17 +19,33 @@ const CATEGORIES = JSON3.read(read(joinpath(dirname(@__DIR__), "data", "Categori
1919
Given a string, it provides indicators for whether the job ad listed each opening category.
2020
2121
# Example
22-
```julia-repl
22+
```jldoctest
2323
julia> EconJobMarket.categories_indicator("2,3")
24+
34-element BitArray{1}:
25+
0
26+
1
27+
1
28+
0
29+
0
30+
0
31+
0
32+
0
33+
0
34+
0
35+
36+
0
37+
0
38+
0
39+
0
40+
0
41+
0
42+
0
43+
0
44+
0
2445
```
2546
"""
26-
function categories_indicator(obj::AbstractString)
27-
output = BitVector(undef, 34)
28-
for elem in eachmatch(r"\d+", obj)
29-
output[parse(Int, elem.match)] = true
30-
end
31-
output
32-
end
47+
categories_indicator(obj::AbstractString) =
48+
1:34 .∈ Ref([ parse(Int, elem.match) for elem eachmatch(r"\d+", obj) ])
3349
"""
3450
parse_opening(node)::NamedTuple
3551
For each opening, it parses the information.
@@ -42,8 +58,8 @@ function parse_opening(node)
4258
position_type = isnothing(node.position_type) ? missing : node.position_type
4359
adtext =
4460
reduce((x, y) -> "$x $y",
45-
nodeText(node) for node in eachmatch(Selector("body"),
46-
parsehtml(node.adtitle).root))
61+
nodeText(node) for node eachmatch(Selector("body"),
62+
parsehtml(node.adtitle).root))
4763
startdate = isnothing(node.startdate) ? missing : Date(node.startdate)
4864
enddate = isnothing(node.enddate) ? missing : Date(node.enddate)
4965
country_code = isnothing(node.country_code) ? missing : node.country_code
@@ -55,7 +71,7 @@ function parse_opening(node)
5571
latitude = isnothing(node.latitude) ? missing : parse(Float64, node.latitude)
5672
name = isnothing(node.name) ? missing : node.shortname
5773
cats = isnothing(node.categories) ? missing : categories_indicator(node.categories)
58-
(; zip(Tuple(Symbol(clean_name(elem)) for elem in propertynames(node)
74+
(; zip(Tuple(Symbol(clean_name(elem)) for elem propertynames(node)
5975
if clean_name(elem) "categories"),
6076
(posid, oid, adtitle, position_type_id, position_type,
6177
adtext, startdate, enddate, country_code, position_country,
@@ -68,9 +84,29 @@ Writes a text file with the latest job opening advertisements from EJM.
6884
6985
# Example
7086
```jldoctest
71-
julia> fetch_ads("ads.tsv")
72-
"ads.tsv"
73-
julia> data = CSV.read("ads.tsv");
87+
julia> data = joinpath(dirname(@__DIR__), "data", "ads.tsv") |>
88+
fetch_ads |>
89+
CSV.read;
90+
91+
julia> Tables.schema(data)
92+
Tables.Schema:
93+
:posid Int64
94+
:oid Int64
95+
:adtitle String
96+
:position_type_id Int64
97+
:position_type String
98+
:adtext String
99+
:categories Date
100+
:startdate Date
101+
:enddate Union{Missing, String}
102+
:country_code Union{Missing, String}
103+
:position_country String
104+
:department String
105+
:shortname Union{Missing, String}
106+
:address Union{Missing, Float64}
107+
:longitude Union{Missing, Float64}
108+
:latitude String
109+
:name Bool
74110
```
75111
"""
76112
fetch_ads(filepath::AbstractString; delim::Union{Char,AbstractString} = '\t') =

src/EconJobMarket.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ module EconJobMarket
99
using HTTP: HTTP
1010
using JSON3: JSON3
1111

12-
include("utils.jl")
13-
include("job_ads.jl")
12+
foreach(include,
13+
[ filename for filename readdir(@__DIR__)
14+
if occursin(r"^\d+.*\.jl$", filename) ] |>
15+
sort!)
16+
1417
export CSV, Tables,
18+
Date,
1519
fetch_ads
1620
end

test/runtests.jl

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
using Documenter, Test, Weave, EconJobMarket
2-
for file readdir(joinpath(dirname(pathof(EconJobMarket)), "..", "docs", "jmd"))
3-
weave(joinpath(dirname(pathof(EconJobMarket)), "..", "docs", "jmd", file),
4-
out_path = joinpath(dirname(pathof(EconJobMarket)), "..", "docs", "src"),
5-
doctype = "github")
6-
end
2+
const DOCSPATH = realpath(joinpath(dirname(pathof(EconJobMarket)), "..", "docs"))
3+
joinpath(DOCSPATH, "src") |>
4+
(dir -> isdir(dir) || mkdir(dir))
5+
foreach(rm, joinpath(DOCSPATH, "src", file) for file readdir(joinpath(DOCSPATH, "src")))
6+
foreach(filepath -> weave(joinpath(DOCSPATH, "jmd", filepath),
7+
out_path = joinpath(DOCSPATH, "src"),
8+
doctype = "github"),
9+
readdir(joinpath(DOCSPATH, "jmd")))
710
DocMeta.setdocmeta!(EconJobMarket, :DocTestSetup, :(using EconJobMarket), recursive = true)
8-
makedocs(root = joinpath(dirname(@__DIR__), "docs"),
11+
makedocs(root = DOCSPATH,
912
format = Documenter.HTML(),
1013
modules = [EconJobMarket],
1114
sitename = "EconJobMarket.jl",
1215
pages = ["Introduction" => "index.md",
13-
"API" => "api.md"]
14-
)
16+
"API" => "api.md"])
1517
doctest(EconJobMarket)
16-
@testset "Ads" begin
17-
data = joinpath(dirname(@__DIR__), "data", "ads.tsv") |>
18-
fetch_ads |>
19-
CSV.read;
20-
data = CSV.read(joinpath(dirname(@__DIR__), "data", "ads.tsv"));
21-
@test string(Tables.schema(data)) == "Tables.Schema:\n :posid Int64 \n :oid Int64 \n :adtitle String \n :position_type_id Int64 \n :position_type String \n :adtext String \n :categories Dates.Date \n :startdate Dates.Date \n :enddate Union{Missing, String} \n :country_code Union{Missing, String} \n :position_country String \n :department String \n :shortname Union{Missing, String} \n :address Union{Missing, Float64}\n :longitude Union{Missing, Float64}\n :latitude String \n :name Bool "
22-
end

0 commit comments

Comments
 (0)