common package¶
Submodules¶
common.database module¶
Module that contains database interaction logic.
This module allows for interaction with a database, and can be run by itself. All database URL generic syntax components are assumed to be stored as environment variables at runtime. For more information about URL generic syntax see WIKI Docs
-
common.database.
logger
¶ The logger used to log information of module.
- Type
-
class
common.database.
Database
[source]¶ Bases:
object
Class that interacts with database.
This class provides further abstraction to a database object that performs database level operations.
-
USER_INFO
¶ Subcomponent of AUTHORITY that consists of username and password preceded by a colon
:
.- Type
-
BASE_HOST_NAME
¶ Part of HOST that is proceded by a forward slash :code:`/’ and the database name, DB_NAME.
- Type
-
DATABASE
¶ The database object that performs database level operations.
-
DATABASE
: pymongo.database.Database¶
-
URI
: str = 'DB_SCHEMEDB_SCHEME_POST_FIX://DB_USERNAME:DB_PASSWORD@DB_BASE_HOST_NAME/DB_NAME:DB_PORT?DB_CONNECTION_OPTIONS'¶
-
classmethod
find
(collection: str, query: dict) → pymongo.cursor.Cursor[source]¶ Filters a collection with a query to find all matching documents.
- Parameters
- Returns
The cursor corresponding to the query.
- Return type
-
classmethod
find_one
(collection: str, query: dict) → pymongo.cursor.Cursor[source]¶ Filters a collection with a query to find matching a document.
- Parameters
- Returns
Cursor corresponding to the query.
- Return type
-
classmethod
insert
(collection: str, data: dict) → None[source]¶ Insert document into a database collection.
-
common.utils module¶
Module that contains a class with utility functions.
-
class
common.utils.
Utils
[source]¶ Bases:
object
Class that provides utility functions.
-
static
check_hashed_password
(password: str, hashed_password: str) → bool[source]¶ Verifies if the provided password matches the hashed_password.
-
static