Skip to main content

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.Path
  • word_datasets.dataset_path(rel_path: str) -> pathlib.Path
  • word_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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

word_datasets-0.1.1-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

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

Hashes for word_datasets-0.1.1.tar.gz
Algorithm Hash digest
SHA256 27f4dd783ac5e615256f5387698f43d992f64d22b8a308a79ada58786f9763f6
MD5 d7afa56fdf284044c99d199867257ece
BLAKE2b-256 77bc3cb0a6bb7c33ac3e8477396ab827700da628b9b5a77ae19cf3bad0c77726

See more details on using hashes here.

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

Hashes for word_datasets-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4ee332d940211c7a647055354bae6715c55b87b154718c959f6411595f16371
MD5 8448a09bd7add7c621e84e91edeef8bb
BLAKE2b-256 6b4cee6e34529766f8f58876fa3a22828cd68cd8121c9d5c9c72af29834d6a5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page