bfb_delivery.lib package

Subpackages

Submodules

bfb_delivery.lib.constants module

Constants used in the project.

class bfb_delivery.lib.constants.BookOneDrivers

Bases: StrEnum

Drivers for the first book.

This is only an enum so it appears in docs.

DUMMY = 'Dummy'
__new__(value)
static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

class bfb_delivery.lib.constants.BoxType

Bases: StrEnum

Box types for the delivery service.

BASIC = 'BASIC'
GF = 'GF'
LA = 'LA'
VEGAN = 'VEGAN'
__new__(value)
static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

class bfb_delivery.lib.constants.CellColors

Bases: object

Colors for spreadsheet formatting.

BASIC: Final[str] = '00FFCC00'
GF: Final[str] = '0099CC33'
HEADER: Final[str] = '00FFCCCC'
LA: Final[str] = '003399CC'
VEGAN: Final[str] = '00CCCCCC'
class bfb_delivery.lib.constants.CircuitColumns

Bases: object

Column/field/doc name constants for Circuit API.

ACTIVE: Final[str] = 'active'
ADDRESS: Final[str] = 'address'
ADDRESS_LINE_1: Final[str] = 'addressLineOne'
ADDRESS_LINE_2: Final[str] = 'addressLineTwo'
ADDRESS_NAME: Final[str] = 'addressName'
ALLOWED_DRIVERS: Final[str] = 'allowedDrivers'
CANCELED: Final[str] = 'canceled'
CITY: Final[str] = 'city'
CODE: Final[str] = 'code'
COUNTRY: Final[str] = 'country'
DAY: Final[str] = 'day'
DEPOT: Final[str] = 'depot'
DISTRIBUTED: Final[str] = 'distributed'
DONE: Final[str] = 'done'
DRIVERS: Final[str] = 'drivers'
EMAIL: Final[str] = 'email'
EXTERNAL_ID: Final[str] = 'externalId'
ID: Final[str] = 'id'
METADATA: Final[str] = 'metadata'
MONTH: Final[str] = 'month'
NAME: Final[str] = 'name'
NOTES: Final[str] = 'notes'
OPERATIONS: Final[str] = 'operations'
OPTIMIZATION: Final[str] = 'optimization'
ORDER_INFO: Final[str] = 'orderInfo'
PACKAGE_COUNT: Final[str] = 'packageCount'
PHONE: Final[str] = 'phone'
PLACE_ID: Final[str] = 'placeId'
PLAN: Final[str] = 'plan'
PLANS: Final[str] = 'plans'
PRODUCTS: Final[str] = 'products'
RECIPIENT: Final[str] = 'recipient'
RESULT: Final[str] = 'result'
ROUTE: Final[str] = 'route'
SKIPPED_STOPS: Final[str] = 'skippedStops'
STARTS: Final[str] = 'starts'
STATE: Final[str] = 'state'
STOPS: Final[str] = 'stops'
STOP_POSITION: Final[str] = 'stopPosition'
TITLE: Final[str] = 'title'
WRITABLE: Final[str] = 'writable'
YEAR: Final[str] = 'year'
ZIP: Final[str] = 'zip'
class bfb_delivery.lib.constants.Columns

Bases: object

Column name constants.

ADDRESS: Final[str] = 'Address'
BOX_COUNT: Final[str] = 'Box Count'
BOX_TYPE: Final[str] = 'Box Type'
DRIVER: Final[str] = 'Driver'
EMAIL: Final[str] = 'Email'
NAME: Final[str] = 'Name'
NEIGHBORHOOD: Final[str] = 'Neighborhood'
NOTES: Final[str] = 'Notes'
ORDER_COUNT: Final[str] = 'Order Count'
PHONE: Final[str] = 'Phone'
PRODUCT_TYPE: Final[str] = 'Product Type'
STOP_NO: Final[str] = 'Stop #'
class bfb_delivery.lib.constants.Defaults

Bases: object

Default values. E.g., for syncing public API with CLI.

