eth-portfolio-temp 0.2.2.dev0__tar.gz → 0.2.4.dev0__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.

Potentially problematic release.


This version of eth-portfolio-temp might be problematic. Click here for more details.

Files changed (114) hide show
  1. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.github/workflows/compile.yaml +2 -2
  2. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/PKG-INFO +3 -3
  3. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_utils.py +5 -4
  4. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/portfolio.py +1 -1
  5. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/_portfolio.py +17 -12
  6. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/_utils.py +20 -6
  7. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/balances.py +2 -3
  8. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/PKG-INFO +3 -3
  9. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/requires.txt +1 -1
  10. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/pyproject.toml +1 -1
  11. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/requirements.txt +1 -1
  12. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/setup.py +1 -1
  13. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.env.sample +0 -0
  14. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.github/workflows/black.yaml +0 -0
  15. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.github/workflows/deploy_docs.yaml +0 -0
  16. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.github/workflows/mypy.yaml +0 -0
  17. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.github/workflows/release.yaml +0 -0
  18. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/.gitignore +0 -0
  19. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/Makefile +0 -0
  20. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/README.md +0 -0
  21. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/brownie-config.yaml +0 -0
  22. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/Makefile +0 -0
  23. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/alabaster.css +0 -0
  24. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/basic.css +0 -0
  25. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/custom.css +0 -0
  26. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/doctools.js +0 -0
  27. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/documentation_options.js +0 -0
  28. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/file.png +0 -0
  29. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/language_data.js +0 -0
  30. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/minus.png +0 -0
  31. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/plus.png +0 -0
  32. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/pygments.css +0 -0
  33. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/searchtools.js +0 -0
  34. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/_build/html/_static/sphinx_highlight.js +0 -0
  35. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/caching.rst +0 -0
  36. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/conf.py +0 -0
  37. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/exporter.rst +0 -0
  38. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/index.rst +0 -0
  39. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/make.bat +0 -0
  40. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/docs/new-protocols.rst +0 -0
  41. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/__init__.py +0 -0
  42. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_argspec.py +0 -0
  43. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_cache.py +0 -0
  44. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_config.py +0 -0
  45. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_db/__init__.py +0 -0
  46. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_db/decorators.py +0 -0
  47. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_db/entities.py +0 -0
  48. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_db/utils.py +0 -0
  49. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_decimal.py +0 -0
  50. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_decorators.py +0 -0
  51. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_exceptions.py +0 -0
  52. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_ledgers/__init__.py +0 -0
  53. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_ledgers/address.py +0 -0
  54. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_ledgers/portfolio.py +0 -0
  55. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_loaders/__init__.py +0 -0
  56. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_loaders/_nonce.py +0 -0
  57. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_loaders/balances.py +0 -0
  58. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_loaders/token_transfer.py +0 -0
  59. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_loaders/transaction.py +0 -0
  60. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_loaders/utils.py +0 -0
  61. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_shitcoins.py +0 -0
  62. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_stableish.py +0 -0
  63. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_submodules.py +0 -0
  64. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_ydb/__init__.py +0 -0
  65. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/_ydb/token_transfers.py +0 -0
  66. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/address.py +0 -0
  67. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/buckets.py +0 -0
  68. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/constants.py +0 -0
  69. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/__init__.py +0 -0
  70. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/_base.py +0 -0
  71. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/convex.py +0 -0
  72. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/dsr.py +0 -0
  73. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/README.md +0 -0
  74. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/__init__.py +0 -0
  75. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/_base.py +0 -0
  76. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/compound.py +0 -0
  77. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/liquity.py +0 -0
  78. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/maker.py +0 -0
  79. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/lending/unit.py +0 -0
  80. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/protocols/liquity.py +0 -0
  81. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/py.typed +0 -0
  82. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/structs/__init__.py +0 -0
  83. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/structs/modified.py +0 -0
  84. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/structs/structs.py +0 -0
  85. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/typing/__init__.py +0 -0
  86. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio/typing/balance/single.py +0 -0
  87. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/__init__.py +0 -0
  88. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/_args.py +0 -0
  89. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/_logging.py +0 -0
  90. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/.grafana/dashboards/Portfolio/Balances.json +0 -0
  91. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/.grafana/dashboards/dashboards.yaml +0 -0
  92. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/.grafana/datasources/datasources.yml +0 -0
  93. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/__init__.py +0 -0
  94. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/check.py +0 -0
  95. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/docker-compose.yaml +0 -0
  96. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/docker/docker_compose.py +0 -0
  97. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/main.py +0 -0
  98. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/py.typed +0 -0
  99. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/victoria/__init__.py +0 -0
  100. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_scripts/victoria/types.py +0 -0
  101. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/SOURCES.txt +0 -0
  102. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/dependency_links.txt +0 -0
  103. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/entry_points.txt +0 -0
  104. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/not-zip-safe +0 -0
  105. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/eth_portfolio_temp.egg-info/top_level.txt +0 -0
  106. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/renovate.json +0 -0
  107. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/setup.cfg +0 -0
  108. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/_test_completeness.py +0 -0
  109. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/conftest.py +0 -0
  110. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/fixtures.py +0 -0
  111. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/protocols/test_external.py +0 -0
  112. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/scripts/test_utils.py +0 -0
  113. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/test_portfolio.py +0 -0
  114. {eth_portfolio_temp-0.2.2.dev0 → eth_portfolio_temp-0.2.4.dev0}/tests/test_typing.py +0 -0
