Skip to main content

htutil

HaoTian's Python Util

version downloads format implementation pyversions license

Install

pip install htutil

Usage

file

from htutil import file

Refer to C# System.IO.File API, very simple to use.

    s = 'hello'
    write_text('1.txt', s)
    # hello in 1.txt
    append_text('1.txt', 'world')
    # helloworld in 1.txt
    s = read_text('1.txt')
    print(s)  # helloworld

    s = ['hello', 'world']
    write_lines('1.txt', s)
    # hello\nworld in 1.txt
    append_lines('1.txt',['\npython'])
    # hello\nworld\npython in 1.txt
    s = read_lines('1.txt')
    print(s)  # ['hello', 'world', 'python']

cache

cache def result by pickle file.

from htutil import cache
@cache.file_cache
def get_1():
    time.sleep(3)
    return 1

counter

a simple counter based on dict.

    c = Counter()
    c.add('1')
    c.add('1')
    c.add('2')

    print(c.to_dict()) # {'1': 2, '2': 1}

    c.dump() # same as print(c.to_dict())

Metadata

Release files for htutil 3.2.0

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

Source distribution (sdist)

Source distribution for htutil 3.2.0
File Size Uploaded
htutil-3.2.0.tar.gz 15.0 kB Details

Built distribution (wheel)

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

Total release size: 31.0 kB

Release files / htutil-3.2.0.tar.gz

Download URL htutil-3.2.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e56da9d5c8d8b45d60536e8b872246b902873370fd10a3009bfee2f4727c6855
BLAKE2b-256 checksum
How to use checksums
9f08d7a298cb5b3f2555fc8ec55c7b828abf88bb1d4325f466175252a79f8385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / htutil-3.2.0-py3-none-any.whl

Download URL htutil-3.2.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
601306ca12693e366fa6274e0a48329fdde3c329996ead422eb8ecf1d0fbca4d
BLAKE2b-256 checksum
How to use checksums
415b9615adc3021c8f0bf7b602778242160863a1f61b135d2b99041db453aa88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.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