mostlyai 0.4.6__tar.gz → 0.4.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mostlyai
3
- Version: 0.4.6
3
+ Version: 0.4.8
4
4
  Summary: The official Python client for the MOSTLY AI platform.
5
5
  Home-page: https://app.mostly.ai/
6
6
  License: Proprietary
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
16
17
  Requires-Dist: httpx (>=0.25.0)
17
18
  Requires-Dist: pandas (>=1.5.3,<3.0.0)
18
19
  Requires-Dist: pyarrow (>=14.0.0)
@@ -1,4 +1,4 @@
1
1
  from mostlyai.api import MostlyAI
2
2
 
3
3
  __all__ = ["MostlyAI"]
4
- __version__ = "0.4.6" # Do not set this manually. Use poetry version [params].
4
+ __version__ = "0.4.8" # Do not set this manually. Use poetry version [params].
@@ -6,6 +6,7 @@ from pathlib import Path
6
6
  from typing import Callable, Union, Optional, Any, Literal
7
7
 
8
8
  import pandas as pd
9
+ import csv
9
10
  import rich
10
11
  from rich.progress import (
11
12
  BarColumn,
@@ -273,8 +274,18 @@ def _read_table_from_path(path: Union[str, Path]) -> (str, pd.DataFrame):
273
274
  if fn.lower().endswith((".pqt", ".parquet")):
274
275
  df = pd.read_parquet(fn)
275
276
  else:
276
- df = pd.read_csv(fn, low_memory=False)
277
- if fn.endswith((".gz", ".gzip", ".bz2")):
277
+ delimiter = ","
278
+ if fn.lower().endswith((".csv", ".tsv")):
279
+ try:
280
+ with open(fn) as f:
281
+ header = f.readline()
282
+ sniffer = csv.Sniffer()
283
+ delimiter = sniffer.sniff(header, ",;|\t' :").delimiter
284
+ except csv.Error:
285
+ # happens for example for single column CSV files
286
+ pass
287
+ df = pd.read_csv(fn, low_memory=False, delimiter=delimiter)
288
+ if fn.lower().endswith((".gz", ".gzip", ".bz2")):
278
289
  fn = fn.rsplit(".", 1)[0]
279
290
  name = Path(fn).stem
280
291
  return name, df
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "mostlyai"
3
- version = "0.4.6"
3
+ version = "0.4.8"
4
4
  description = "The official Python client for the MOSTLY AI platform."
5
5
  homepage = "https://app.mostly.ai/"
6
6
  authors = ["MOSTLY AI <office@mostly.ai>"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes