dsff 1.0.6__py3-none-any.whl → 1.2.0__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.
- dsff/VERSION.txt +1 -1
- dsff/__info__.py +7 -2
- dsff/__init__.py +4 -292
- dsff/formats/__common__.py +33 -0
- dsff/formats/__init__.py +346 -0
- dsff/{arff.py → formats/arff.py} +51 -55
- dsff/{csv.py → formats/csv.py} +5 -11
- dsff/{dataset.py → formats/dataset.py} +4 -12
- dsff/formats/db.py +76 -0
- dsff/formats/pa.py +29 -0
- {dsff-1.0.6.dist-info → dsff-1.2.0.dist-info}/METADATA +9 -9
- dsff-1.2.0.dist-info/RECORD +15 -0
- {dsff-1.0.6.dist-info → dsff-1.2.0.dist-info}/WHEEL +1 -1
- {dsff-1.0.6.dist-info → dsff-1.2.0.dist-info/licenses}/LICENSE +674 -674
- dsff/__common__.py +0 -20
- dsff-1.0.6.dist-info/RECORD +0 -12
- {dsff-1.0.6.dist-info → dsff-1.2.0.dist-info}/top_level.txt +0 -0
dsff/formats/pa.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
|
2
|
+
from .__common__ import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
__all__ = []
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _nowrite(m):
|
|
9
|
+
raise NotImplementedError(f"none of {m}.write_table and {m}.write_{m} is implemented")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
for module in ["feather", "orc", "parquet"]:
|
|
13
|
+
__all__ += [f"from_{module}", f"to_{module}"]
|
|
14
|
+
def gen_func(m):
|
|
15
|
+
def from_(dsff, path=None, exclude=DEFAULT_EXCL):
|
|
16
|
+
dataset = globals()[m].read_table(path)
|
|
17
|
+
dsff.write(data=[dataset.schema.names] + [list(r.values()) for r in dataset.to_pylist()],
|
|
18
|
+
metadata=literal_eval(dataset.schema.metadata.pop(b'__metadata__', b"{}").decode()),
|
|
19
|
+
features={k.decode(): v.decode() for k, v in dataset.schema.metadata.items()})
|
|
20
|
+
from_.__name__ = f"from_{m}"
|
|
21
|
+
def to_(dsff, path=None, text=False):
|
|
22
|
+
with (BytesIO() if text else open(path, 'wb+')) as f:
|
|
23
|
+
getattr(globals()[m], "write_table", getattr(globals()[m], f"write_{m}", _nowrite))(dsff._to_table(), f)
|
|
24
|
+
if text:
|
|
25
|
+
return f.getvalue()
|
|
26
|
+
to_.__name__ = f"to_{m}"
|
|
27
|
+
return from_, to_
|
|
28
|
+
globals()[f'from_{module}'], globals()[f'to_{module}'] = gen_func(module)
|
|
29
|
+
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dsff
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: DataSet File Format (DSFF)
|
|
5
5
|
Author-email: Alexandre D'Hondt <alexandre.dhondt@gmail.com>
|
|
6
|
-
License:
|
|
6
|
+
License: GNU GENERAL PUBLIC LICENSE
|
|
7
7
|
Version 3, 29 June 2007
|
|
8
8
|
|
|
9
9
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
@@ -691,17 +691,16 @@ Classifier: Intended Audience :: Other Audience
|
|
|
691
691
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
692
692
|
Classifier: Programming Language :: Python :: 3
|
|
693
693
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
694
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
695
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
696
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
697
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
698
694
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
699
|
-
Requires-Python: <4,>=3.
|
|
695
|
+
Requires-Python: <4,>=3.10
|
|
700
696
|
Description-Content-Type: text/markdown
|
|
701
697
|
License-File: LICENSE
|
|
702
698
|
Requires-Dist: openpyxl
|
|
699
|
+
Provides-Extra: extra
|
|
700
|
+
Requires-Dist: pyarrow; extra == "extra"
|
|
701
|
+
Dynamic: license-file
|
|
703
702
|
|
|
704
|
-
<p align="center"><img src="https://github.com/packing-box/python-dsff/raw/main/docs/pages/imgs/logo.png"></p>
|
|
703
|
+
<p align="center" id="top"><img src="https://github.com/packing-box/python-dsff/raw/main/docs/pages/imgs/logo.png"></p>
|
|
705
704
|
<h1 align="center">DataSet File Format <a href="https://twitter.com/intent/tweet?text=DataSet%20File%20Format%20-%20XSLX-based%20format%20for%20handling%20datasets.%0D%0ATiny%20library%20for%20handling%20a%20dataset%20as%20an%20XSLX%20and%20for%20converting%20it%20to%20ARFF,%20CSV%20or%20a%20FilelessDataset%20structure%20as%20for%20the%20Packing%20Box.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fpacking-box%2fpython-dsff%0D%0A&hashtags=python,dsff,machinelearning"><img src="https://img.shields.io/badge/Tweet--lightgrey?logo=twitter&style=social" alt="Tweet" height="20"/></a></h1>
|
|
706
705
|
<h3 align="center">Store a dataset in XSLX-like format.</h3>
|
|
707
706
|
|
|
@@ -730,6 +729,7 @@ pip install --user dsff
|
|
|
730
729
|
f.write("/path/to/my-dataset") # folder of a FilelessDataset (containing data.csv, features.json and metadata.json)
|
|
731
730
|
f.to_arff() # creates ./my-dataset.arff
|
|
732
731
|
f.to_csv() # creates ./my-dataset.csv
|
|
732
|
+
f.to_db() # creates ./my-dataset.db (SQLite DB)
|
|
733
733
|
# while leaving the context, ./my-dataset.dsff is created
|
|
734
734
|
```
|
|
735
735
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
dsff/VERSION.txt,sha256=pkcIsBDivPYoFU3cIF7UloimNH75OmakJJJDD2PwIbE,7
|
|
2
|
+
dsff/__info__.py,sha256=K60bLbmoDIwAWcHCSXwl3vWOgYQjPhlF7sKg5fm-wC0,423
|
|
3
|
+
dsff/__init__.py,sha256=vTxmziCSSeaEL5kO5RTN9G1jbFPHNFBzeWL_DEEI29M,173
|
|
4
|
+
dsff/formats/__common__.py,sha256=-_sLqf1xyZ7nq7WiYZJnNNwi_m27bI8lGpZUnigtts0,1110
|
|
5
|
+
dsff/formats/__init__.py,sha256=8dLZt4MB5klIsqVKXheSF4_Qiw-BIjfnZZT5jIxVBjY,13827
|
|
6
|
+
dsff/formats/arff.py,sha256=z4WJMl3keqHz1VWApWflditVLOK5QYSF7qTANfB1w9E,7096
|
|
7
|
+
dsff/formats/csv.py,sha256=9r_Qnle3lGKAgy2YR_HHgMRNHVIayhn215zCfggjBtE,805
|
|
8
|
+
dsff/formats/dataset.py,sha256=tIjWWaEzazIPUhTURAP3PiOc_WGxdEukLyW2-uVOE4k,1390
|
|
9
|
+
dsff/formats/db.py,sha256=6KmPrYimKLlRutv9h6THBsBXG-bUvC-XHMkJyD72UV8,3565
|
|
10
|
+
dsff/formats/pa.py,sha256=8tGXdngkqD-FHr37LDTri-9VGtOfnkk4202N6rbp1GM,1188
|
|
11
|
+
dsff-1.2.0.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
|
12
|
+
dsff-1.2.0.dist-info/METADATA,sha256=nIF8MoI4D9bd7edo6m5IB6hXRBEDnweSNUpwg7x9wPI,46109
|
|
13
|
+
dsff-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
+
dsff-1.2.0.dist-info/top_level.txt,sha256=bmP8yHsEIiNYtYRJGnUl7TDsrLG_zb5g0-AVpVjKssI,5
|
|
15
|
+
dsff-1.2.0.dist-info/RECORD,,
|