Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Warawara

This project is renamed to iroiro.

A swiss-knife-like library that collects cute utilities for my other projects.

This library only depends on Python standard library and Python itself. It's functionalities will not depend on any third-party packages in a foreseeable future.

Examples:

# color strings
import warawara
warawara.orange('TEXT')   # \033[38;5;214mTEXT\033[m

# Invoke external command and retrieve the result.
p = warawara.run(['seq', '5'])
p.stdout.lines  # ['1', '2', '3', '4', '5']

# Invoke external command and retrieve the result in a non-blocking manner.
# Functions could be used as command, so they could be mixed in pipe line.
p1 = warawara.command(['seq', '5'])

def func(streams, *args):
    for line in streams[0]:
        streams[1].writeline('wara: {}'.format(line))

p2 = warawara.command(func, stdin=True)

warawara.pipe(p1.stdout, p2.stdin)
p1.run()
p2.run()
p2.stdout.lines   # ['wara: 1', 'wara: 2', 'wara: 3', 'wara: 4', 'wara: 5']

From my own perspective, Python's subprocess interface is not friendly enough for simple uses.

For more detailed API usage, see doc/warawara.md

Installation

sh$ pip3 install warawara

Or just copy the whole folder to your machine, and add the path to sys.path:

import sys
sys.path.insert(0, '/some/path/to/place/warawara')
import warawara

Test

Testing:

sh$ python3 -m unittest

With pytest-cov:

sh$ pipx install pytest-cov --include-deps

or

sh$ pipx install pytest
sh$ pipx runpip pytest install pytest-cov

sh$ pytest --cov=warawara --cov-report=html

Release files for warawara 0.2.1

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

Source distribution (sdist)

Source distribution for warawara 0.2.1
File Size Uploaded
warawara-0.2.1.tar.gz 56.5 kB Details

Built distribution (wheel)

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

Total release size: 103.9 kB

Release files / warawara-0.2.1.tar.gz

Download URL warawara-0.2.1.tar.gz
Size 56.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c2e1adf3dcf0018cc2e865ecabf03fc6c1662fb8690f4f89d0e5bf255cbde07e
BLAKE2b-256 checksum
How to use checksums
e5c9333920bd3dec51cc70d37dcf940b3e65d22cbe0dfaa4a45c52fd6f46be0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / warawara-0.2.1-py3-none-any.whl

Download URL warawara-0.2.1-py3-none-any.whl
Size 47.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2195c758f41842287300a9c718cc2f1f095e3ac111eed5f0bad22064db1e19ae
BLAKE2b-256 checksum
How to use checksums
5631e7859b8e028f6d119f48aaa175eacbf7d80d6aca1c6518004e40bf46a404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

0.2.1 This release

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