@@ -19,10 +19,10 @@ jobs:
19
19
  # Check out the PR branch
20
20
  ref: ${{ github.head_ref }}
21
21
 
22
- - name: Set up Python 3.12
22
+ - name: Set up Python 3.13
23
23
  uses: actions/setup-python@v6
24
24
  with:
25
- python-version: "3.12"
25
+ python-version: "3.13"
26
26
 
27
27
  - name: Install Requirements
28
28
  run: pip install -r requirements.txt
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eth_portfolio_temp
3
- Version: 0.2.2.dev0
3
+ Version: 0.2.4.dev0
4
4
  Summary: eth-portfolio makes it easy to analyze your portfolio.
5
5
  Home-page: https://github.com/BobTheBuidler/eth-portfolio
6
6
  Author: BobTheBuidler
7
7
  Author-email: bobthebuidlerdefi@gmail.com
8
- Requires-Python: >=3.10,<3.13
8
+ Requires-Python: >=3.10,<3.14
9
9
  Requires-Dist: checksum_dict>=2.1.7
10
10
  Requires-Dist: dank_mids>=4.20.154
11
11
  Requires-Dist: eth-brownie<1.23,>=1.21.0
@@ -16,7 +16,7 @@ Requires-Dist: faster-eth-utils
16
16
  Requires-Dist: numpy<3
17
17
  Requires-Dist: pandas<3,>=1.4.3
18
18
  Requires-Dist: typed-envs>=0.0.9
19
- Requires-Dist: ypricemagic<5,>=4.6.28.dev0
19
+ Requires-Dist: ypricemagic<5,>=4.6.29.dev0
20
20
  Dynamic: author
21
21
  Dynamic: author-email
22
22
  Dynamic: home-page
@@ -136,10 +136,11 @@ async def _get_price(token: AddressOrContract, block: Optional[int] = None) -> _
136
136
  elif isinstance(e.exception, NonStandardERC20):
137
137
  # Can't get symbol for handling like other excs
138
138
  logger.warning(f"NonStandardERC20 while fetching price for {token}")
139
- elif isinstance(e.exception, PriceError) and token not in SUPPRESS_ERROR_LOGS:
140
- logger.warning(
141
- f"PriceError while fetching price for {await _describe_err(token, block)}"
142
- )
139
+ elif isinstance(e.exception, PriceError):
140
+ if token not in SUPPRESS_ERROR_LOGS:
141
+ logger.warning(
142
+ f"PriceError while fetching price for {await _describe_err(token, block)}"
143
+ )
143
144
  else:
144
145
  logger.warning(f"{e} while fetching price for {await _describe_err(token, block)}")
145
146
  logger.warning(e, exc_info=True)
@@ -37,7 +37,7 @@ from eth_portfolio.typing import Addresses, PortfolioBalances
37
37
  logger = logging.getLogger(__name__)
