Skip to main content

General utility functions that keep being rewritten

Project description

CreateNewDirec

Description:

Will create a new directory. If the directory already exists it will delete the files within it.

Inputs:

  • base_direc: string that represents the directory in which the new directory will be made
  • name: string that represents the name of the new directory

Outputs:

  • new_direc: string that represents the path of the new directory

UpdateProgress

Description:

Will print a status bar with the progress of the current progress.

Inputs:

  • progress: float that is the current progress of the process
  • symbol: an additional value to be printed (type is variable), not required then input ""

Outputs:

  • prints a status bar showing the completion of the process

WriteDictToCSV

Description:

Will write a dict or a list of dicts to a csv.

Inputs:

  • base_direc: string that represents the directory in which the file will be written
  • details: dict or list of dicts that will be written into the target file
  • csv_name: string that represents the name of the csv

Outputs:

  • new_csv: string that represents the path of the created csv_file

CheckIfFileExists

Description:

Checks if a file currently exists.

Inputs:

  • filename: string that represents the path of the file to be checked

Outputs:

  • bool: True if the file exists or False if it does not

ConvertDictToList

Description:

Will convert a dictionary to a list without its respective keys.

Inputs:

  • details: dict that the information will be converted to list format

Outputs:

  • output_list: list that holds the extracted information

WriteOrAppendCSV

Description:

Will create or append a csv with a row of information for a specified csv and dictionary.

Inputs:

  • csv_file: string that is the path for the csv file that will either be created or appended with the data
  • details: dict that contains the data to append or write to the specified csv_file

Outputs:

  • csv_file: string that is the path for the csv file that will either be created or appended with the data

RoundValueDown

Description:

Will round down a float to the specified amount of decimal places.

Inputs:

  • number: float that represents the number that will be rounded down
  • decimals: int that represents the number of decimal points to be rounded to

Outputs:

  • new_val: float that is number round to decimals amount of decimal points

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

haber_utils-0.4.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

haber_utils-0.4.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file haber_utils-0.4.0.tar.gz.

File metadata

  • Download URL: haber_utils-0.4.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for haber_utils-0.4.0.tar.gz
Algorithm Hash digest
SHA256 64ef44bbb73c1f4b6e159beadf2e5ae23c343f4f02cb2ddc91d7738f06fa94bb
MD5 54b29178c07639d88ea96ce854a1ab54
BLAKE2b-256 bbaf20eab42bd3664914976fc6d0b0c115e6f82bd12757ddf1fd3aedf4798ca5

See more details on using hashes here.

File details

Details for the file haber_utils-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: haber_utils-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for haber_utils-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b337233ea44837d46b95ebfc51df6e68db1da47bc2fbbdb2f5d07fcbf2cfee3d
MD5 24ae67a5a5ac72f2061ca72b29f39999
BLAKE2b-256 2ec64b3f30c2999084154a891549139de82d7e0ee0607feb6e274265fa7b4513

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