Skip to main content

fundata

一批用于下载/管理机器学习常见公开数据集的脚本:数据集的名称、分类、下载地址等元信息存入本地 SQLite(fundata.manage.core.DatasetManage),再按索引里的地址把数据文件拉到本地。收录的数据集包括 iris、MovieLens(100k/1m/10m/20m/25m)、Criteo(sample/kaggle)、Amazon Electronics 评论、adult、porto-seguro、bitly-usagov、COCO(val2017/annotations)以及 YOLOv3/v4 权重等。

fundata.work、fundata.manage、fundata.tables_bak 可以正常 import 和使用。DatasetManage.download() 优先走记录里的 source 直链;只有 lanzou 地址的记录会抛出 NotImplementedError:当前 fundrive 的蓝奏云 API 是基于类的 fundrive.drives.lanzou.LanZouDrive,需要已认证的实例,没有免认证的下载函数可用。

fundata.dataset 可以在不安装重型机器学习依赖时导入;构建 Criteo 数据集时才需要安装 dataset extra。tensorflow、keras、scikit-learn、funkeras(提供 notekeras)已收录进 pyproject.toml 的 dataset extra,默认不随主依赖安装。

  • notekeras:PyPI 上的 funkeras 包实际发布的顶层可 import 模块名仍然是 notekeras(pip install funkeras 装出来的目录是 notekeras/),因此代码里 from notekeras.features.feature_parse import ... 这一行即使装了 funkeras 也必须保持 notekeras 这个导入名不变,才能正确工作。

安装

已发布到 PyPI:

pip install fundata

需要用到 fundata.dataset 下具体数据集处理类时,额外装上 dataset extra:

pip install "fundata[dataset]"

基础包支持 Python 3.10。dataset extra 里 TensorFlow/Keras 这条链路带 python_version >= '3.11' 标记,只在 Python 3.11+ 上安装:keras 从 3.13 起才要求 Python 3.11,在 3.10 上能解析到的最高版本仍落在 Keras 安全公告的受影响区间内。 scikit-learn 与 Keras 无关,在 3.10 上照常安装。

pyproject.toml 中已声明的 dependencies 为 numpy、pandas、funshell、farlog、tqdm,安装后 fundata(顶层)、fundata.work、fundata.manage、fundata.tables_bak、fundata.dataset 均可正常导入。构建 Criteo 数据集时需要额外安装 dataset extra。

用法示例

建立本地索引,然后按名称下载:

from fundata.manage.core import DatasetManage
from fundata.manage.library import insert_library

dataset = DatasetManage(db_path="./fundata.db")
dataset.create()
insert_library(dataset)  # 把内置下载地址写入当前目录的 sqlite 索引

# download() 返回本地文件路径;数据集不在索引里时返回 None
path = dataset.download("adult-train", overwrite=False, path_root="./download/")
print(path)  # ./download/adult-data/adult.train.txt

只登记了蓝奏云地址的记录(例如 yolov3.weights)目前下载不了:DatasetManage.download() 会抛出 NotImplementedError,需先接入已认证的 fundrive.drives.lanzou.LanZouDrive 实例。

管理数据落盘目录(数据库/日志/公共文件),默认落在 /opt/farfarfun/apps/fundata:

from fundata.work import WorkApp

app = WorkApp()  # app_name 默认为 "fundata",dir_app 默认为 /opt/farfarfun/apps/fundata
app.create()

fundata.dataset 下还有针对具体数据集的处理类,例如 ElectronicsData(Amazon 评论数据的下载、清洗、构建训练集)和 CriteoData(Criteo 数据集的特征处理)。

现状说明

fundata.work / fundata.manage / fundata.tables_bak / fundata.dataset 可正常导入;构建 Criteo 数据集时需要额外安装 dataset extra。


关于 farfarfun

farfarfun 是一个专注于实用工具库的开源组织, 涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。

本项目基于 MIT 协议开源。

Metadata

Release files for fundata 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for fundata 1.0.5
File Interpreter ABI Platform
fundata-1.0.5-py3-none-any.whl Python 3 none any Details

Release files / fundata-1.0.5-py3-none-any.whl

Download URL fundata-1.0.5-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce04ba6bfe4bc3e39b0eeef86c8e9100070b9720b818e577b472fcd948a95948
BLAKE2b-256 checksum
How to use checksums
12c7b67e37af2927580e93e60b79044e335765d78e6daf17bd4e4a13c6c837d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page