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.1.9.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

bpyth-0.1.9-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bpyth-0.1.9.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for bpyth-0.1.9.tar.gz
Algorithm Hash digest
SHA256 e3cd8287b922d5bec4edd3fd14ad2408740aa27ff051d250eec3d0b1a1bf11d4
MD5 58feee8ef294d1e181e1ffb58e3918ba
BLAKE2b-256 263cfa4981e94a463fba7c2128529893b7b1b90f4ad9c1207f3f6355280b2171

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bpyth-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for bpyth-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 84c438591d9530bde1bc1384f824e6432afe2e1c7e033c9e4eca8625566c91ce
MD5 0a7f38ad6caa3d51efa128b1720c7272
BLAKE2b-256 21bc19d612d86b12d6573daab10716bcf7707bb09cb1503862db3908c85a98c7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page