38
38
 
39
39
 
40
- class PortfolioWallets(Iterable[PortfolioAddress], Dict[Address, PortfolioAddress]): # type: ignore [misc]
40
+ class PortfolioWallets(Iterable[PortfolioAddress], Dict[Address, PortfolioAddress]): # type: ignore [metaclass]
41
41
  """
42
42
  A container that holds all :class:`~eth_portfolio.address.PortfolioAddress` objects for a specific :class:`~eth_portfolio.Portfolio`.
43
43
 
@@ -1,3 +1,4 @@
1
+ import asyncio
1
2
  from datetime import datetime, timezone
2
3
  from logging import getLogger
3
4
  from math import floor
@@ -5,10 +6,11 @@ from typing import Awaitable, Callable, Final, Iterator, List, Optional, Tuple
5
6
 
6
7
  import a_sync
7
8
  import eth_retry
9
+ import y
8
10
  from a_sync.functools import cached_property_unsafe as cached_property
9
11
  from eth_typing import BlockNumber, ChecksumAddress
10
12
  from msgspec import ValidationError, json
11
- from y import ERC20, Network, NonStandardERC20, get_block_at_timestamp
13
+ from y import ERC20, Network, NonStandardERC20
12
14
  from y.constants import CHAINID
13
15
  from y.time import NoBlockFound
14
16
 
@@ -34,6 +36,14 @@ log_debug: Final = logger.debug
34
36
  log_error: Final = logger.error
35
37
 
36
38
 
39
+ async def get_block_at_timestamp(dt: datetime) -> BlockNumber:
40
+ while True:
41
+ try:
42
+ return y.get_block_at_timestamp(dt, sync=False)
43
+ except NoBlockFound:
44
+ await asyncio.sleep(10)
45
+
46
+
37
47
  class ExportablePortfolio(Portfolio):
38
48
  """Adds methods to export full portoflio data."""
39
49
 
@@ -77,17 +87,12 @@ class ExportablePortfolio(Portfolio):
77
87
  async def export_snapshot(self, dt: datetime) -> None:
78
88
  log_debug("checking data at %s for %s", dt, self.label)
79
89
  try:
80
- if not await self.data_exists(dt, sync=False):
81
- while True:
82
- try:
83
- block = await get_block_at_timestamp(dt, sync=False)
84
- except NoBlockFound:
85
- pass
86
- else:
87
- break
88
- log_debug("block at %s: %s", dt, block)
89
- data = await self.get_data_for_export(block, dt, sync=False)
90
- await victoria.post_data(data)
90
+ if await self.data_exists(dt, sync=False):
91
+ return
92
+ block = await get_block_at_timestamp(dt)
93
+ log_debug("block at %s: %s", dt, block)
94
+ data = await self.get_data_for_export(block, dt, sync=False)
95
+ await victoria.post_data(data)
91
96
  except Exception as e:
92
97
  log_error("Error processing %s:", dt, exc_info=True)
93
98
 
@@ -1,18 +1,18 @@
1
1
  import re
2
2
  from asyncio import Task, create_task, sleep
3
3
  from datetime import datetime, timedelta, timezone
4
- from typing import Any, AsyncGenerator, Dict, List, Optional
4
+ from typing import Any, AsyncGenerator, Dict, Final, List, Optional
5
5
 
6
6
  from brownie import chain
7
7
 
8
8
 
9
- def parse_timedelta(value: str) -> timedelta:
10
- regex = re.compile(r"(\d+)([dhms]?)")
11
- result = regex.findall(value)
9
+ timedelta_pattern: Final = re.compile(r"(\d+)([dhms]?)")
10
+
12
11
 
12
+ def parse_timedelta(value: str) -> timedelta:
13
13
  days, hours, minutes, seconds = 0, 0, 0, 0
14
14
 
15
- for val, unit in result:
15
+ for val, unit in timedelta_pattern.findall(value):
16
16
  val = int(val)
17
17
  if unit == "d":
18
18
  days = val
@@ -58,10 +58,24 @@ async def aiter_timestamps(
58
58
 
59
59
  timestamp = start
60
60
 
61
+ timestamps = []
61
62
  while timestamp <= datetime.now(tz=timezone.utc):
62
- yield timestamp
63
+ timestamps.append(timestamp)
63
64
  timestamp = timestamp + interval
64
65
 
66
+ # cycle between yielding earliest, latest, and middle from `timestamps` until complete
67
+ while timestamps:
68
+ # yield the earliest timestamp
69
+ yield timestamps.pop(0)
70
+ # yield the most recent timestamp if there is one
71
+ if timestamps:
72
+ yield timestamps.pop(-1)
73
+ # yield the most middle timestamp if there is one
74
+ if timestamps:
75
+ yield timestamps.pop(len(timestamps) // 2)
76
+
77
+ del timestamps
78
+
65
79
  while run_forever:
66
80
  while timestamp > datetime.now(tz=timezone.utc):
67
81
  await _get_waiter(timestamp)
@@ -34,9 +34,8 @@ async def export_balances(args: Namespace) -> None:
34
34
  )
35
35
 
36
36
  if export_start_block := args.export_start_block or args.first_tx_block:
37
- start = datetime.fromtimestamp(
38
- await dank_mids.eth.get_block_timestamp(args.export_start_block), tz=timezone.utc
39
- )
37
+ start_ts = await dank_mids.eth.get_block_timestamp(export_start_block)
38
+ start = datetime.fromtimestamp(start_ts, tz=timezone.utc)
40
39
  else:
41
40
  start = None
42
41
 
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eth_portfolio_temp
3
- Version: 0.2.2.dev0
3
+ Version: 0.2.4.dev0
4
4
  Summary: eth-portfolio makes it easy to analyze your portfolio.
5
5
  Home-page: https://github.com/BobTheBuidler/eth-portfolio
6
6
  Author: BobTheBuidler
7
7
  Author-email: bobthebuidlerdefi@gmail.com
8
- Requires-Python: >=3.10,<3.13
8
+ Requires-Python: >=3.10,<3.14
9
9
  Requires-Dist: checksum_dict>=2.1.7
10
10
  Requires-Dist: dank_mids>=4.20.154
11
11
  Requires-Dist: eth-brownie<1.23,>=1.21.0
@@ -16,7 +16,7 @@ Requires-Dist: faster-eth-utils
16
16
  Requires-Dist: numpy<3
17
17
  Requires-Dist: pandas<3,>=1.4.3
18
18
  Requires-Dist: typed-envs>=0.0.9
19
- Requires-Dist: ypricemagic<5,>=4.6.28.dev0
19
+ Requires-Dist: ypricemagic<5,>=4.6.29.dev0
20
20
  Dynamic: author
21
21
  Dynamic: author-email
22
22
  Dynamic: home-page
@@ -8,4 +8,4 @@ faster-eth-utils
8
8
  numpy<3
9
9
  pandas<3,>=1.4.3
10
10
  typed-envs>=0.0.9
11
- ypricemagic<5,>=4.6.28.dev0
11
+ ypricemagic<5,>=4.6.29.dev0
@@ -2,7 +2,7 @@
2
2
  requires = [
3
3
  "setuptools",
4
4
  "wheel",
5
- "mypy[mypyc]>=1.17.1,<1.18.0",
5
+ "mypy[mypyc]>=1.18.1,<1.18.2",
6
6
  "types-aiofiles",
7
7
  "eth-brownie==1.21.0; sys_platform=='linux'",
8
8
  "eth-typing==4.4.0",
@@ -8,4 +8,4 @@ faster-eth-utils
8
8
  numpy<3
9
9
  pandas>=1.4.3,<3
10
10
  typed-envs>=0.0.9
11
- ypricemagic>=4.6.28.dev0,<5
11
+ ypricemagic>=4.6.29.dev0,<5
@@ -104,7 +104,7 @@ except Exception as e: # fallback in case build fails
104
104
  setup(
105
105
  # NOTE: somebody stole our name on pypi, we have this placeholder until we steal it back
106
106
  name="eth_portfolio_temp",
107
- python_requires=">=3.10,<3.13",
107
+ python_requires=">=3.10,<3.14",
108
108
  # name="eth-portfolio",
109
109
  packages=find_packages(),
110
110
  use_scm_version={