BUILD_ROUTES_FROM_CHUNKED: Final[dict[str, str | bool]] = {'book_one_drivers_file': '', 'extra_notes_file': '', 'no_distribute': False, 'output_dir': '', 'start_date': '', 'verbose': False}
COMBINE_ROUTE_TABLES: Final[dict[str, str]] = {'output_dir': '', 'output_filename': ''}
CREATE_MANIFESTS: Final[dict[str, str]] = {'extra_notes_file': '', 'output_dir': '', 'output_filename': ''}
CREATE_MANIFESTS_FROM_CIRCUIT: Final[dict[str, str | bool | list]] = {'all_hhs': False, 'circuit_output_dir': '', 'end_date': '', 'extra_notes_file': '', 'output_dir': '', 'output_filename': '', 'plan_ids': [], 'start_date': '', 'verbose': False}
FORMAT_COMBINED_ROUTES: Final[dict[str, str]] = {'extra_notes_file': '', 'output_dir': '', 'output_filename': ''}
SPLIT_CHUNKED_ROUTE: Final[dict[str, str | int]] = {'book_one_drivers_file': '', 'date': '', 'n_books': 4, 'output_dir': '', 'output_filename': ''}
class bfb_delivery.lib.constants.DocStrings

Bases: object

Docstrings for the public API.

BUILD_ROUTES_FROM_CHUNKED: Final = <comb_utils.lib.docs.DocString object>
COMBINE_ROUTE_TABLES: Final = <comb_utils.lib.docs.DocString object>
CREATE_MANIFESTS: Final = <comb_utils.lib.docs.DocString object>
CREATE_MANIFESTS_FROM_CIRCUIT: Final = <comb_utils.lib.docs.DocString object>
FORMAT_COMBINED_ROUTES: Final = <comb_utils.lib.docs.DocString object>
SPLIT_CHUNKED_ROUTE: Final = <comb_utils.lib.docs.DocString object>
class bfb_delivery.lib.constants.ExtraNotes

Bases: object

Extra notes to add at bottom of manifests when any stop is tagged.

Is a class so it appears in docs.

__init__()

Initialize the extra notes df.

df: Final[DataFrame]

Extra notes DataFrame. The columns are “tag” and “note”. Made from notes.

notes: Final[list[tuple[str, str]]] = []

(“Cascade Meadows Apartments*”, “Note here.”)

Type:

Tuples of tag and note. Example

class bfb_delivery.lib.constants.IntermediateColumns

Bases: object

Column name constants for intermediate tables.

DRIVER_NAME: Final[str] = 'driver_name'
DRIVER_SHEET_NAME: Final[str] = 'driver_sheet_name'
INITIALIZED: Final[str] = 'initialized'
OPTIMIZED: Final[str] = 'optimized'
PLAN_ID: Final[str] = 'plan_id'
ROUTE_TITLE: Final[str] = 'route_title'
SHEET_NAME: Final[str] = 'sheet_name'
START_DATE: Final[str] = 'start_date'
STOPS_UPLOADED: Final[str] = 'stops_uploaded'
class bfb_delivery.lib.constants.RateLimits

Bases: object

Rate limits for Circuit API.

BATCH_STOP_IMPORT_MAX_STOPS: Final[int] = 1000
BATCH_STOP_IMPORT_SECONDS: Final[float] = 6
OPTIMIZATION_PER_SECOND: Final[float] = 20
OPTIMIZATION_TIMEOUT_SECONDS: Final[float] = 10
READ_SECONDS: Final[float] = 0.1
READ_TIMEOUT_SECONDS: Final[float] = 10
WAIT_DECREASE_SECONDS: Final[float] = 0.6
WAIT_INCREASE_SCALAR: Final[float] = 2
WRITE_SECONDS: Final[float] = 0.2
WRITE_TIMEOUT_SECONDS: Final[float] = 10

bfb_delivery.lib.errors module

Module for custom exceptions.

exception bfb_delivery.lib.errors.AssignmentOutOfRange

Bases: BFBError

Raised when a user selects a driver index out of range.

exception bfb_delivery.lib.errors.BFBError

Bases: Exception

Base class for exceptions in this module.

exception bfb_delivery.lib.errors.InactiveDriverAssignment

Bases: BFBError

Raised when a user selects an inactive driver.

bfb_delivery.lib.utils module

Utility functions for the bfb_delivery module.

bfb_delivery.lib.utils.get_friday(fmt)

Get the soonest Friday.

Return type:

str

Module contents

lib init.