yjdata 0.2.0__tar.gz → 0.2.2__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.
Files changed (32) hide show
  1. {yjdata-0.2.0 → yjdata-0.2.2}/PKG-INFO +1 -1
  2. {yjdata-0.2.0 → yjdata-0.2.2}/pyproject.toml +1 -1
  3. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/web/_context.py +21 -14
  4. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata.egg-info/PKG-INFO +1 -1
  5. {yjdata-0.2.0 → yjdata-0.2.2}/README.md +0 -0
  6. {yjdata-0.2.0 → yjdata-0.2.2}/setup.cfg +0 -0
  7. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/__init__.py +0 -0
  8. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/_optional.py +0 -0
  9. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/dataset/__init__.py +0 -0
  10. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/dataset/common.py +0 -0
  11. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/dataset/quote.py +0 -0
  12. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/dataset/snapshot.py +0 -0
  13. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/dataset/trade.py +0 -0
  14. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/db/__init__.py +0 -0
  15. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/db/adapter.py +0 -0
  16. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/db/expression.py +0 -0
  17. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/db/mysql.py +0 -0
  18. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/db/postgres.py +0 -0
  19. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/db/sql.py +0 -0
  20. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/dtype.py +0 -0
  21. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/utlity/__init__.py +0 -0
  22. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/utlity/s3.py +0 -0
  23. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/web/__init__.py +0 -0
  24. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/web/_input.py +0 -0
  25. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/web/calendar.py +0 -0
  26. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/web/client.py +0 -0
  27. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata/web/time_util.py +0 -0
  28. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata.egg-info/SOURCES.txt +0 -0
  29. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata.egg-info/dependency_links.txt +0 -0
  30. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata.egg-info/requires.txt +0 -0
  31. {yjdata-0.2.0 → yjdata-0.2.2}/src/yjdata.egg-info/top_level.txt +0 -0
  32. {yjdata-0.2.0 → yjdata-0.2.2}/tests/test_last_of_group.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yjdata
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: yjdata SDK for Python
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "yjdata"
7
- version = "0.2.0"
7
+ version = "0.2.2"
8
8
  description = "yjdata SDK for Python"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -40,64 +40,71 @@ class RequestContext(abc.ABC):
40
40
  def post_model_list(self, model: Type[T], url: str, payload: dict, **kwargs):
41
41
  pass
42
42
 
43
+ @staticmethod
44
+ def _proc_args(kwargs: dict):
45
+ return {
46
+ **kwargs,
47
+ 'follow_redirects': True
48
+ }
49
+
43
50
 
44
51
  class SyncRequestContext(RequestContext):
45
52
  def __init__(self):
46
- self._client = httpx.Client()
53
+ self._client = httpx.Client(verify=False)
47
54
 
48
55
  def get(self, url: str, **kwargs):
49
- res = self._client.get(url, **kwargs)
56
+ res = self._client.get(url, **self._proc_args(kwargs))
50
57
  res.raise_for_status()
51
58
  return res.json()
52
59
 
53
60
  def get_model(self, model: Type[T], url: str, **kwargs) -> List[T]:
54
- res = self.get(url, **kwargs)
61
+ res = self.get(url, **self._proc_args(kwargs))
55
62
  return model.model_validate(res)
56
63
 
57
64
  def get_model_list(self, model: Type[T], url: str, **kwargs) -> List[T]:
58
- res = self.get(url, **kwargs)
65
+ res = self.get(url, **self._proc_args(kwargs))
59
66
  return [model.model_validate(x) for x in res]
60
67
 
61
68
  def post(self, url: str, payload: dict, **kwargs):
62
- res = self._client.post(url, json=payload, **kwargs)
69
+ res = self._client.post(url, json=payload, **self._proc_args(kwargs))
63
70
  res.raise_for_status()
64
71
  return res.json()
65
72
 
66
73
  def post_model(self, model: Type[T], url: str, payload: dict, **kwargs) -> T:
67
- res = self.post(url, payload, **kwargs)
74
+ res = self.post(url, payload, **self._proc_args(kwargs))
68
75
  return model.model_validate(res)
69
76
 
70
77
  def post_model_list(self, model: Type[T], url: str, payload: dict, **kwargs) -> List[T]:
71
- res = self.post(url, payload, **kwargs)
78
+ res = self.post(url, payload, **self._proc_args(kwargs))
72
79
  return [model.model_validate(x) for x in res]
73
80
 
74
81
 
75
82
  class AsyncRequestContext(RequestContext):
76
83
  def __init__(self):
77
- self._client = httpx.AsyncClient()
84
+ self._client = httpx.AsyncClient(verify=False)
78
85
 
79
86
  async def get(self, url: str, **kwargs):
80
- res = await self._client.get(url, **kwargs)
87
+ res = await self._client.get(url, **self._proc_args(kwargs))
81
88
  res.raise_for_status()
82
89
  return res.json()
83
90
 
84
91
  async def get_model(self, model: Type[T], url: str, **kwargs) -> T:
85
- res = await self.get(url, **kwargs)
92
+ res = await self.get(url, **self._proc_args(kwargs))
86
93
  return model.model_validate(res)
87
94
 
88
95
  async def get_model_list(self, model: Type[T], url: str, **kwargs) -> List[T]:
89
- res = await self.get(url, **kwargs)
96
+ res = await self.get(url, **self._proc_args(kwargs))
90
97
  return [model.model_validate(x) for x in res]
91
98
 
92
99
  async def post(self, url: str, payload: dict, **kwargs):
93
- res = await self._client.post(url, json=payload, **kwargs)
100
+ res = await self._client.post(url, json=payload, **self._proc_args(kwargs))
94
101
  res.raise_for_status()
95
102
  return res.json()
96
103
 
97
104
  async def post_model(self, model: Type[T], url: str, payload: dict, **kwargs) -> T:
98
- res = await self.post(url, payload, **kwargs)
105
+ res = await self.post(url, payload, **self._proc_args(kwargs))
99
106
  return model.model_validate(res)
100
107
 
101
108
  async def post_model_list(self, model: Type[T], url: str, payload: dict, **kwargs) -> List[T]:
102
- res = await self.post(url, payload, **kwargs)
109
+ res = await self.post(url, payload, **self._proc_args(kwargs))
103
110
  return [model.model_validate(x) for x in res]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yjdata
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: yjdata SDK for Python
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes