Skip to main content

A collection of basic python utilities.

Project description

bsutils: Basic Python Utilities

Downloads

A collection of basic python utilities.

Installation

# With pip.
pip install bsutils

# Or pipx.
pipx install bsutils

# Or uv
uv pip install bsutils

Features

Json Utilities (bsutils.json)

  • get_item_num: Get the number of items in a JSON or JSONL file.
  • iter_json_file: Iterate over a JSON or a JSONL file.
  • load_json_file: Load a JSON or JSONL file.
  • jsonl_to_json: Convert a JSONL file to a JSON file.
  • json_to_jsonl: Convert a JSON file to a JSONL file.
  • write_json_file: Write a JSON or JSONL file.

File Utilities (bsutils.file)

  • pure_file_name: Get the pure file name from a path, e.g., "document" for "/path/to/ducumnet.pdf".

Result (bsutils.result)

Use Result to get the result of a function rather than exceptions, similar to result.

  • Result: A class to get the result of a function and handle exceptions.
  • Ok: Contain the return value when functions success.
  • Err: Contain the error information when functions fail.

Option (bsutils.option)

Use Option to express variable which may not contain value rather than None and Any.

  • Option: A class to express variable which may not contain value.
  • Some: A class to express variable which contains value.
  • None: Python default None.

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

bsutils-0.0.2.post3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

bsutils-0.0.2.post3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file bsutils-0.0.2.post3.tar.gz.

File metadata

  • Download URL: bsutils-0.0.2.post3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.1

File hashes

Hashes for bsutils-0.0.2.post3.tar.gz
Algorithm Hash digest
SHA256 11f960750f21bcb3459a5de0e7c17d8c39737ecd9474c8b62914f4239912cf1f
MD5 73254e7c4936c4dbea01058bf2226261
BLAKE2b-256 8dcfedaeb3973a25022d9611e65bc790cc849479623da05c1adebe45a7dfac9b

See more details on using hashes here.

File details

Details for the file bsutils-0.0.2.post3-py3-none-any.whl.

File metadata

File hashes

Hashes for bsutils-0.0.2.post3-py3-none-any.whl
Algorithm Hash digest
SHA256 c5b42801ea4c39edbd7bd1ca433bb48d04de7a6163160aae9877c8b8bca87092
MD5 402b4ac73acc798d45d7ae46f07ec0ea
BLAKE2b-256 47eb053e54e0c19c1387181b86d4add4e157660d9e8f4e35b2571e5af73660b9

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