Skip to main content

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

Release files for littlebaker 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for littlebaker 0.0.1
File Size Uploaded
littlebaker-0.0.1.tar.gz 29.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for littlebaker 0.0.1
File Interpreter ABI Platform
littlebaker-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 59.8 kB

Release files / littlebaker-0.0.1.tar.gz

Download URL littlebaker-0.0.1.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c024bb9df1a8447ba9aa02d3d5b7fca305c4e6d00e1173ee83eae39134081655
BLAKE2b-256 checksum
How to use checksums
cae2e91a4104acc60c4de9ce34512277266258ed0cca28987ac6290662a32012
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / littlebaker-0.0.1-py3-none-any.whl

Download URL littlebaker-0.0.1-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f70f07e6359a555697cf467259647a035c0a687e6eeff05d1b520dccf981ac9
BLAKE2b-256 checksum
How to use checksums
8a1cc9e3faf425956a765037171bbff86ac61a4141c5c994e9d82c3bef7fb311
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page