semvec/pypi-packages huggingface dataset:
aiostdlib 0.2.0
Only the standard library... but asynchronous!
License: MIT
Requires Python: <3.14,>=3.9
Keywords: async, json, ntpath, os, posixpath, python, stdlib, tomllib

# aiostdlib

[![PyPI Version][shields/pypi/version]][pypi/homepage]
[![PyPI Downloads][shields/pypi/downloads]][pypi/homepage]
[![License][shields/pypi/license]][github/license]
[![Python Version][shields/python/version]][pypi/homepage]

> [!WARNING]
> The library is in the pre-alpha stage. Bugs may exist!

## Key Features

* Provides asynchronous version of the standard library;
* The same API as the Python 3.13 standard blocking API;
* Blocking IO is performed in a separate thread.

## Getting Started

### Installation

The library is available as [`aiostdlib`][pypi/homepage] on PyPI:

```shell
pip install aiostdlib
```

### Usage

#### json

For more, see the [documentation][docs/json].

```python
from aiostdlib import json

async def main() -> None:
    with open("aiostdlib.json") as file:
        data = await json.load(file)
```

#### os

For more, see the [documentation][docs/os].

```python
import sys

from aiostdlib import os

async def main() -> None:
    fd = sys.stdout.fileno()
    detail = b"Hello, aiostdlib!"
    await os.write(fd, detail)
```

#### os.path

For more, see the [documentation][docs/os.path].

```python
from aiostdlib import os

async def main() -> None:
    if await os.path.exists("./aiostdlib.txt"):
        await os.unlink("./aiostdlib.txt")
```

#### tomllib

For more, see the [documentation][docs/tomllib].

```python
from aiostdlib import tomllib

async def main() -> None:
    with open("aiostdlib.toml", mode="rb") as file:
        data = await tomllib.load(file)
```

## Environment

* If `AIOSTDLIB_CONCURRENT_WORKERS` is a positive integer, then no more than the specified number of
  threads will be used to execute calls asynchronously. If zero, then threading is not used at all.
  Otherwise, a minimum of `32` and `os.cpu_count() + 4` is the limit.

## License

MIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See [LICENSE][github/license] file.

<!-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -->

[docs/json]: https://aiostdlib.readthedocs.io/en/latest/json.html
[docs/os]: https://aiostdlib.readthedocs.io/en/latest/os.html
[docs/os.path]: https://aiostdlib.readthedocs.io/en/latest/os.path.html
[docs/tomllib]: https://aiostdlib.readthedocs.io/en/latest/tomllib.html

[github/license]: https://github.com/syubogdanov/aiostdlib/tree/main/LICENSE

[pypi/homepage]: https://pypi.org/project/aiostdlib/

[shields/pypi/downloads]: https://img.shields.io/pypi/dm/aiostdlib.svg?color=green
[shields/pypi/license]: https://img.shields.io/pypi/l/aiostdlib.svg?color=green
[shields/pypi/version]: https://img.shields.io/pypi/v/aiostdlib.svg?color=green
[shields/python/version]: https://img.shields.io/pypi/pyversions/aiostdlib.svg?color=green
jplookup 1.0.1
jplookup is a Python tool designed to look up Japanese words on Wiktionary and scrape pitch accent, phonetic pronunciation, definitions and example sentences from Wiktionary and turn them into straight-forward flashcards for Anki.
License: MIT
Requires Python: >=3.6
Keywords: Japanese, Wiktionary, Anki, pitch accent, scraper

# jplookup
jplookup is a Python tool designed to scrape pitch accent, phonetic pronunciation, definitions and example sentences from Wiktionary and turn them into straight-forward flashcards for Anki.
![oniisan](example-outputs/oniisan-sample.png)

# Features
## Pitch Accent
Anki cards made with jplookup can mark the pitch accent.
This will put a solid dot above the mora that will have a high pitch that's then followed by a mora with a low pitch.
![oriru](example-outputs/oriru-sample.png)

<br>

When a noted high pitch is sustained due to being part of a diagraph and/or has a lengthening vowel, then CSS is used to render a line indicating this.
![suiyoobi](example-outputs/suiyoobi-sample.png)

If there's no dot present, then the word follows the standard pitch accent.

<br>

## Scrapes Japanese word data
`jplookup.scrape("猫")` returns a list of dictionary objects.
The very first dictionary in the list contains the primary results:
![neko](example-outputs/neko-sample.png)

The rest of the list may provide further dictionaries, which are gathered from page redirects whose contents could not be linked back to the primary results dictionary through mutual matching components.

<br>

jplookup seeks out parts of speech, under those there are pronunciations, definitions, synonyms and antonyms. Each pronunciation will generally have the kana, the IPA, the pitch accent, and the furigana. Each definition is a dictionary and can contain example sentences.

<br>

## Anki Integration 
The program outputs a text file that can easily be read into Anki.
Its fields are:
- Key Term
- Kana
- Kanji
- Definitions
- IPA
- Pretty Kana (HTML rendering)
- Pretty Kanji (HTML rendering)
- Usage Notes
- Counter Noun

<br>

## Handles Terms Linking to Other Pages
When Wiktionary links to a different page for an alternative spelling, then the information gathered from that redirect will be filtered through the original spelling in order to provide the only relevant information. 
- "撮る" redirects to the Wiktionary page for "とる" and grabs any definitions that are either specified as fitting with "撮る" or definitions with no context/kanji specification at all.
- "取る" redirects to the Wiktionary page for "とる" and grabs any definitions that are either specified as fitting with "取る" or definitions with no context/kanji specification at all.
- "とる" (the hiragana directly) goes to the Wiktionary page for "とる" and grabs all definitions regardless of context specification.

<br>

## Installation

Clone the repository and install the required dependencies (`bs4` and `jaconv`):

```bash
git clone https://github.com/travisgk/jplookup.git
cd jplookup
pip install -r requirements.txt
```