Datasets and simple API for word datasets
Project description
word-datasets (Python)
Python package for the word datasets.
Install
pip install word-datasets
Build and publish
# (from repo root) stage data into the package source
python python-lib/tools/prepare_data.py
# build the package
cd python-lib
python -m build
# upload
twine upload dist/*
Usage
import word_datasets as wd
print(wd.list_datasets())
for i, w in enumerate(wd.iter_text_lines("words.txt")):
if i < 5:
print(w)
else:
break
API
word_datasets.data_dir() -> pathlib.Pathword_datasets.dataset_path(rel_path: str) -> pathlib.Pathword_datasets.list_datasets() -> list[str]word_datasets.iter_text_lines(rel_path: str, *, strip: bool = True) -> Iterator[str]word_datasets.read_text_lines(rel_path: str, *, limit: int | None = None, strip: bool = True) -> list[str]word_datasets.read_json(rel_path: str) -> Any
Datasets
One word per line, UTF-8 text files:
words.txt– mixed/common words (~466k lines)francais.txt– French (~208k)espanol.txt– Spanish (~175k)deutsch.txt– German (~166k)italiano.txt– Italian (~88k)nederlands.txt– Dutch (~53k)norsk.txt– Norwegian (~61k)dansk.txt– Danish (~24k)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
word_datasets-0.1.1.tar.gz
(3.5 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file word_datasets-0.1.1.tar.gz.
File metadata
- Download URL: word_datasets-0.1.1.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27f4dd783ac5e615256f5387698f43d992f64d22b8a308a79ada58786f9763f6
|
|
| MD5 |
d7afa56fdf284044c99d199867257ece
|
|
| BLAKE2b-256 |
77bc3cb0a6bb7c33ac3e8477396ab827700da628b9b5a77ae19cf3bad0c77726
|
File details
Details for the file word_datasets-0.1.1-py3-none-any.whl.
File metadata
- Download URL: word_datasets-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4ee332d940211c7a647055354bae6715c55b87b154718c959f6411595f16371
|
|
| MD5 |
8448a09bd7add7c621e84e91edeef8bb
|
|
| BLAKE2b-256 |
6b4cee6e34529766f8f58876fa3a22828cd68cd8121c9d5c9c72af29834d6a5a
|