Skip to content

Commit 13eda91

Browse files
Merge pull request vuejs#26 from American-Soccer-Analysis/asa-213-mlsnp
ASA-213: Added mlsnp to list of valid leagues
2 parents e1aecf4 + 1211831 commit 13eda91

File tree

7 files changed

+13
-5
lines changed

7 files changed

+13
-5
lines changed

R-package/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: itscalledsoccer
22
Title: American Soccer Analysis API Client
3-
Version: 0.1.0
3+
Version: 0.1.1
44
Authors@R:
55
c(
66
person(

R-package/NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
# itscalledsoccer 0.1.1
2+
3+
Added ability to query MLS Next Pro data.
14
# itscalledsoccer 0.1.0
5+
26
Initial release.

R-package/R/client.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AmericanSoccerAnalysis <- R6::R6Class("AmericanSoccerAnalysis",
1111
MAX_API_LIMIT = 1000,
1212

1313
#' @field LEAGUES List of stylized league names.
14-
LEAGUES = c("nwsl", "mls", "uslc", "usl1", "nasl"),
14+
LEAGUES = c("nwsl", "mls", "uslc", "usl1", "nasl", "mlsnp"),
1515

1616
#' @field base_url API base URL.
1717
base_url = NULL,

python-package/itscalledsoccer/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AmericanSoccerAnalysis:
1313

1414
API_VERSION = "v1"
1515
BASE_URL = f"https://app.americansocceranalysis.com/api/{API_VERSION}/"
16-
LEAGUES = ["nwsl", "mls", "uslc", "usl1", "nasl"]
16+
LEAGUES = ["nwsl", "mls", "uslc", "usl1", "nasl", "mlsnp"]
1717
MAX_API_LIMIT = 1000
1818
LOGGER = getLogger(__name__)
1919

@@ -94,6 +94,9 @@ def _convert_name_to_id(self, type: str, name: str) -> str:
9494
lookup = self.teams
9595
names = self.teams["team_name"].to_list()
9696

97+
# Getting back nan from the API for some names
98+
names = [n for n in names if pd.isnull(n) == False]
99+
97100
matches = process.extractOne(name, names, scorer=fuzz.partial_ratio)
98101
if matches:
99102
if matches[1] >= min_score:

python-package/requirements.dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ CacheControl==0.12.6
44
rapidfuzz==1.9.1
55
behave==1.2.6
66
pandas==1.3.1
7-
black==21.11.b1
7+
black==22.3.0
88
mypy==0.910
99
isort==5.10.1

python-package/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setup(
77
name="itscalledsoccer",
88
packages=find_packages(exclude=["tests", "tests.*"]),
9-
version="0.1.4",
9+
version="0.1.5",
1010
description="Programmatically interact with the American Soccer Analysis API",
1111
long_description=long_description,
1212
long_description_content_type = "text/markdown",

python-package/tests/features/client.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Feature: Client initialization
1717
| uslc |
1818
| usl1 |
1919
| nasl |
20+
| mlsnp |
2021

2122
Scenario: An ASA client has a default logger
2223
Given there is an ASA client

0 commit comments

Comments
 (0)