API Reference

Python Documentation

class e7epd.E7EPD(db_conn: Engine)
class ConfigTable(session: Session, engine: Engine)

A generic configuration table. Currently, this is only used to store a db_ver key

This creates a table (e7epd_config) with a key-value style data scheme.

get_info(key: str) Optional[str]
store_info(key: str, value: str)
get_db_version() Optional[str]
store_current_db_version()
add_user(u: Users)
get_user_by_name(name: str)
close()

Commits to the database and closes the database connection. Call this when exiting your program

save()

Saves any changes done to the database

check_if_already_in_db_by_ipn(ipn: str) -> (None, <class 'int'>)

Checks if an ipn is already in the database

Parameters:

ipn – The internal part number to look for

Returns: A tuple, the first index being the SQL ID, the second being the component GenericPart class of the part

get_all_ipb_in_db()

Gets all stored manufacturer part numbers in the database

Returns: A list containing all manufacturer part number

wipe_database()

Wipes the component databases

update_database()

Updates the database to the most recent revision

todo: this function needs to be updated for 0.7 changes

is_latest_database() bool

Returns whether the database is matched with the latest rev :returns: True if the database is the latest, False if not :rtype: bool

backup_db()

Backs up the database under a new backup file

exception e7epd.InputException(message)

Exception that gets raised on any input error

exception e7epd.EmptyInDatabase

Exception that gets raised when there is no parts in the database

exception e7epd.NegativeStock(amount_to_make_zero)

Exception that gets raised when the removal of stock will result in a negative stock, which is physically impossible (you’re always welcome to prove me wrong)

amount_to_make_zero

How many parts to make the part’s stock zero.

Type:

int

Autofill Helpers

This wrapper module also comes with some autofill helpers. All are in the dictionary autofill_helpers_list. Here are the current autofill helpers available:

  • ic_manufacturers: IC manufacturers like TI and Cypress

  • ic_types: The IC type, like Microcontroller and ADC

  • capacitor_types: Capacitor types like Ceramic and Electrolytic

  • diode_type: Diode Types

  • passive_manufacturers: Passives (resistors, capacitors, etc) manufacturers

  • passive_packages: Packages for passives

  • ic_packages: Packages for ICs

  • mosfet_types: MOSFET types (N-Channel, P-Channel)

  • bjt_types: BTJ Type (NPN, PNP)

  • fuse_types: Fuse Type (Slow Blow, PTC, etc)

  • led_types: LED “Type” (Red, RGB, Addressable, etc)