Skip to main content

A Swiss Knife

Project description

boondh

A Personal Library

  • Encapsulate boilerplate code
  • Data processing code
  • ML Frameworks (NLP tasks - SeqClassification, Entity Extractions etc.)

install

pip3 install -U boondh

For nightly

git clone https://github.com/rohit-mehra/boondh.git
cd boondh
pip install .

sample use

Parallelize any function

from boondh import mp_func

# Any function to be applied on each element of data
def base_func(value, sq=True):
    if sq: return value ** 2
    return value

# Any data
data = [0, 1, 2, 3, 4]

# Collected results - Ordered by default
results = mp_func(base_func, # apply this in parallel
                 'value', # the data argument name in above function
                  data, # contains elements to be processed
                  sq=True # any arg of the `to be applied` function
                  )
# configure chunksize and set ordered as False for perfromance gain
results = mp_func(base_func, 'value', data, chunksize=200, ordered=False, sq=True)

Arrange files in your directory (usually the Download directory.. :smile:)

  • This will scan the directory and create type folders like csv_, txt_ etc.
  • Move respective filetypes into these folders.
python -m boondh.utils.arrange_files -D "$(pwd)"

OR

python -m boondh.utils.arrange_files -D /Users/<myusername>/Downloads/

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

boondh-0.1.5.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file boondh-0.1.5.tar.gz.

File metadata

  • Download URL: boondh-0.1.5.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for boondh-0.1.5.tar.gz
Algorithm Hash digest
SHA256 37089db12155dbb10b80173fe3832d8de8e25490460421ccabec7bc766020ce6
MD5 14a7e29ba888ca63ca2c55920ee54754
BLAKE2b-256 36e412346e9473840d486b7806167a993676c08d2e26e808adb2fb93347747f7

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