db2_hj3415 0.1.8__tar.gz → 0.1.9__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 (40) hide show
  1. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/PKG-INFO +1 -1
  2. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/_ops.py +19 -0
  3. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/models.py +4 -0
  4. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/pyproject.toml +1 -1
  5. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/README.md +0 -0
  6. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/__init__.py +0 -0
  7. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/cli/__init__.py +0 -0
  8. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/cli/db.py +0 -0
  9. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/common/__init__.py +0 -0
  10. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/common/connection.py +0 -0
  11. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/common/db_ops.py +0 -0
  12. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/common/utils.py +0 -0
  13. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/__init__.py +0 -0
  14. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/_ops.py +0 -0
  15. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/aud.py +0 -0
  16. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/chf.py +0 -0
  17. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/gbond3y.py +0 -0
  18. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/gold.py +0 -0
  19. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/kosdaq.py +0 -0
  20. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/kospi.py +0 -0
  21. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/silver.py +0 -0
  22. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/sp500.py +0 -0
  23. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/usdidx.py +0 -0
  24. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/usdkrw.py +0 -0
  25. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/mi/wti.py +0 -0
  26. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/__init__.py +0 -0
  27. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/_c10346.py +0 -0
  28. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/c101.py +0 -0
  29. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/c103.py +0 -0
  30. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/c104.py +0 -0
  31. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/c106.py +0 -0
  32. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/c108.py +0 -0
  33. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/nfs/dart.py +0 -0
  34. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/__init__.py +0 -0
  35. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/_ops.py +0 -0
  36. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/blue.py +0 -0
  37. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/growth.py +0 -0
  38. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/mil.py +0 -0
  39. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/models.py +0 -0
  40. {db2_hj3415-0.1.8 → db2_hj3415-0.1.9}/db2_hj3415/valuation/red.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db2_hj3415
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Gathering the stock data by playwright
5
5
  Author-email: Hyungjin Kim <hj3415@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,6 @@
1
1
  from motor.motor_asyncio import AsyncIOMotorClient
2
2
  from db2_hj3415.nfs import DB_NAME, connection
3
+ from db2_hj3415.nfs.models import CodeName
3
4
 
4
5
 
5
6
  async def get_all_codes(client: AsyncIOMotorClient) -> list[str]:
@@ -47,6 +48,24 @@ def get_all_codes_sync() -> list[str]:
47
48
  connection.close_mongo_client_sync()
48
49
 
49
50
 
51
+ async def get_all_codes_names(client: AsyncIOMotorClient) -> list[CodeName]:
52
+ collection = client[DB_NAME]['c101']
53
+ cursor = collection.find({}, {"코드": 1, "종목명": 1, "_id": 0})
54
+ result = []
55
+ async for doc in cursor:
56
+ result.append(CodeName(**doc))
57
+ return result
58
+
59
+
60
+ def get_all_codes_names_sync() -> list[CodeName] | None:
61
+ client = connection.get_mongo_client_sync()
62
+ try:
63
+ collection = client[DB_NAME]['c101']
64
+ cursor = collection.find({}, {"코드": 1, "종목명": 1, "_id": 0})
65
+ return [CodeName(**doc) for doc in cursor]
66
+ finally:
67
+ connection.close_mongo_client_sync()
68
+
50
69
  async def delete_code_from_all_collections(code: str, client: AsyncIOMotorClient) -> dict[str, int]:
51
70
  db = client[DB_NAME]
52
71
 
@@ -1,6 +1,10 @@
1
1
  from pydantic import BaseModel, Field, field_serializer, ConfigDict, field_validator
2
2
  from datetime import datetime
3
3
 
4
+ class CodeName(BaseModel):
5
+ 코드: str
6
+ 종목명: str | None
7
+
4
8
  class C101(BaseModel):
5
9
  id: str | None = Field(default=None, alias="_id")
6
10
  코드: str
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "db2_hj3415"
7
- version = "0.1.8"
7
+ version = "0.1.9"
8
8
  authors = [{name = "Hyungjin Kim", email = "hj3415@gmail.com"}]
9
9
  description = "Gathering the stock data by playwright"
10
10
  readme = "README.md"
File without changes