tokenator 0.1.2__tar.gz → 0.1.3__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {tokenator-0.1.2 → tokenator-0.1.3}/PKG-INFO +1 -1
- {tokenator-0.1.2 → tokenator-0.1.3}/pyproject.toml +1 -1
- tokenator-0.1.3/src/tokenator/__init__.py +20 -0
- tokenator-0.1.2/src/tokenator/__init__.py +0 -12
- {tokenator-0.1.2 → tokenator-0.1.3}/LICENSE +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/README.md +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/base_wrapper.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/client_anthropic.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/client_openai.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/create_migrations.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/migrations/env.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/migrations/script.py.mako +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/migrations.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/models.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/schemas.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/usage.py +0 -0
- {tokenator-0.1.2 → tokenator-0.1.3}/src/tokenator/utils.py +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
"""Tokenator - Track and analyze your OpenAI API token usage and costs."""
|
2
|
+
|
3
|
+
import logging
|
4
|
+
from .client_openai import OpenAIWrapper
|
5
|
+
from . import usage
|
6
|
+
from .utils import get_default_db_path, is_colab
|
7
|
+
|
8
|
+
__version__ = "0.1.0"
|
9
|
+
__all__ = ["OpenAIWrapper", "usage", "get_default_db_path"]
|
10
|
+
|
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,12 +0,0 @@
|
|
1
|
-
"""Tokenator - Track and analyze your OpenAI API token usage and costs."""
|
2
|
-
|
3
|
-
from .client_openai import OpenAIWrapper
|
4
|
-
from . import usage
|
5
|
-
from .utils import get_default_db_path
|
6
|
-
from .migrations import check_and_run_migrations
|
7
|
-
|
8
|
-
__version__ = "0.1.0"
|
9
|
-
__all__ = ["OpenAIWrapper", "usage", "get_default_db_path"]
|
10
|
-
|
11
|
-
# Run migrations on import
|
12
|
-
check_and_run_migrations()
|
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
|