Skip to main content

Package to auto-generate lists, dictionaries, arrays, matricies (list-of-lists), json, csv files, and Pandas Dataframes

Project description

littlebaker

littlebaker

littlebaker is your personal Python baker to create custom lists, dictionaries, matricies (lists of lists), numpy arrays, csv files, in-memory json blobs, and Pandas DataFrames.

All it takes is

from littlebaker import littlebaker

baker_list = littlebaker.make.a_list() # returns list
baker_dict = littlebaker.make.a_dict() # returns dictionary
baker_matrix = littlebaker.make.a_matrix() # returns a list-of-lists
baker_array = littlebaker.make.an_array() # returns numpy array
baker_json = littlebaker.make.some_json() # returns json
baker_csv = littlebaker.make.a_csv() # creates a csv file
baker_df = littlebaker.make.a_df() # returns Pandas DataFrame

Installation

simply install littlebaker via pip pip install littelbaker

Examples and Usage

littlebaker.make.a_list(length, data_type)

length=
    any integer greater than 0, specifies list length, defaults to 101
data_type=
    specifies the type of values in the returned list, defaults to `int`. Valid options are
        int: returns a list of integers
        float: returns a list of floats
        char: returns a list of single str characters
        date: returns a list of dates
        str: returns a list of random strings

littlebaker.make.a_dict(length, value_type)

length=
    any integer greater than 0, specifies dictionary length, defaults to 101
value_type=
    specifies the type returned in the value of the dictionary's key:value pair, defaults to char.
    valid options are:
        int: returns a dictionary with keys of integers and values of integers
        float: returns a dictionary with keys of integers and values of floats
        char: returns a dictionary with keys of integers and values of single str characters
        date: returns a dictionary with keys of integers and values of dates
        str: returns a dictionary with keys of integers and values of random strings

littlebaker.make.a_matrix(num_lists, list_length, value_type)

num_lists=
    positive integer, specifies the number of lists within the returned matrix, defaults to 5
list_length=
    positive integer, specifies the lentgh of the inner lists, defaults to 5
value_type=
    specity the type returned in the inner lists, defaults to all
    int: returns inner lists of integers
    float: returns inner lists of floats
    char: returns inner lists of single str characters
    date: returns inner lists of dates
    str: returns inner lists of random strings
    all: returns inner lists of all of the above options. With this option, `num_lists` must be 5

littlebaker.make.an_array(matrix)

matrix=
    matrix to use to create the array, defaults to the default values in `littlebaker.make.a_matrix()`
    must be of type `List[list]`

littlebaker.make.some_json(value_length)

value_length=
    positive integer, specifies the length of the values returned in the resulting json, defaults to 5

littlebaker.make.a_df(n)

n=
    positive integer for the number of rows desired in the DataFrame, defaults to 100

littlebaker.make.a_csv(path, filename, rows, df, index)

path=
    filepath to desired save location, defaults to the current `.py` file's directory
filename=
    desired name of file, defaults to `littlebaker.csv`
rows=
    positive integer to specity number of rows desired in the csv file, defaults to 100
df=
    Pandas DataFrame to be written to csv, defaults to `littlebaker.make.a_df()`
index=
    boolean to specify if an index is desired in the resulting csv

littlebaker can also generate dates for you with littlebaker.date_generator()

date_generator(num_dates, start_year, end_year, as_list)

num_dates=
    positive integer to specify the number of dates desired to be returned, defaults to 1
start_year=
    positive integer for the beginning year of the random date(s) to be returned, defaults 1950
end_year=
    positive integer for the end year of the random date(s) to be returned, defaults to the current year
as_list=
    boolean to specify if the date(s) returned should be in list form or as individual newline separated dates, defaults to False

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

littlebaker-0.0.1.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

littlebaker-0.0.1-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file littlebaker-0.0.1.tar.gz.

File metadata

  • Download URL: littlebaker-0.0.1.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for littlebaker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c024bb9df1a8447ba9aa02d3d5b7fca305c4e6d00e1173ee83eae39134081655
MD5 7d9ffe70b3dd369da7609074ec4f9006
BLAKE2b-256 cae2e91a4104acc60c4de9ce34512277266258ed0cca28987ac6290662a32012

See more details on using hashes here.

File details

Details for the file littlebaker-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: littlebaker-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for littlebaker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f70f07e6359a555697cf467259647a035c0a687e6eeff05d1b520dccf981ac9
MD5 f29fa67ad0900b58b228ff1c4889186b
BLAKE2b-256 8a1cc9e3faf425956a765037171bbff86ac61a4141c5c994e9d82c3bef7fb311

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