Skip to main content

Various Python Tools

Project description

bpyth

Some boring Python Tools, see jupyter directory.

Try out

The directory jupyter contains many notebooks with examples. They are very easy to try out interactively online, with Google Colab. Just click the link at the top of the page and then select Runtime/Run all from the menu in Colab.

Install

pip install bpyth

Files Tools

  • dump_pickle: open, dump, close
  • load_pickle: open, load, close
  • StreamFiles: Iterable, returns all filenames of a parent directory
  • StreamLines: Iterable, returns all lines of a text file

Human Tools

  • human_readable_number: Rounds a number to a fixed number of significant digits.
  • human_readable_seconds: Converts seconds to human readable time
  • human_readable_bytes: Converts Bytes to human readable size

Iterable Tools

  • minivenn: Compare two sets
  • flatten: Yield all items from any nested iterable
  • remove_dups: Remove dups from a list whilst-preserving-order
  • sort_by_priority_list: Sort a list by a list or tuple of prioritized objects
  • cut_counter: Truncates rare values of a counter
  • ranking_from_counter: Converts a counter into a ranking

Object Analysis Tools

  • rtype: Recursive type. Parses an n-dimensional object and returns a tuple of stype for the scalar in the top left corner.
  • shape: Recursive len. Parses an n-dimensional object and returns a tuple of sizes.
  • has_shape: Does an object have additional dimensions? (Skalars: No, Strings: No, Empty Iterables: No, Other Iterables: Yes)
  • memory_consumption: Returns the memory consumption of Python objects.

String Tools

  • superstrip : Removes Unicode whitespaces
  • remove_words : Removes stopwords
  • remove_dupwords: Removes dup words from a string whilst-preserving-order
  • longest_substr : Finds the longest common substring in a list of strings
  • random_str : Returns a random string

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

bpyth-0.2.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

bpyth-0.2.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file bpyth-0.2.2.tar.gz.

File metadata

  • Download URL: bpyth-0.2.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.8.0-55-generic

File hashes

Hashes for bpyth-0.2.2.tar.gz
Algorithm Hash digest
SHA256 96ed16ddc534906dbef9ad0eb5c3ce92d41026ed4526acf451d06a89dacd4037
MD5 dbb500f19578d4f64a3d226349ab0254
BLAKE2b-256 594f98babb43a78cc3bf6aa487a6fcb47d7fdedff59d3332fcb41ce02229a86a

See more details on using hashes here.

File details

Details for the file bpyth-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: bpyth-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.8.0-55-generic

File hashes

Hashes for bpyth-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7bdbf427130ddd7d3f7d63173449fe333612d7b7147da599416e83a9961edf73
MD5 32a154d4cfc71b0d868c96affe6c56bc
BLAKE2b-256 1ecd90e9067233be52e2f9bcb0335cc03365542bee0b0f33b320148f59e01dd0

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