tokenator 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl

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.
tokenator/__init__.py CHANGED
@@ -1,12 +1,20 @@
1
1
  """Tokenator - Track and analyze your OpenAI API token usage and costs."""
2
2
 
3
+ import logging
3
4
  from .client_openai import OpenAIWrapper
4
5
  from . import usage
5
- from .utils import get_default_db_path
6
- from .migrations import check_and_run_migrations
6
+ from .utils import get_default_db_path, is_colab
7
7
 
8
8
  __version__ = "0.1.0"
9
9
  __all__ = ["OpenAIWrapper", "usage", "get_default_db_path"]
10
10
 
11
- # Run migrations on import
12
- check_and_run_migrations()
11
+ logger = logging.getLogger(__name__)
12
+
13
+ try:
14
+ if not is_colab():
15
+ from .migrations import check_and_run_migrations
16
+ check_and_run_migrations()
17
+ else:
18
+ logger.info("Running in Colab environment - skipping migrations")
19
+ except Exception as e:
20
+ logger.warning(f"Failed to run migrations, but continuing anyway: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tokenator
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Token usage tracking wrapper for LLMs
5
5
  License: MIT
6
6
  Author: Ujjwal Maheshwari
@@ -1,4 +1,4 @@
1
- tokenator/__init__.py,sha256=yBw4D1VQWe9fJfDvGavy1OFEEW0BIM2714dVk70HenE,363
1
+ tokenator/__init__.py,sha256=SB81-PEkyU-JHuckDNqeoopfpzbfL1jDweLaETPa4J0,626
2
2
  tokenator/base_wrapper.py,sha256=vSu_pStKYulho7_5g0jMCNf84KRxC4kTKep0v8YE61M,2377
3
3
  tokenator/client_anthropic.py,sha256=1ejWIZBxtk-mWTVaKWeMUvS2hZ_Dn-vNKYa3yopdjAU,6714
4
4
  tokenator/client_openai.py,sha256=1xZuRA90kwlflTwEuFkXJHHN584XTeNh1CfEBMLELbQ,6308
@@ -10,7 +10,7 @@ tokenator/models.py,sha256=EprE_MMJxDS-YXlcIQLZzfekH7xTYbeOC3bx3B2osVw,1171
10
10
  tokenator/schemas.py,sha256=eVdBWi6_hTETnPw50glq0OvSh3PbP2pLl_aHdf3fi-M,2278
11
11
  tokenator/usage.py,sha256=aHjGwzDzaiVznahNk5HqVyk3IxDo5FtFVfOUCeE7DZ4,7833
12
12
  tokenator/utils.py,sha256=UHV6tKLd6zoz7Fml1LokkbGmN1hvQMfXDY4Aulkhar8,1910
13
- tokenator-0.1.2.dist-info/LICENSE,sha256=wdG-B6-ODk8RQ4jq5uXSn0w1UWTzCH_MMyvh7AwtGns,1074
14
- tokenator-0.1.2.dist-info/METADATA,sha256=VnT8VlRydPmUPqNUesUjrhWWJT1PlliNriCRHAqrRtY,2444
15
- tokenator-0.1.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
16
- tokenator-0.1.2.dist-info/RECORD,,
13
+ tokenator-0.1.3.dist-info/LICENSE,sha256=wdG-B6-ODk8RQ4jq5uXSn0w1UWTzCH_MMyvh7AwtGns,1074
14
+ tokenator-0.1.3.dist-info/METADATA,sha256=kOesX0EPrxsqvrowcayXbA8phU7Ix9xPmp6Jqb_fYHM,2444
15
+ tokenator-0.1.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
16
+ tokenator-0.1.3.dist-info/RECORD,,