diff --git a/investing_algorithm_framework/__init__.py b/investing_algorithm_framework/__init__.py new file mode 100644 index 00000000..d22ca761 --- /dev/null +++ b/investing_algorithm_framework/__init__.py @@ -0,0 +1,4 @@ +from investing_algorithm_framework.utils.version import get_version + +VERSION = (1, 0, 0, 'alpha', 0) + diff --git a/investing_algorithm_framework/__main__.py b/investing_algorithm_framework/__main__.py new file mode 100644 index 00000000..a3a59dbe --- /dev/null +++ b/investing_algorithm_framework/__main__.py @@ -0,0 +1,9 @@ +""" +Invokes investing_algorithm_framework-admin when the investing_algorithm_framework framework module is run as a script. +Example: python -m investing_algorithm_framework createbot SampleBot +""" + +from investing_algorithm_framework.core.management import execute_from_command_line + +if __name__ == "__main__": + execute_from_command_line() diff --git a/investing_algorithm_framework/bin/investing-algorithm-framework-admin b/investing_algorithm_framework/bin/investing-algorithm-framework-admin new file mode 100644 index 00000000..d76a586c --- /dev/null +++ b/investing_algorithm_framework/bin/investing-algorithm-framework-admin @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +from investing_algorithm_framework.core.management import execute_from_command_line + +if __name__ == "__main__": + execute_from_command_line() diff --git a/investing_bot_framework/core/__init__.py b/investing_algorithm_framework/core/__init__.py similarity index 100% rename from investing_bot_framework/core/__init__.py rename to investing_algorithm_framework/core/__init__.py diff --git a/investing_bot_framework/core/configuration/__init__.py b/investing_algorithm_framework/core/configuration/__init__.py similarity index 93% rename from investing_bot_framework/core/configuration/__init__.py rename to investing_algorithm_framework/core/configuration/__init__.py index 562ffdc5..e3b9b05b 100644 --- a/investing_bot_framework/core/configuration/__init__.py +++ b/investing_algorithm_framework/core/configuration/__init__.py @@ -4,9 +4,9 @@ from importlib import import_module from enum import Enum -from investing_bot_framework.core.exceptions import ImproperlyConfigured, OperationalException -from investing_bot_framework.core.configuration.template import Template -from investing_bot_framework.core.configuration.config_constants import SETTINGS_MODULE_PATH_ENV_NAME, \ +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured, OperationalException +from investing_algorithm_framework.core.configuration.template import Template +from investing_algorithm_framework.core.configuration.config_constants import SETTINGS_MODULE_PATH_ENV_NAME, \ SETTINGS_STRATEGY_REGISTERED_APPS, SETTINGS_DATA_PROVIDER_REGISTERED_APPS, BASE_DIR, SETTINGS_LOGGING_CONFIG diff --git a/investing_bot_framework/core/configuration/config_constants.py b/investing_algorithm_framework/core/configuration/config_constants.py similarity index 81% rename from investing_bot_framework/core/configuration/config_constants.py rename to investing_algorithm_framework/core/configuration/config_constants.py index de89dd8f..8ca99a87 100644 --- a/investing_bot_framework/core/configuration/config_constants.py +++ b/investing_algorithm_framework/core/configuration/config_constants.py @@ -1,6 +1,6 @@ # Naming conventions -FRAMEWORK_NAME = 'investing investing_bot_framework framework' -FRAMEWORK_CORE_MODULE_NAME = 'investing_bot_framework.core' +FRAMEWORK_NAME = 'investing investing_algorithm_framework framework' +FRAMEWORK_CORE_MODULE_NAME = 'investing_algorithm_framework.core' # Setting related constants SETTINGS_BOT_PROJECT_NAME = 'BOT_PROJECT_NAME' diff --git a/investing_algorithm_framework/core/configuration/setup/__init__.py b/investing_algorithm_framework/core/configuration/setup/__init__.py new file mode 100644 index 00000000..51b39137 --- /dev/null +++ b/investing_algorithm_framework/core/configuration/setup/__init__.py @@ -0,0 +1 @@ +from investing_algorithm_framework.core.configuration.setup.default_template_creators import DefaultBotProjectCreator diff --git a/investing_bot_framework/core/configuration/setup/default_template_creators.py b/investing_algorithm_framework/core/configuration/setup/default_template_creators.py similarity index 87% rename from investing_bot_framework/core/configuration/setup/default_template_creators.py rename to investing_algorithm_framework/core/configuration/setup/default_template_creators.py index c265c6ba..67b07e6b 100644 --- a/investing_bot_framework/core/configuration/setup/default_template_creators.py +++ b/investing_algorithm_framework/core/configuration/setup/default_template_creators.py @@ -1,9 +1,9 @@ import os from shutil import copyfile, copymode -import investing_bot_framework -from investing_bot_framework.core.exceptions import ImproperlyConfigured -from investing_bot_framework.core.configuration.setup.template_creator import TemplateCreator +import investing_algorithm_framework +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured +from investing_algorithm_framework.core.configuration.setup.template_creator import TemplateCreator class DefaultBotProjectCreator(TemplateCreator): @@ -20,7 +20,7 @@ def configure(self) -> None: def create(self) -> None: # Find the default template directory - template_dir = os.path.join(investing_bot_framework.__path__[0], self.TEMPLATE_ROOT_DIR) + template_dir = os.path.join(investing_algorithm_framework.__path__[0], self.TEMPLATE_ROOT_DIR) for root, dirs, files in os.walk(template_dir): @@ -28,7 +28,7 @@ def create(self) -> None: # This is used as the basis for the copying path_rest = root[len(template_dir) + 1:] - # Replace template investing_bot_framework directory with given investing_bot_framework name + # Replace template investing_algorithm_framework directory with given investing_algorithm_framework name path_rest = path_rest.replace(self.BOT_PROJECT_TEMPLATE_DIR_NAME, self._bot_name) # Create the directories if they don't exist @@ -83,7 +83,7 @@ def create(self) -> None: file_data = file.read() - # Replace the placeholder with the investing_bot_framework name + # Replace the placeholder with the investing_algorithm_framework name file_data = file_data.replace(self.BOT_PROJECT_NAME_PLACEHOLDER, self._bot_name) # Write the file out again diff --git a/investing_bot_framework/core/configuration/setup/template_creator.py b/investing_algorithm_framework/core/configuration/setup/template_creator.py similarity index 93% rename from investing_bot_framework/core/configuration/setup/template_creator.py rename to investing_algorithm_framework/core/configuration/setup/template_creator.py index 2df9993f..b26519dc 100644 --- a/investing_bot_framework/core/configuration/setup/template_creator.py +++ b/investing_algorithm_framework/core/configuration/setup/template_creator.py @@ -2,7 +2,7 @@ import stat from abc import ABC, abstractmethod -from investing_bot_framework.core.configuration import Template +from investing_algorithm_framework.core.configuration import Template class TemplateCreator(Template, ABC): diff --git a/investing_bot_framework/core/configuration/template.py b/investing_algorithm_framework/core/configuration/template.py similarity index 72% rename from investing_bot_framework/core/configuration/template.py rename to investing_algorithm_framework/core/configuration/template.py index f25aaf78..a2ee3e7f 100644 --- a/investing_bot_framework/core/configuration/template.py +++ b/investing_algorithm_framework/core/configuration/template.py @@ -1,16 +1,16 @@ from abc import abstractmethod -from investing_bot_framework.core.exceptions import ImproperlyConfigured +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured class Template: """ - A template class is responsible for creating a templates for the investing_bot_framework. + A template class is responsible for creating a templates for the investing_algorithm_framework. """ def __init__(self, bot_project_directory: str, bot_name: str) -> None: """ - investing_bot_framework project directory is the root directory of the given investing_bot_framework. The bot_name will be the same as the root project + investing_algorithm_framework project directory is the root directory of the given investing_algorithm_framework. The bot_name will be the same as the root project directory. For simplicity it is explicitly passed as a parameter """ diff --git a/investing_algorithm_framework/core/context/__init__.py b/investing_algorithm_framework/core/context/__init__.py new file mode 100644 index 00000000..cb6f131a --- /dev/null +++ b/investing_algorithm_framework/core/context/__init__.py @@ -0,0 +1 @@ +from investing_algorithm_framework.core.context.bot_context import BotContext diff --git a/investing_bot_framework/core/context/bot_context.py b/investing_algorithm_framework/core/context/bot_context.py similarity index 82% rename from investing_bot_framework/core/context/bot_context.py rename to investing_algorithm_framework/core/context/bot_context.py index 38cc6ba6..87e172ba 100644 --- a/investing_bot_framework/core/context/bot_context.py +++ b/investing_algorithm_framework/core/context/bot_context.py @@ -1,9 +1,9 @@ from typing import Type -from investing_bot_framework.core.configuration import settings -from investing_bot_framework.core.exceptions import OperationalException -from investing_bot_framework.core.utils import Singleton -from investing_bot_framework.core.states import BotState +from investing_algorithm_framework.core.configuration import settings +from investing_algorithm_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.utils import Singleton +from investing_algorithm_framework.core.states import BotState class BotContext(metaclass=Singleton): @@ -46,7 +46,7 @@ def _check_state(self, raise_exception: bool = False) -> bool: def start(self) -> None: """ - Run the current state of the investing_bot_framework + Run the current state of the investing_algorithm_framework """ self._check_state(raise_exception=True) diff --git a/investing_bot_framework/core/context/state_validator.py b/investing_algorithm_framework/core/context/state_validator.py similarity index 100% rename from investing_bot_framework/core/context/state_validator.py rename to investing_algorithm_framework/core/context/state_validator.py diff --git a/investing_algorithm_framework/core/data_providers/__init__.py b/investing_algorithm_framework/core/data_providers/__init__.py new file mode 100644 index 00000000..4206751c --- /dev/null +++ b/investing_algorithm_framework/core/data_providers/__init__.py @@ -0,0 +1 @@ +from investing_algorithm_framework.core.data_providers.data_provider import DataProvider diff --git a/investing_bot_framework/core/data_providers/data_provider.py b/investing_algorithm_framework/core/data_providers/data_provider.py similarity index 94% rename from investing_bot_framework/core/data_providers/data_provider.py rename to investing_algorithm_framework/core/data_providers/data_provider.py index eab26b75..304d1bcb 100644 --- a/investing_bot_framework/core/data_providers/data_provider.py +++ b/investing_algorithm_framework/core/data_providers/data_provider.py @@ -2,7 +2,7 @@ from typing import Dict, Any from abc import abstractmethod -from investing_bot_framework.core.workers import ScheduledWorker +from investing_algorithm_framework.core.workers import ScheduledWorker logger = logging.getLogger(__name__) diff --git a/investing_bot_framework/core/data_providers/mixins/__init__.py b/investing_algorithm_framework/core/data_providers/mixins/__init__.py similarity index 100% rename from investing_bot_framework/core/data_providers/mixins/__init__.py rename to investing_algorithm_framework/core/data_providers/mixins/__init__.py diff --git a/investing_bot_framework/core/data_providers/mixins/rest_api_mixin.py b/investing_algorithm_framework/core/data_providers/mixins/rest_api_mixin.py similarity index 100% rename from investing_bot_framework/core/data_providers/mixins/rest_api_mixin.py rename to investing_algorithm_framework/core/data_providers/mixins/rest_api_mixin.py diff --git a/investing_algorithm_framework/core/events/__init__.py b/investing_algorithm_framework/core/events/__init__.py new file mode 100644 index 00000000..33cf68b3 --- /dev/null +++ b/investing_algorithm_framework/core/events/__init__.py @@ -0,0 +1,2 @@ +from investing_algorithm_framework.core.events.observable import Observable +from investing_algorithm_framework.core.events.observer import Observer diff --git a/investing_bot_framework/core/events/observable.py b/investing_algorithm_framework/core/events/observable.py similarity index 92% rename from investing_bot_framework/core/events/observable.py rename to investing_algorithm_framework/core/events/observable.py index 27c766df..f8ebfa08 100644 --- a/investing_bot_framework/core/events/observable.py +++ b/investing_algorithm_framework/core/events/observable.py @@ -1,6 +1,6 @@ from typing import List from abc import ABC, abstractmethod -from investing_bot_framework.core.events.observer import Observer +from investing_algorithm_framework.core.events.observer import Observer class Observable(ABC): diff --git a/investing_bot_framework/core/events/observer.py b/investing_algorithm_framework/core/events/observer.py similarity index 100% rename from investing_bot_framework/core/events/observer.py rename to investing_algorithm_framework/core/events/observer.py diff --git a/investing_bot_framework/core/exceptions.py b/investing_algorithm_framework/core/exceptions.py similarity index 84% rename from investing_bot_framework/core/exceptions.py rename to investing_algorithm_framework/core/exceptions.py index c20ee3cf..8d757ccb 100644 --- a/investing_bot_framework/core/exceptions.py +++ b/investing_algorithm_framework/core/exceptions.py @@ -1,6 +1,6 @@ class ImproperlyConfigured(Exception): """ - Class ImproperlyConfigured: Exception class indicating a problem with the configuration of the investing_bot_framework + Class ImproperlyConfigured: Exception class indicating a problem with the configuration of the investing_algorithm_framework """ def __init__(self, message) -> None: super(ImproperlyConfigured, self).__init__(message) @@ -8,7 +8,7 @@ def __init__(self, message) -> None: class OperationalException(Exception): """ - Class OperationalException: Exception class indicating a problem occurred during running of the investing_bot_framework + Class OperationalException: Exception class indicating a problem occurred during running of the investing_algorithm_framework """ def __init__(self, message) -> None: super(OperationalException, self).__init__(message) diff --git a/investing_algorithm_framework/core/executors/__init__.py b/investing_algorithm_framework/core/executors/__init__.py new file mode 100644 index 00000000..385bc8fe --- /dev/null +++ b/investing_algorithm_framework/core/executors/__init__.py @@ -0,0 +1,2 @@ +from investing_algorithm_framework.core.executors.executor import Executor +from investing_algorithm_framework.core.executors.execution_scheduler import ExecutionScheduler diff --git a/investing_bot_framework/core/executors/execution_scheduler.py b/investing_algorithm_framework/core/executors/execution_scheduler.py similarity index 96% rename from investing_bot_framework/core/executors/execution_scheduler.py rename to investing_algorithm_framework/core/executors/execution_scheduler.py index 0caa10ca..658edfec 100644 --- a/investing_bot_framework/core/executors/execution_scheduler.py +++ b/investing_algorithm_framework/core/executors/execution_scheduler.py @@ -2,8 +2,8 @@ from collections import namedtuple from typing import Dict, List -from investing_bot_framework.core.utils import TimeUnit -from investing_bot_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.utils import TimeUnit +from investing_algorithm_framework.core.exceptions import OperationalException ExecutionTask = namedtuple('ExecutionTask', 'time_unit interval last_run') diff --git a/investing_bot_framework/core/executors/executor.py b/investing_algorithm_framework/core/executors/executor.py similarity index 87% rename from investing_bot_framework/core/executors/executor.py rename to investing_algorithm_framework/core/executors/executor.py index 46960976..cced4296 100644 --- a/investing_bot_framework/core/executors/executor.py +++ b/investing_algorithm_framework/core/executors/executor.py @@ -3,12 +3,12 @@ from wrapt import synchronized from abc import abstractmethod, ABC -from investing_bot_framework.core.workers import Worker -from investing_bot_framework.core.exceptions import OperationalException -from investing_bot_framework.core.utils import StoppableThread -from investing_bot_framework.core.events.observer import Observer -from investing_bot_framework.core.events.observable import Observable -from investing_bot_framework.core.configuration.config_constants import DEFAULT_MAX_WORKERS +from investing_algorithm_framework.core.workers import Worker +from investing_algorithm_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.utils import StoppableThread +from investing_algorithm_framework.core.events.observer import Observer +from investing_algorithm_framework.core.events.observable import Observable +from investing_algorithm_framework.core.configuration.config_constants import DEFAULT_MAX_WORKERS class Executor(Observable, Observer, ABC): diff --git a/investing_algorithm_framework/core/extensions.py b/investing_algorithm_framework/core/extensions.py new file mode 100644 index 00000000..7a12f9cb --- /dev/null +++ b/investing_algorithm_framework/core/extensions.py @@ -0,0 +1,3 @@ +from investing_algorithm_framework.core.resolvers import DatabaseResolver + +db = DatabaseResolver() \ No newline at end of file diff --git a/investing_algorithm_framework/core/management/__init__.py b/investing_algorithm_framework/core/management/__init__.py new file mode 100644 index 00000000..52bab28b --- /dev/null +++ b/investing_algorithm_framework/core/management/__init__.py @@ -0,0 +1,2 @@ +from investing_algorithm_framework.core.management.command import BaseCommand +from investing_algorithm_framework.core.management.command_manager import execute_from_command_line diff --git a/investing_bot_framework/core/management/command.py b/investing_algorithm_framework/core/management/command.py similarity index 98% rename from investing_bot_framework/core/management/command.py rename to investing_algorithm_framework/core/management/command.py index bf4348fc..d165ad8e 100644 --- a/investing_bot_framework/core/management/command.py +++ b/investing_algorithm_framework/core/management/command.py @@ -4,7 +4,7 @@ from abc import abstractmethod, ABC from colorama import Fore -from investing_bot_framework.core.exceptions import ImproperlyConfigured +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured class CommandError(Exception): diff --git a/investing_bot_framework/core/management/command_manager.py b/investing_algorithm_framework/core/management/command_manager.py similarity index 84% rename from investing_bot_framework/core/management/command_manager.py rename to investing_algorithm_framework/core/management/command_manager.py index 86ded452..ea8a3d75 100644 --- a/investing_bot_framework/core/management/command_manager.py +++ b/investing_algorithm_framework/core/management/command_manager.py @@ -1,10 +1,10 @@ import os import sys -from investing_bot_framework.core.management import BaseCommand -from investing_bot_framework.core.resolvers import ClassCollector -from investing_bot_framework.core.management.utils import get_commands -from investing_bot_framework.core.management.commands.help import HelpCommand +from investing_algorithm_framework.core.management import BaseCommand +from investing_algorithm_framework.core.resolvers import ClassCollector +from investing_algorithm_framework.core.management.utils import get_commands +from investing_algorithm_framework.core.management.commands.help import HelpCommand class ManagementUtility: @@ -17,7 +17,7 @@ def __init__(self, argv=None) -> None: self.program_name = os.path.basename(self.argv[0]) if self.program_name == '__main__.py': - self.program_name = 'python -m investing-investing_bot_framework' + self.program_name = 'python -m investing-investing_algorithm_framework' self.settings_exception = None def execute(self) -> None: diff --git a/investing_bot_framework/core/management/commands/__init__.py b/investing_algorithm_framework/core/management/commands/__init__.py similarity index 100% rename from investing_bot_framework/core/management/commands/__init__.py rename to investing_algorithm_framework/core/management/commands/__init__.py diff --git a/investing_bot_framework/core/management/commands/createbot.py b/investing_algorithm_framework/core/management/commands/createbot.py similarity index 73% rename from investing_bot_framework/core/management/commands/createbot.py rename to investing_algorithm_framework/core/management/commands/createbot.py index ae3d82ac..72a0c784 100644 --- a/investing_bot_framework/core/management/commands/createbot.py +++ b/investing_algorithm_framework/core/management/commands/createbot.py @@ -2,22 +2,22 @@ import re from importlib import import_module -from investing_bot_framework.core.exceptions import ImproperlyConfigured -from investing_bot_framework.core.management.command import BaseCommand, CommandError -from investing_bot_framework.core.configuration.setup import DefaultBotProjectCreator +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured +from investing_algorithm_framework.core.management.command import BaseCommand, CommandError +from investing_algorithm_framework.core.configuration.setup import DefaultBotProjectCreator class CreateBotCommand(BaseCommand): help = ( - "Creates a project directory structure for the given investing_bot_framework name in the current directory or optionally " + "Creates a project directory structure for the given investing_algorithm_framework name in the current directory or optionally " "in the given directory." ) - missing_args_message = "You must provide a investing_bot_framework name." + missing_args_message = "You must provide a investing_algorithm_framework name." success_message = "Bot created and initialized." def add_arguments(self, parser): - parser.add_argument('name', help='Name of the investing_bot_framework.') + parser.add_argument('name', help='Name of the investing_algorithm_framework.') parser.add_argument('directory', nargs='?', help='Optional destination directory') parser.add_argument( '--template_creator', @@ -33,13 +33,13 @@ def handle(self, **options) -> str: self.validate_name(bot_name) - # initialize the investing_bot_framework project directory + # initialize the investing_algorithm_framework project directory if directory is None: directory = os.path.join(os.getcwd(), bot_name) if os.path.isdir(directory): raise ImproperlyConfigured( - "Directory {} already exists. Please make sure that the investing_bot_framework project name does not correspond to " + "Directory {} already exists. Please make sure that the investing_algorithm_framework project name does not correspond to " "an existing directory" ) @@ -51,7 +51,7 @@ def handle(self, **options) -> str: if not os.path.exists(directory): raise CommandError("Destination directory {} does not exist, please create it first.".format(directory)) - # Use default investing_bot_framework creator + # Use default investing_algorithm_framework creator if not template_creator: bot_template_creator = DefaultBotProjectCreator(directory, bot_name) @@ -62,11 +62,11 @@ def handle(self, **options) -> str: @staticmethod def validate_name(name: str) -> None: """ - Helper function to validate the name of a given investing_bot_framework + Helper function to validate the name of a given investing_algorithm_framework """ if name is None: - raise CommandError("you must provide a investing_bot_framework name") + raise CommandError("you must provide a investing_algorithm_framework name") if not re.match("^[a-zA-Z]+\w*$", name): raise CommandError("{} is not allowed, value must begin with a letter and " @@ -80,6 +80,6 @@ def validate_name(name: str) -> None: else: raise CommandError( "'{}' conflicts with the name of an existing Python " - "module and cannot be used as a investing_bot_framework name. Please try " + "module and cannot be used as a investing_algorithm_framework name. Please try " "another name.".format(name) ) diff --git a/investing_bot_framework/core/management/commands/help.py b/investing_algorithm_framework/core/management/commands/help.py similarity index 80% rename from investing_bot_framework/core/management/commands/help.py rename to investing_algorithm_framework/core/management/commands/help.py index aa03063d..3ecf700c 100644 --- a/investing_bot_framework/core/management/commands/help.py +++ b/investing_algorithm_framework/core/management/commands/help.py @@ -1,9 +1,9 @@ from typing import Any from collections import defaultdict -from investing_bot_framework.core.management import BaseCommand -from investing_bot_framework.core.management.utils import get_commands -from investing_bot_framework.core.configuration.config_constants import FRAMEWORK_CORE_MODULE_NAME, FRAMEWORK_NAME +from investing_algorithm_framework.core.management import BaseCommand +from investing_algorithm_framework.core.management.utils import get_commands +from investing_algorithm_framework.core.configuration.config_constants import FRAMEWORK_CORE_MODULE_NAME, FRAMEWORK_NAME class HelpCommand(BaseCommand): @@ -17,7 +17,7 @@ def add_arguments(self, parser) -> None: def handle(self) -> Any: usage = [ "", - "This is the command line management for the investing investing_bot_framework framework. \n" + "This is the command line management for the investing investing_algorithm_framework framework. \n" "Type help ' for help on a specific sub command.", "", "Available sub commands:", diff --git a/investing_bot_framework/core/management/commands/runbot.py b/investing_algorithm_framework/core/management/commands/runbot.py similarity index 59% rename from investing_bot_framework/core/management/commands/runbot.py rename to investing_algorithm_framework/core/management/commands/runbot.py index 0b45964b..45a446d9 100644 --- a/investing_bot_framework/core/management/commands/runbot.py +++ b/investing_algorithm_framework/core/management/commands/runbot.py @@ -1,14 +1,14 @@ from typing import Any -from investing_bot_framework.core.management.command import BaseCommand, CommandError -from investing_bot_framework.core.context import BotContext -from investing_bot_framework.core.configuration.config_constants import SETTINGS_BOT_CONTEXT_CONFIGURATION -from investing_bot_framework.core.configuration import settings +from investing_algorithm_framework.core.management.command import BaseCommand, CommandError +from investing_algorithm_framework.core.context import BotContext +from investing_algorithm_framework.core.configuration.config_constants import SETTINGS_BOT_CONTEXT_CONFIGURATION +from investing_algorithm_framework.core.configuration import settings class RunBotCommand(BaseCommand): help_message = ( - "Runs a investing_bot_framework, by default it will run until stopped, if cycles is specified it will run " + "Runs a investing_algorithm_framework, by default it will run until stopped, if cycles is specified it will run " "the according to the amount of cycles" ) @@ -19,7 +19,7 @@ class RunBotCommand(BaseCommand): def add_arguments(self, parser) -> None: parser.add_argument( '--cycles', - help='Optional number for the amount of cycles the investing_bot_framework runs' + help='Optional number for the amount of cycles the investing_algorithm_framework runs' ) def handle(self, *args, **options) -> Any: @@ -32,7 +32,7 @@ def handle(self, *args, **options) -> Any: cycles = options.get('name', None) - # Create an investing_bot_framework context of the investing_bot_framework and run it + # Create an investing_algorithm_framework context of the investing_algorithm_framework and run it context = BotContext() context.start() diff --git a/investing_bot_framework/core/management/utils.py b/investing_algorithm_framework/core/management/utils.py similarity index 71% rename from investing_bot_framework/core/management/utils.py rename to investing_algorithm_framework/core/management/utils.py index 016f83db..5aa3146e 100644 --- a/investing_bot_framework/core/management/utils.py +++ b/investing_algorithm_framework/core/management/utils.py @@ -3,10 +3,10 @@ import functools from typing import Dict, List -from investing_bot_framework.core.resolvers import ClassCollector -from investing_bot_framework.core.management.command import BaseCommand -from investing_bot_framework.core.configuration import settings -from investing_bot_framework.core.configuration.config_constants import SETTINGS_MODULE_PATH_ENV_NAME +from investing_algorithm_framework.core.resolvers import ClassCollector +from investing_algorithm_framework.core.management.command import BaseCommand +from investing_algorithm_framework.core.configuration import settings +from investing_algorithm_framework.core.configuration.config_constants import SETTINGS_MODULE_PATH_ENV_NAME # Load the settings settings = settings @@ -30,7 +30,7 @@ def get_commands() -> Dict[str, str]: """ # Base commands - commands = {name: 'investing_bot_framework.core' for name in find_commands(os.path.join(os.path.dirname(__file__)))} + commands = {name: 'investing_algorithm_framework.core' for name in find_commands(os.path.join(os.path.dirname(__file__)))} if not settings.configured: return commands diff --git a/investing_algorithm_framework/core/order_executors/__init__.py b/investing_algorithm_framework/core/order_executors/__init__.py new file mode 100644 index 00000000..6352e5b6 --- /dev/null +++ b/investing_algorithm_framework/core/order_executors/__init__.py @@ -0,0 +1 @@ +from investing_algorithm_framework.core.order_executors.order_executor import OrderExecutor diff --git a/investing_bot_framework/core/order_executors/order_executor.py b/investing_algorithm_framework/core/order_executors/order_executor.py similarity index 100% rename from investing_bot_framework/core/order_executors/order_executor.py rename to investing_algorithm_framework/core/order_executors/order_executor.py diff --git a/investing_algorithm_framework/core/resolvers/__init__.py b/investing_algorithm_framework/core/resolvers/__init__.py new file mode 100644 index 00000000..06ed3192 --- /dev/null +++ b/investing_algorithm_framework/core/resolvers/__init__.py @@ -0,0 +1,3 @@ +from investing_algorithm_framework.core.resolvers.class_collector import ClassCollector +from investing_algorithm_framework.core.resolvers.database_resolver import DatabaseResolver + diff --git a/investing_bot_framework/core/resolvers/class_collector.py b/investing_algorithm_framework/core/resolvers/class_collector.py similarity index 100% rename from investing_bot_framework/core/resolvers/class_collector.py rename to investing_algorithm_framework/core/resolvers/class_collector.py diff --git a/investing_bot_framework/core/resolvers/database_resolver.py b/investing_algorithm_framework/core/resolvers/database_resolver.py similarity index 94% rename from investing_bot_framework/core/resolvers/database_resolver.py rename to investing_algorithm_framework/core/resolvers/database_resolver.py index 12c57d16..70994aba 100644 --- a/investing_bot_framework/core/resolvers/database_resolver.py +++ b/investing_algorithm_framework/core/resolvers/database_resolver.py @@ -9,9 +9,9 @@ from sqlalchemy.exc import DatabaseError -from investing_bot_framework.core.configuration import settings -from investing_bot_framework.core.configuration.config_constants import BASE_DIR, DATABASE_NAME -from investing_bot_framework.core.exceptions import DatabaseOperationalException +from investing_algorithm_framework.core.configuration import settings +from investing_algorithm_framework.core.configuration.config_constants import BASE_DIR, DATABASE_NAME +from investing_algorithm_framework.core.exceptions import DatabaseOperationalException class _SessionProperty: diff --git a/investing_algorithm_framework/core/resolvers/module_loaders/__init__.py b/investing_algorithm_framework/core/resolvers/module_loaders/__init__.py new file mode 100644 index 00000000..fe4c826b --- /dev/null +++ b/investing_algorithm_framework/core/resolvers/module_loaders/__init__.py @@ -0,0 +1 @@ +from investing_algorithm_framework.core.resolvers.module_loaders.data_providers_loader import DataProvidersLoader diff --git a/investing_bot_framework/core/resolvers/module_loaders/data_providers_loader.py b/investing_algorithm_framework/core/resolvers/module_loaders/data_providers_loader.py similarity index 78% rename from investing_bot_framework/core/resolvers/module_loaders/data_providers_loader.py rename to investing_algorithm_framework/core/resolvers/module_loaders/data_providers_loader.py index 84e79d20..6fa51886 100644 --- a/investing_bot_framework/core/resolvers/module_loaders/data_providers_loader.py +++ b/investing_algorithm_framework/core/resolvers/module_loaders/data_providers_loader.py @@ -1,9 +1,9 @@ from typing import List -from investing_bot_framework.core.exceptions import ImproperlyConfigured -from investing_bot_framework.core.configuration import settings -from investing_bot_framework.core.resolvers import ClassCollector -from investing_bot_framework.core.data_providers import DataProvider +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured +from investing_algorithm_framework.core.configuration import settings +from investing_algorithm_framework.core.resolvers import ClassCollector +from investing_algorithm_framework.core.data_providers import DataProvider class DataProvidersLoader: diff --git a/investing_algorithm_framework/core/states/__init__.py b/investing_algorithm_framework/core/states/__init__.py new file mode 100644 index 00000000..7b4016c6 --- /dev/null +++ b/investing_algorithm_framework/core/states/__init__.py @@ -0,0 +1,2 @@ +from investing_algorithm_framework.core.states.bot_state import BotState + diff --git a/investing_bot_framework/core/states/bot_state.py b/investing_algorithm_framework/core/states/bot_state.py similarity index 94% rename from investing_bot_framework/core/states/bot_state.py rename to investing_algorithm_framework/core/states/bot_state.py index 884d4d89..a576b20e 100644 --- a/investing_bot_framework/core/states/bot_state.py +++ b/investing_algorithm_framework/core/states/bot_state.py @@ -1,13 +1,13 @@ from abc import ABC, abstractmethod from typing import List -from investing_bot_framework.core.context.state_validator import StateValidator +from investing_algorithm_framework.core.context.state_validator import StateValidator class BotState(ABC): """ Represents a state of the Bot, these states are use by the BotContext. Each implemented state represents a work - mode for the investing_bot_framework. + mode for the investing_algorithm_framework. """ # Transition state for the next BotState diff --git a/investing_bot_framework/core/states/templates/__init__.py b/investing_algorithm_framework/core/states/templates/__init__.py similarity index 100% rename from investing_bot_framework/core/states/templates/__init__.py rename to investing_algorithm_framework/core/states/templates/__init__.py diff --git a/investing_bot_framework/core/states/templates/data_providing_state.py b/investing_algorithm_framework/core/states/templates/data_providing_state.py similarity index 85% rename from investing_bot_framework/core/states/templates/data_providing_state.py rename to investing_algorithm_framework/core/states/templates/data_providing_state.py index 074caa1a..66e6c905 100644 --- a/investing_bot_framework/core/states/templates/data_providing_state.py +++ b/investing_algorithm_framework/core/states/templates/data_providing_state.py @@ -3,15 +3,15 @@ from typing import List from wrapt import synchronized -from investing_bot_framework.core.events import Observer -from investing_bot_framework.core.context.bot_context import BotContext -from investing_bot_framework.core.exceptions import OperationalException -from investing_bot_framework.core.states import BotState -from investing_bot_framework.core.executors import ExecutionScheduler -from investing_bot_framework.core.workers import Worker -from investing_bot_framework.core.data_providers import DataProvider -from investing_bot_framework.core.executors import Executor -from investing_bot_framework.core.configuration.config_constants import DEFAULT_MAX_WORKERS, SETTINGS_MAX_WORKERS +from investing_algorithm_framework.core.events import Observer +from investing_algorithm_framework.core.context.bot_context import BotContext +from investing_algorithm_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.states import BotState +from investing_algorithm_framework.core.executors import ExecutionScheduler +from investing_algorithm_framework.core.workers import Worker +from investing_algorithm_framework.core.data_providers import DataProvider +from investing_algorithm_framework.core.executors import Executor +from investing_algorithm_framework.core.configuration.config_constants import DEFAULT_MAX_WORKERS, SETTINGS_MAX_WORKERS logger = logging.getLogger(__name__) @@ -78,7 +78,7 @@ class DataProvidingState(BotState, Observer): registered_data_providers: List = None - from investing_bot_framework.core.states.templates.strategy_state import StrategyState + from investing_algorithm_framework.core.states.templates.strategy_state import StrategyState transition_state_class = StrategyState data_provider_scheduler: DataProviderScheduler = None diff --git a/investing_bot_framework/core/states/templates/ordering_state.py b/investing_algorithm_framework/core/states/templates/ordering_state.py similarity index 68% rename from investing_bot_framework/core/states/templates/ordering_state.py rename to investing_algorithm_framework/core/states/templates/ordering_state.py index c1e5763d..a69dc796 100644 --- a/investing_bot_framework/core/states/templates/ordering_state.py +++ b/investing_algorithm_framework/core/states/templates/ordering_state.py @@ -1,13 +1,13 @@ from typing import List -from investing_bot_framework.core.states import BotState -from investing_bot_framework.core.exceptions import OperationalException -from investing_bot_framework.core.order_executors import OrderExecutor +from investing_algorithm_framework.core.states import BotState +from investing_algorithm_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.order_executors import OrderExecutor class OrderingState(BotState): - from investing_bot_framework.core.states.templates.data_providing_state import DataProvidingState + from investing_algorithm_framework.core.states.templates.data_providing_state import DataProvidingState transition_state_class = DataProvidingState order_executors: List[OrderExecutor] = None diff --git a/investing_bot_framework/core/states/templates/setup_state.py b/investing_algorithm_framework/core/states/templates/setup_state.py similarity index 59% rename from investing_bot_framework/core/states/templates/setup_state.py rename to investing_algorithm_framework/core/states/templates/setup_state.py index 96ff6df8..176bb3c4 100644 --- a/investing_bot_framework/core/states/templates/setup_state.py +++ b/investing_algorithm_framework/core/states/templates/setup_state.py @@ -1,14 +1,14 @@ import logging -from investing_bot_framework.core.exceptions import ImproperlyConfigured -from investing_bot_framework.core.states import BotState +from investing_algorithm_framework.core.exceptions import ImproperlyConfigured +from investing_algorithm_framework.core.states import BotState logger = logging.getLogger(__name__) class SetupState(BotState): - from investing_bot_framework.core.states.templates.data_providing_state import DataProvidingState + from investing_algorithm_framework.core.states.templates.data_providing_state import DataProvidingState transition_state_class = DataProvidingState def __init__(self, context): @@ -26,8 +26,8 @@ def run(self) -> None: # Load the settings if not self.context.settings.configured: raise ImproperlyConfigured( - "Settings module is not specified, make sure you have setup a investing_bot_framework project and " - "the investing_bot_framework is valid or that you have specified the settings module in your " + "Settings module is not specified, make sure you have setup a investing_algorithm_framework project and " + "the investing_algorithm_framework is valid or that you have specified the settings module in your " "manage.py file" ) diff --git a/investing_bot_framework/core/states/templates/strategy_state.py b/investing_algorithm_framework/core/states/templates/strategy_state.py similarity index 85% rename from investing_bot_framework/core/states/templates/strategy_state.py rename to investing_algorithm_framework/core/states/templates/strategy_state.py index fb01c241..616594f1 100644 --- a/investing_bot_framework/core/states/templates/strategy_state.py +++ b/investing_algorithm_framework/core/states/templates/strategy_state.py @@ -2,13 +2,13 @@ import time from typing import List -from investing_bot_framework.core.states import BotState -from investing_bot_framework.core.executors import ExecutionScheduler -from investing_bot_framework.core.exceptions import OperationalException -from investing_bot_framework.core.workers import Worker -from investing_bot_framework.core.executors import Executor -from investing_bot_framework.core.events import Observer -from investing_bot_framework.core.configuration.config_constants import DEFAULT_MAX_WORKERS, SETTINGS_MAX_WORKERS +from investing_algorithm_framework.core.states import BotState +from investing_algorithm_framework.core.executors import ExecutionScheduler +from investing_algorithm_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.workers import Worker +from investing_algorithm_framework.core.executors import Executor +from investing_algorithm_framework.core.events import Observer +from investing_algorithm_framework.core.configuration.config_constants import DEFAULT_MAX_WORKERS, SETTINGS_MAX_WORKERS logger = logging.getLogger(__name__) @@ -133,6 +133,6 @@ def register_strategies(strategies: List) -> None: StrategyState.registered_strategies = strategies def get_transition_state_class(self): - from investing_bot_framework.core.states.templates.ordering_state import OrderingState + from investing_algorithm_framework.core.states.templates.ordering_state import OrderingState return OrderingState diff --git a/investing_algorithm_framework/core/strategies/__init__.py b/investing_algorithm_framework/core/strategies/__init__.py new file mode 100644 index 00000000..3851b14d --- /dev/null +++ b/investing_algorithm_framework/core/strategies/__init__.py @@ -0,0 +1 @@ +from investing_algorithm_framework.core.strategies.strategy import Strategy diff --git a/investing_bot_framework/core/strategies/strategy.py b/investing_algorithm_framework/core/strategies/strategy.py similarity index 85% rename from investing_bot_framework/core/strategies/strategy.py rename to investing_algorithm_framework/core/strategies/strategy.py index 21fea0ef..b5302493 100644 --- a/investing_bot_framework/core/strategies/strategy.py +++ b/investing_algorithm_framework/core/strategies/strategy.py @@ -2,7 +2,7 @@ from typing import Dict, Any from abc import abstractmethod -from investing_bot_framework.core.workers import ScheduledWorker +from investing_algorithm_framework.core.workers import ScheduledWorker logger = logging.getLogger(__name__) diff --git a/investing_bot_framework/core/utils.py b/investing_algorithm_framework/core/utils.py similarity index 97% rename from investing_bot_framework/core/utils.py rename to investing_algorithm_framework/core/utils.py index bd3862c3..353df2ec 100644 --- a/investing_bot_framework/core/utils.py +++ b/investing_algorithm_framework/core/utils.py @@ -3,7 +3,7 @@ from wrapt import synchronized from enum import Enum -from investing_bot_framework.core.exceptions import OperationalException +from investing_algorithm_framework.core.exceptions import OperationalException class Singleton(type): diff --git a/investing_algorithm_framework/core/workers/__init__.py b/investing_algorithm_framework/core/workers/__init__.py new file mode 100644 index 00000000..e469a020 --- /dev/null +++ b/investing_algorithm_framework/core/workers/__init__.py @@ -0,0 +1,3 @@ +from investing_algorithm_framework.core.workers.worker import Worker +from investing_algorithm_framework.core.workers.scheduled_worker import ScheduledWorker + diff --git a/investing_bot_framework/core/workers/scheduled_worker.py b/investing_algorithm_framework/core/workers/scheduled_worker.py similarity index 84% rename from investing_bot_framework/core/workers/scheduled_worker.py rename to investing_algorithm_framework/core/workers/scheduled_worker.py index 722bfa45..f327fbe3 100644 --- a/investing_bot_framework/core/workers/scheduled_worker.py +++ b/investing_algorithm_framework/core/workers/scheduled_worker.py @@ -1,7 +1,7 @@ from abc import ABC -from investing_bot_framework.core.utils import TimeUnit -from investing_bot_framework.core.workers.worker import Worker +from investing_algorithm_framework.core.utils import TimeUnit +from investing_algorithm_framework.core.workers.worker import Worker class ScheduledWorker(Worker, ABC): diff --git a/investing_bot_framework/core/workers/worker.py b/investing_algorithm_framework/core/workers/worker.py similarity index 88% rename from investing_bot_framework/core/workers/worker.py rename to investing_algorithm_framework/core/workers/worker.py index 6a7ecb8e..6b086a2f 100644 --- a/investing_bot_framework/core/workers/worker.py +++ b/investing_algorithm_framework/core/workers/worker.py @@ -1,8 +1,8 @@ from abc import abstractmethod, ABC from typing import Dict, Any -from investing_bot_framework.core.events.observable import Observable -from investing_bot_framework.core.events.observer import Observer +from investing_algorithm_framework.core.events.observable import Observable +from investing_algorithm_framework.core.events.observer import Observer class Worker(Observable, ABC): diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/__init__.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/configuration/__init__.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/__init__.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/configuration/__init__.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/context.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/configuration/context.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/context.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/configuration/context.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/settings.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/configuration/settings.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/settings.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/configuration/settings.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/data_providers/__init__.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/data_providers/__init__.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/data_providers/__init__.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/data_providers/__init__.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/data_providers/data_providers.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/data_providers/data_providers.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/data_providers/data_providers.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/data_providers/data_providers.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/order_executors/__init__.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/order_executors/__init__.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/order_executors/__init__.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/order_executors/__init__.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/order_executors/order_executors.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/order_executors/order_executors.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/order_executors/order_executors.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/order_executors/order_executors.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/strategies/__init__.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/strategies/__init__.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/strategies/__init__.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/strategies/__init__.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/bot_project_template/strategies/strategies.py-template b/investing_algorithm_framework/templates/bot_project_directory/bot_project_template/strategies/strategies.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/bot_project_template/strategies/strategies.py-template rename to investing_algorithm_framework/templates/bot_project_directory/bot_project_template/strategies/strategies.py-template diff --git a/investing_bot_framework/templates/bot_project_directory/manage.py-template b/investing_algorithm_framework/templates/bot_project_directory/manage.py-template similarity index 100% rename from investing_bot_framework/templates/bot_project_directory/manage.py-template rename to investing_algorithm_framework/templates/bot_project_directory/manage.py-template diff --git a/investing_bot_framework/tests/__init__.py b/investing_algorithm_framework/tests/__init__.py similarity index 100% rename from investing_bot_framework/tests/__init__.py rename to investing_algorithm_framework/tests/__init__.py diff --git a/investing_bot_framework/tests/core/__init__.py b/investing_algorithm_framework/tests/core/__init__.py similarity index 100% rename from investing_bot_framework/tests/core/__init__.py rename to investing_algorithm_framework/tests/core/__init__.py diff --git a/investing_bot_framework/tests/core/data/__init__.py b/investing_algorithm_framework/tests/core/data/__init__.py similarity index 100% rename from investing_bot_framework/tests/core/data/__init__.py rename to investing_algorithm_framework/tests/core/data/__init__.py diff --git a/investing_bot_framework/tests/core/data/data_providers/__init__.py b/investing_algorithm_framework/tests/core/data/data_providers/__init__.py similarity index 100% rename from investing_bot_framework/tests/core/data/data_providers/__init__.py rename to investing_algorithm_framework/tests/core/data/data_providers/__init__.py diff --git a/investing_bot_framework/tests/core/data/data_providers/data_provider.py b/investing_algorithm_framework/tests/core/data/data_providers/data_provider.py similarity index 89% rename from investing_bot_framework/tests/core/data/data_providers/data_provider.py rename to investing_algorithm_framework/tests/core/data/data_providers/data_provider.py index d94326cd..28295f44 100644 --- a/investing_bot_framework/tests/core/data/data_providers/data_provider.py +++ b/investing_algorithm_framework/tests/core/data/data_providers/data_provider.py @@ -1,4 +1,4 @@ -from investing_bot_framework.tests.core.data.data_providers.resources import TestDataProviderOne, \ +from investing_algorithm_framework.tests.core.data.data_providers.resources import TestDataProviderOne, \ TestDataProviderTwo, TestObserver diff --git a/investing_bot_framework/tests/core/data/data_providers/resources.py b/investing_algorithm_framework/tests/core/data/data_providers/resources.py similarity index 79% rename from investing_bot_framework/tests/core/data/data_providers/resources.py rename to investing_algorithm_framework/tests/core/data/data_providers/resources.py index 6a8754a2..045a532a 100644 --- a/investing_bot_framework/tests/core/data/data_providers/resources.py +++ b/investing_algorithm_framework/tests/core/data/data_providers/resources.py @@ -1,7 +1,7 @@ from typing import Dict, Any -from investing_bot_framework.core.events import Observer -from investing_bot_framework.core.data_providers import DataProvider +from investing_algorithm_framework.core.events import Observer +from investing_algorithm_framework.core.data_providers import DataProvider class TestDataProviderOne(DataProvider): diff --git a/investing_bot_framework/tests/core/executors/__init__.py b/investing_algorithm_framework/tests/core/executors/__init__.py similarity index 100% rename from investing_bot_framework/tests/core/executors/__init__.py rename to investing_algorithm_framework/tests/core/executors/__init__.py diff --git a/investing_bot_framework/tests/core/executors/resources.py b/investing_algorithm_framework/tests/core/executors/resources.py similarity index 85% rename from investing_bot_framework/tests/core/executors/resources.py rename to investing_algorithm_framework/tests/core/executors/resources.py index 522f6b42..35df71ec 100644 --- a/investing_bot_framework/tests/core/executors/resources.py +++ b/investing_algorithm_framework/tests/core/executors/resources.py @@ -2,9 +2,9 @@ from time import sleep from wrapt import synchronized -from investing_bot_framework.core.workers import Worker -from investing_bot_framework.core.events.observer import Observer -from investing_bot_framework.core.executors import Executor +from investing_algorithm_framework.core.workers import Worker +from investing_algorithm_framework.core.events.observer import Observer +from investing_algorithm_framework.core.executors import Executor class TestObserver(Observer): diff --git a/investing_bot_framework/tests/core/executors/test_executor.py b/investing_algorithm_framework/tests/core/executors/test_executor.py similarity index 94% rename from investing_bot_framework/tests/core/executors/test_executor.py rename to investing_algorithm_framework/tests/core/executors/test_executor.py index 72f2854a..de785ce0 100644 --- a/investing_bot_framework/tests/core/executors/test_executor.py +++ b/investing_algorithm_framework/tests/core/executors/test_executor.py @@ -2,7 +2,7 @@ from unittest import TestCase from time import sleep -from investing_bot_framework.tests.core.executors.resources import TestExecutor, TestWorkerOne, TestWorkerTwo, \ +from investing_algorithm_framework.tests.core.executors.resources import TestExecutor, TestWorkerOne, TestWorkerTwo, \ TestObserver, TestWorkerThree diff --git a/investing_bot_framework/tests/core/executors/test_scheduler.py b/investing_algorithm_framework/tests/core/executors/test_scheduler.py similarity index 97% rename from investing_bot_framework/tests/core/executors/test_scheduler.py rename to investing_algorithm_framework/tests/core/executors/test_scheduler.py index ffa2f9ed..7c6e3372 100644 --- a/investing_bot_framework/tests/core/executors/test_scheduler.py +++ b/investing_algorithm_framework/tests/core/executors/test_scheduler.py @@ -3,8 +3,8 @@ from uuid import uuid4 from datetime import datetime, timedelta -from investing_bot_framework.core.executors.execution_scheduler import ExecutionScheduler, ExecutionTask -from investing_bot_framework.core.utils import TimeUnit +from investing_algorithm_framework.core.executors.execution_scheduler import ExecutionScheduler, ExecutionTask +from investing_algorithm_framework.core.utils import TimeUnit class TestExecutionScheduler(object): diff --git a/investing_bot_framework/tests/core/resolvers/__init__.py b/investing_algorithm_framework/tests/core/resolvers/__init__.py similarity index 100% rename from investing_bot_framework/tests/core/resolvers/__init__.py rename to investing_algorithm_framework/tests/core/resolvers/__init__.py diff --git a/investing_bot_framework/tests/core/resolvers/test_database_resolver.py b/investing_algorithm_framework/tests/core/resolvers/test_database_resolver.py similarity index 87% rename from investing_bot_framework/tests/core/resolvers/test_database_resolver.py rename to investing_algorithm_framework/tests/core/resolvers/test_database_resolver.py index 4fac1ad9..48c4ce5e 100644 --- a/investing_bot_framework/tests/core/resolvers/test_database_resolver.py +++ b/investing_algorithm_framework/tests/core/resolvers/test_database_resolver.py @@ -1,9 +1,9 @@ import os from sqlalchemy import Column, String, Integer -from investing_bot_framework.tests.resources import BaseTestMixin, utils -from investing_bot_framework.core.configuration import settings -from investing_bot_framework.core.extensions import db +from investing_algorithm_framework.tests.resources import BaseTestMixin, utils +from investing_algorithm_framework.core.configuration import settings +from investing_algorithm_framework.core.extensions import db class TestModel(db.model): diff --git a/investing_bot_framework/tests/resources/__init__.py b/investing_algorithm_framework/tests/resources/__init__.py similarity index 60% rename from investing_bot_framework/tests/resources/__init__.py rename to investing_algorithm_framework/tests/resources/__init__.py index 0013e49a..629d5502 100644 --- a/investing_bot_framework/tests/resources/__init__.py +++ b/investing_algorithm_framework/tests/resources/__init__.py @@ -1,6 +1,6 @@ import os -import investing_bot_framework.tests.resources.standard_settings +import investing_algorithm_framework.tests.resources.standard_settings class BaseTestMixin: @@ -8,6 +8,6 @@ class BaseTestMixin: @staticmethod def initialize_environment(): os.environ.setdefault( - 'INVESTING_BOT_FRAMEWORK_SETTINGS_MODULE', 'investing_bot_framework.tests.resources.standard_settings' + 'INVESTING_BOT_FRAMEWORK_SETTINGS_MODULE', 'investing_algorithm_framework.tests.resources.standard_settings' ) diff --git a/investing_bot_framework/tests/resources/standard_settings.py b/investing_algorithm_framework/tests/resources/standard_settings.py similarity index 100% rename from investing_bot_framework/tests/resources/standard_settings.py rename to investing_algorithm_framework/tests/resources/standard_settings.py diff --git a/investing_bot_framework/tests/resources/utils.py b/investing_algorithm_framework/tests/resources/utils.py similarity index 100% rename from investing_bot_framework/tests/resources/utils.py rename to investing_algorithm_framework/tests/resources/utils.py diff --git a/investing_bot_framework/tests/utils/__init__.py b/investing_algorithm_framework/tests/utils/__init__.py similarity index 100% rename from investing_bot_framework/tests/utils/__init__.py rename to investing_algorithm_framework/tests/utils/__init__.py diff --git a/investing_bot_framework/tests/utils/test_version.py b/investing_algorithm_framework/tests/utils/test_version.py similarity index 71% rename from investing_bot_framework/tests/utils/test_version.py rename to investing_algorithm_framework/tests/utils/test_version.py index 9902dc07..37bea99d 100644 --- a/investing_bot_framework/tests/utils/test_version.py +++ b/investing_algorithm_framework/tests/utils/test_version.py @@ -1,4 +1,4 @@ -from investing_bot_framework.utils.version import get_version, get_complete_version, get_main_version +from investing_algorithm_framework.utils.version import get_version, get_complete_version, get_main_version def test(): diff --git a/investing_bot_framework/utils/__init__.py b/investing_algorithm_framework/utils/__init__.py similarity index 100% rename from investing_bot_framework/utils/__init__.py rename to investing_algorithm_framework/utils/__init__.py diff --git a/investing_bot_framework/utils/version.py b/investing_algorithm_framework/utils/version.py similarity index 91% rename from investing_bot_framework/utils/version.py rename to investing_algorithm_framework/utils/version.py index c908e667..2750b711 100644 --- a/investing_bot_framework/utils/version.py +++ b/investing_algorithm_framework/utils/version.py @@ -17,7 +17,7 @@ def get_complete_version(version=None): check for correctness of the tuple provided. """ if version is None: - from investing_bot_framework import VERSION as version + from investing_algorithm_framework import VERSION as version else: assert len(version) == 5 assert version[3] in ('alpha', 'beta', 'rc', 'final') diff --git a/investing_bot_framework/__init__.py b/investing_bot_framework/__init__.py deleted file mode 100644 index df5df79d..00000000 --- a/investing_bot_framework/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from investing_bot_framework.utils.version import get_version - -VERSION = (1, 0, 0, 'alpha', 0) - diff --git a/investing_bot_framework/__main__.py b/investing_bot_framework/__main__.py deleted file mode 100644 index 4f7d27b6..00000000 --- a/investing_bot_framework/__main__.py +++ /dev/null @@ -1,9 +0,0 @@ -""" -Invokes investing_bot_framework-admin when the investing_bot_framework framework module is run as a script. -Example: python -m investing_bot_framework createbot SampleBot -""" - -from investing_bot_framework.core.management import execute_from_command_line - -if __name__ == "__main__": - execute_from_command_line() diff --git a/investing_bot_framework/bin/investing-bot-framework-admin b/investing_bot_framework/bin/investing-bot-framework-admin deleted file mode 100644 index 2dd56e7a..00000000 --- a/investing_bot_framework/bin/investing-bot-framework-admin +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -from investing_bot_framework.core.management import execute_from_command_line - -if __name__ == "__main__": - execute_from_command_line() \ No newline at end of file diff --git a/investing_bot_framework/core/configuration/setup/__init__.py b/investing_bot_framework/core/configuration/setup/__init__.py deleted file mode 100644 index 44c294fd..00000000 --- a/investing_bot_framework/core/configuration/setup/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from investing_bot_framework.core.configuration.setup.default_template_creators import DefaultBotProjectCreator diff --git a/investing_bot_framework/core/context/__init__.py b/investing_bot_framework/core/context/__init__.py deleted file mode 100644 index 2098bc7c..00000000 --- a/investing_bot_framework/core/context/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from investing_bot_framework.core.context.bot_context import BotContext diff --git a/investing_bot_framework/core/data_providers/__init__.py b/investing_bot_framework/core/data_providers/__init__.py deleted file mode 100644 index 1090a6f3..00000000 --- a/investing_bot_framework/core/data_providers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from investing_bot_framework.core.data_providers.data_provider import DataProvider diff --git a/investing_bot_framework/core/events/__init__.py b/investing_bot_framework/core/events/__init__.py deleted file mode 100644 index 4640bd05..00000000 --- a/investing_bot_framework/core/events/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from investing_bot_framework.core.events.observable import Observable -from investing_bot_framework.core.events.observer import Observer diff --git a/investing_bot_framework/core/executors/__init__.py b/investing_bot_framework/core/executors/__init__.py deleted file mode 100644 index 93f5ebe1..00000000 --- a/investing_bot_framework/core/executors/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from investing_bot_framework.core.executors.executor import Executor -from investing_bot_framework.core.executors.execution_scheduler import ExecutionScheduler diff --git a/investing_bot_framework/core/extensions.py b/investing_bot_framework/core/extensions.py deleted file mode 100644 index 60881642..00000000 --- a/investing_bot_framework/core/extensions.py +++ /dev/null @@ -1,3 +0,0 @@ -from investing_bot_framework.core.resolvers import DatabaseResolver - -db = DatabaseResolver() \ No newline at end of file diff --git a/investing_bot_framework/core/management/__init__.py b/investing_bot_framework/core/management/__init__.py deleted file mode 100644 index c554284a..00000000 --- a/investing_bot_framework/core/management/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from investing_bot_framework.core.management.command import BaseCommand -from investing_bot_framework.core.management.command_manager import execute_from_command_line diff --git a/investing_bot_framework/core/order_executors/__init__.py b/investing_bot_framework/core/order_executors/__init__.py deleted file mode 100644 index 1af709d0..00000000 --- a/investing_bot_framework/core/order_executors/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from investing_bot_framework.core.order_executors.order_executor import OrderExecutor diff --git a/investing_bot_framework/core/resolvers/__init__.py b/investing_bot_framework/core/resolvers/__init__.py deleted file mode 100644 index d087e7f9..00000000 --- a/investing_bot_framework/core/resolvers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from investing_bot_framework.core.resolvers.class_collector import ClassCollector -from investing_bot_framework.core.resolvers.database_resolver import DatabaseResolver - diff --git a/investing_bot_framework/core/resolvers/module_loaders/__init__.py b/investing_bot_framework/core/resolvers/module_loaders/__init__.py deleted file mode 100644 index 09779df2..00000000 --- a/investing_bot_framework/core/resolvers/module_loaders/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from investing_bot_framework.core.resolvers.module_loaders.data_providers_loader import DataProvidersLoader diff --git a/investing_bot_framework/core/states/__init__.py b/investing_bot_framework/core/states/__init__.py deleted file mode 100644 index 43b869e2..00000000 --- a/investing_bot_framework/core/states/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from investing_bot_framework.core.states.bot_state import BotState - diff --git a/investing_bot_framework/core/strategies/__init__.py b/investing_bot_framework/core/strategies/__init__.py deleted file mode 100644 index b971a42d..00000000 --- a/investing_bot_framework/core/strategies/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from investing_bot_framework.core.strategies.strategy import Strategy diff --git a/investing_bot_framework/core/workers/__init__.py b/investing_bot_framework/core/workers/__init__.py deleted file mode 100644 index 12d5b55b..00000000 --- a/investing_bot_framework/core/workers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from investing_bot_framework.core.workers.worker import Worker -from investing_bot_framework.core.workers.scheduled_worker import ScheduledWorker - diff --git a/setup.py b/setup.py index c6a1f860..62996604 100644 --- a/setup.py +++ b/setup.py @@ -4,12 +4,12 @@ long_description = fh.read() setuptools.setup( - name="investing_bot_framework", + name="investing_algorithm_framework", version="0.0.1", - description="A framework for creating an investment investing_bot_framework", + description="A framework for creating an investment algorithm", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/pypa/sampleproject", + url="https://github.com/investing-algorithms/investing-algorithm-framework.git", packages=setuptools.find_packages(exclude=['tests', 'tests.*']), classifiers=[ "Programming Language :: Python :: 3", @@ -19,6 +19,6 @@ 'colorama', 'wrapt', 'requests' ], python_requires='>=3.6', - scripts=['investing_bot_framework/bin/investing-bot-framework-admin'], + scripts=['investing_algorithm_framework/bin/investing-algorithm-framework-admin'], include_package_data=True, )