ctftime-api 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.github/workflows/codeql.yml +3 -3
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.github/workflows/docs.yml +2 -2
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.github/workflows/publish.yml +4 -4
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.github/workflows/test.yml +2 -2
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/PKG-INFO +4 -2
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/README.md +2 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/client.py +5 -6
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/team.py +1 -1
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/pyproject.toml +3 -3
- ctftime_api-0.3.0/uv.lock +2354 -0
- ctftime_api-0.2.0/uv.lock +0 -1709
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.github/dependabot.yml +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.github/workflows/cleanup.yml +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/.gitignore +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/LICENSE +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/__init__.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/__init__.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/country.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/duration.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/event.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/rating.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/models/vote.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/ctftime_api/py.typed +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/api/client.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/api/models/duration.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/api/models/event.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/api/models/rating.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/api/models/team.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/api/models/vote.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/assets/fonts/inter/italic.woff2 +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/assets/fonts/inter/italic_ext.woff2 +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/assets/fonts/inter/normal.woff2 +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/assets/fonts/inter/normal_ext.woff2 +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/assets/fonts/jetbrains_mono/normal.woff2 +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/assets/fonts/jetbrains_mono/normal_ext.woff2 +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/index.md +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/docs/stylesheets/fonts.css +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/examples/test_methods/main.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/justfile +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/mkdocs.yml +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/tests/__init__.py +0 -0
- {ctftime_api-0.2.0 → ctftime_api-0.3.0}/tests/test_client.py +0 -0
|
@@ -21,17 +21,17 @@ jobs:
|
|
|
21
21
|
build-mode: none
|
|
22
22
|
steps:
|
|
23
23
|
- name: Checkout repository
|
|
24
|
-
uses: actions/checkout@
|
|
24
|
+
uses: actions/checkout@v6
|
|
25
25
|
|
|
26
26
|
# Initializes the CodeQL tools for scanning.
|
|
27
27
|
- name: Initialize CodeQL
|
|
28
|
-
uses: github/codeql-action/init@
|
|
28
|
+
uses: github/codeql-action/init@v4
|
|
29
29
|
with:
|
|
30
30
|
languages: ${{ matrix.language }}
|
|
31
31
|
build-mode: ${{ matrix.build-mode }}
|
|
32
32
|
queries: security-extended,security-and-quality
|
|
33
33
|
|
|
34
34
|
- name: Perform CodeQL Analysis
|
|
35
|
-
uses: github/codeql-action/analyze@
|
|
35
|
+
uses: github/codeql-action/analyze@v4
|
|
36
36
|
with:
|
|
37
37
|
category: "/language:${{matrix.language}}"
|
|
@@ -21,10 +21,10 @@ jobs:
|
|
|
21
21
|
|
|
22
22
|
steps:
|
|
23
23
|
- name: Checkout code
|
|
24
|
-
uses: actions/checkout@
|
|
24
|
+
uses: actions/checkout@v6
|
|
25
25
|
|
|
26
26
|
- name: Install uv
|
|
27
|
-
uses: astral-sh/setup-uv@
|
|
27
|
+
uses: astral-sh/setup-uv@v7
|
|
28
28
|
with:
|
|
29
29
|
enable-cache: true
|
|
30
30
|
cache-dependency-glob: "uv.lock"
|
|
@@ -27,10 +27,10 @@ jobs:
|
|
|
27
27
|
|
|
28
28
|
steps:
|
|
29
29
|
- name: Checkout code
|
|
30
|
-
uses: actions/checkout@
|
|
30
|
+
uses: actions/checkout@v6
|
|
31
31
|
|
|
32
32
|
- name: Install uv
|
|
33
|
-
uses: astral-sh/setup-uv@
|
|
33
|
+
uses: astral-sh/setup-uv@v7
|
|
34
34
|
with:
|
|
35
35
|
enable-cache: true
|
|
36
36
|
cache-dependency-glob: "uv.lock"
|
|
@@ -56,7 +56,7 @@ jobs:
|
|
|
56
56
|
|
|
57
57
|
- name: Upload build artifacts
|
|
58
58
|
id: upload
|
|
59
|
-
uses: actions/upload-artifact@
|
|
59
|
+
uses: actions/upload-artifact@v6
|
|
60
60
|
with:
|
|
61
61
|
name: release-dists
|
|
62
62
|
retention-days: 1
|
|
@@ -78,7 +78,7 @@ jobs:
|
|
|
78
78
|
steps:
|
|
79
79
|
- name: Retrieve release distributions
|
|
80
80
|
id: download
|
|
81
|
-
uses: actions/download-artifact@
|
|
81
|
+
uses: actions/download-artifact@v7
|
|
82
82
|
with:
|
|
83
83
|
name: release-dists
|
|
84
84
|
path: dist/
|
|
@@ -22,10 +22,10 @@ jobs:
|
|
|
22
22
|
contents: read
|
|
23
23
|
|
|
24
24
|
steps:
|
|
25
|
-
- uses: actions/checkout@
|
|
25
|
+
- uses: actions/checkout@v6
|
|
26
26
|
|
|
27
27
|
- name: Install uv
|
|
28
|
-
uses: astral-sh/setup-uv@
|
|
28
|
+
uses: astral-sh/setup-uv@v7
|
|
29
29
|
with:
|
|
30
30
|
enable-cache: true
|
|
31
31
|
cache-dependency-glob: "uv.lock"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: ctftime_api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: CTFTime API wrapper
|
|
5
5
|
Project-URL: repository, https://github.com/jotonedev/ctftime_api
|
|
6
6
|
Project-URL: documentation, https://jotonedev.github.io/ctftime_api/
|
|
@@ -60,6 +60,7 @@ Create a client to interact with the CTFTime API. For example, to get the top te
|
|
|
60
60
|
import asyncio
|
|
61
61
|
from ctftime_api.client import CTFTimeClient
|
|
62
62
|
|
|
63
|
+
|
|
63
64
|
async def main():
|
|
64
65
|
client = CTFTimeClient()
|
|
65
66
|
top_teams = await client.get_top_teams_per_year()
|
|
@@ -67,6 +68,7 @@ async def main():
|
|
|
67
68
|
print(f"{team.name} (ID: {team.id}) - Points: {team.points}")
|
|
68
69
|
await client.close()
|
|
69
70
|
|
|
71
|
+
|
|
70
72
|
asyncio.run(main())
|
|
71
73
|
```
|
|
72
74
|
|
|
@@ -29,6 +29,7 @@ Create a client to interact with the CTFTime API. For example, to get the top te
|
|
|
29
29
|
import asyncio
|
|
30
30
|
from ctftime_api.client import CTFTimeClient
|
|
31
31
|
|
|
32
|
+
|
|
32
33
|
async def main():
|
|
33
34
|
client = CTFTimeClient()
|
|
34
35
|
top_teams = await client.get_top_teams_per_year()
|
|
@@ -36,6 +37,7 @@ async def main():
|
|
|
36
37
|
print(f"{team.name} (ID: {team.id}) - Points: {team.points}")
|
|
37
38
|
await client.close()
|
|
38
39
|
|
|
40
|
+
|
|
39
41
|
asyncio.run(main())
|
|
40
42
|
```
|
|
41
43
|
|
|
@@ -78,11 +78,10 @@ class CTFTimeClient:
|
|
|
78
78
|
:raise httpx.HTTPStatusError: If the response status code is not successful.
|
|
79
79
|
:raise ValueError: If the country is not a two-letter country code or a pycountry Country object.
|
|
80
80
|
"""
|
|
81
|
-
if isinstance(country, str):
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
)
|
|
81
|
+
if isinstance(country, str) and len(country) != 2:
|
|
82
|
+
raise ValueError(
|
|
83
|
+
"Country must be a two-letter country code or a pycountry Country object."
|
|
84
|
+
)
|
|
86
85
|
|
|
87
86
|
url = self._base_url.join("top-by-country/").join(f"{country}/")
|
|
88
87
|
teams: list[dict[str, Any]] = await self._get(url)
|
|
@@ -184,7 +183,7 @@ class CTFTimeClient:
|
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
async def get_votes_per_year(
|
|
187
|
-
self, year: int | None, timeout: Timeout |
|
|
186
|
+
self, year: int | None, timeout: Timeout | float | None = None
|
|
188
187
|
) -> list[Vote]:
|
|
189
188
|
"""
|
|
190
189
|
Get the votes for a specific year.
|
|
@@ -6,7 +6,7 @@ from yarl import URL
|
|
|
6
6
|
from .country import CountryCode
|
|
7
7
|
from .rating import Rating
|
|
8
8
|
|
|
9
|
-
__all__ = ["BaseTeam", "Team", "
|
|
9
|
+
__all__ = ["BaseTeam", "Team", "TeamComplete", "TeamRank", "TeamResult"]
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@dataclass_json(undefined=Undefined.EXCLUDE)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ctftime_api"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = "CTFTime API wrapper"
|
|
5
5
|
authors = [{ name = "John Toniutti", email = "john.toniutti@gmail.com" }]
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -45,8 +45,8 @@ documentation = "https://jotonedev.github.io/ctftime_api/"
|
|
|
45
45
|
[dependency-groups]
|
|
46
46
|
dev = [
|
|
47
47
|
"ruff~=0.9",
|
|
48
|
-
"pytest
|
|
49
|
-
"pytest-cov
|
|
48
|
+
"pytest>=8.3,<10.0",
|
|
49
|
+
"pytest-cov>=6.1,<8.0",
|
|
50
50
|
"pytest-asyncio>=0.24,<2.0",
|
|
51
51
|
"mypy~=1.11",
|
|
52
52
|
]
|