ctftime-api 0.1.2__tar.gz → 0.1.3__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.1.2 → ctftime_api-0.1.3}/PKG-INFO +7 -1
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/client.py +8 -5
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/models/__init__.py +2 -2
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/models/duration.py +0 -1
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/models/event.py +1 -1
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/models/team.py +0 -1
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/models/vote.py +0 -1
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/pyproject.toml +10 -1
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/LICENSE +0 -0
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/README.md +0 -0
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/__init__.py +0 -0
- {ctftime_api-0.1.2 → ctftime_api-0.1.3}/ctftime_api/models/rating.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: ctftime_api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: CTFTime API wrapper
|
|
5
5
|
Keywords: ctftime,api,wrapper
|
|
6
6
|
Author: John Toniutti
|
|
@@ -18,10 +18,16 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
18
18
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
20
|
Classifier: Typing :: Typed
|
|
21
|
+
Provides-Extra: speed
|
|
22
|
+
Requires-Dist: brotli (>=1.1.0,<2.0.0) ; (platform_python_implementation == "CPython") and (extra == "speed")
|
|
23
|
+
Requires-Dist: brotlicffi (>=1.1.0.0,<2.0.0.0) ; (platform_python_implementation != "CPython") and (extra == "speed")
|
|
24
|
+
Requires-Dist: h2 (>=4.2.0,<5.0.0) ; extra == "speed"
|
|
21
25
|
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
22
26
|
Requires-Dist: pycountry (>=24.6.1,<25.0.0)
|
|
23
27
|
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
|
|
24
28
|
Requires-Dist: pydantic-extra-types (>=2.10.2,<3.0.0)
|
|
29
|
+
Requires-Dist: uvloop (>=0.21.0,<1.0.0) ; (sys_platform != "win32") and (extra == "speed")
|
|
30
|
+
Requires-Dist: zstandard (>=0.23.0,<0.24.0) ; extra == "speed"
|
|
25
31
|
Project-URL: Documentation, https://jotonedev.github.io/ctftime_api/
|
|
26
32
|
Project-URL: Repository, https://github.com/jotonedev/ctftime_api
|
|
27
33
|
Description-Content-Type: text/markdown
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
+
import importlib.util
|
|
1
2
|
from datetime import datetime
|
|
2
3
|
from typing import Any
|
|
3
4
|
|
|
4
5
|
import httpx
|
|
5
6
|
from httpx import URL, Timeout
|
|
6
|
-
|
|
7
7
|
from pydantic_extra_types.country import CountryAlpha2
|
|
8
8
|
|
|
9
|
-
from ctftime_api.models.vote import Vote
|
|
10
9
|
from ctftime_api.models.event import Event, EventResult
|
|
11
10
|
from ctftime_api.models.team import TeamRank, Team, TeamComplete
|
|
11
|
+
from ctftime_api.models.vote import Vote
|
|
12
12
|
|
|
13
13
|
__all__ = ["CTFTimeClient"]
|
|
14
14
|
|
|
15
|
+
h2 = importlib.util.find_spec("httpcore.h2")
|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
class CTFTimeClient:
|
|
17
|
-
def __init__(self, client: httpx.AsyncClient | None = None,
|
|
19
|
+
def __init__(self, client: httpx.AsyncClient | None = None, **kwargs):
|
|
18
20
|
"""
|
|
19
21
|
Initialize the CTFTime API client.
|
|
20
22
|
:param client: The httpx.AsyncClient to use. If None, a new client will be created.
|
|
21
|
-
:param args: Args that will be passed to the httpx.AsyncClient constructor.
|
|
22
23
|
:param kwargs: Kwargs that will be passed to the httpx.AsyncClient constructor.
|
|
23
24
|
"""
|
|
24
25
|
if client is not None:
|
|
25
26
|
self._client = client
|
|
26
27
|
else:
|
|
27
|
-
|
|
28
|
+
if h2 is not None:
|
|
29
|
+
kwargs.setdefault("http2", True)
|
|
30
|
+
self._client = httpx.AsyncClient(**kwargs)
|
|
28
31
|
self._base_url = URL("https://ctftime.org/api/v1/")
|
|
29
32
|
|
|
30
33
|
async def _get(self, url: str | URL, **kwargs) -> Any:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
from .duration import Duration
|
|
1
2
|
from .event import Event, EventResult
|
|
2
|
-
from .team import Team, TeamComplete, BaseTeam, TeamRank, TeamResult
|
|
3
3
|
from .rating import Rating
|
|
4
|
-
from .
|
|
4
|
+
from .team import Team, TeamComplete, BaseTeam, TeamRank, TeamResult
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ctftime_api"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
4
4
|
description = "CTFTime API wrapper"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "John Toniutti",email = "john.toniutti@gmail.com"}
|
|
@@ -29,6 +29,15 @@ dependencies = [
|
|
|
29
29
|
"pycountry (>=24.6.1,<25.0.0)",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
speed = [
|
|
34
|
+
"uvloop (>=0.21.0,<1.0.0) ; sys_platform != 'win32'",
|
|
35
|
+
"brotli (>=1.1.0,<2.0.0) ; platform_python_implementation == 'CPython' ",
|
|
36
|
+
"brotlicffi (>=1.1.0.0,<2.0.0.0) ; platform_python_implementation != 'CPython' ",
|
|
37
|
+
"h2 (>=4.2.0,<5.0.0)",
|
|
38
|
+
"zstandard (>=0.23.0,<0.24.0)",
|
|
39
|
+
]
|
|
40
|
+
|
|
32
41
|
[project.urls]
|
|
33
42
|
repository = "https://github.com/jotonedev/ctftime_api"
|
|
34
43
|
documentation = "https://jotonedev.github.io/ctftime_api/"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|