Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

Commit 2a0b3d8

Browse files
committed
* trivial legacy imports removed
* improved import syntax as the result of converting to python packages for each directory. * project renamed from CommandIntegrator to commandintegrator
1 parent f92c07d commit 2a0b3d8

17 files changed

Lines changed: 69 additions & 77 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The `Callback` object has replaced the old structure with dictionaries when crea
4848

4949
**Improvements**
5050

51-
* `import CommandIntegrator` is now the only needed import to access everything within the package. By the use of the `__init__.py` file. `import CommandIntegrator as ci` will give you access to all classes and functions in the package from the `ci.` syntax
51+
* `import commandintegrator` is now the only needed import to access everything within the package. By the use of the `__init__.py` file. `import commandintegrator as ci` will give you access to all classes and functions in the package from the `ci.` syntax
5252

5353

5454
* Language data is migrated to a new file called `language.json` which allows developers to easily increase the support for other languages

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# CommandIntegrator
1+
# commandintegrator
22

33
## What it does
4-
CommandIntegrator is a lightweight framework and API for creating apps controlled with human language interfaces.
4+
commandintegrator is a lightweight framework and API for creating apps controlled with human language interfaces.
55
It concists of base classes and ready-to-use objects along with a set and clear structure for how to develop and scale a chat bot / Virtual assistant.
66

77
Objects such as the `Feature`, which can be thought of a micro service within your app, makes it easier to keep the OOP structure clean and well maintained. Automatic command parsing with the `CommandParser` and `CommandProcessor` makes it very straight forward to build and scale your command-controlled application without having to worry about name and word collisions, edge-case actions etcetera.
@@ -10,18 +10,18 @@ Objects such as the `Feature`, which can be thought of a micro service within yo
1010

1111
## Objects and wrappers for more effective and easier development
1212

13-
CommandIntegrator exists for one reason: To make development of language-driven apps easier. Decorator wrappers for automated logging, scheduling of function execution, caching objects and API DAO's are a few that are included in the package.
13+
commandintegrator exists for one reason: To make development of language-driven apps easier. Decorator wrappers for automated logging, scheduling of function execution, caching objects and API DAO's are a few that are included in the package.
1414

15-
You can build the backend of your virtual assistant / chatbot with the tools and structures of CommandIntegrator and use it in your chatbot for whichever platform you want to use. CommandIntegrator is platform independent and can be used even with a simple command-line app as demonstrated below.
15+
You can build the backend of your virtual assistant / chatbot with the tools and structures of commandintegrator and use it in your chatbot for whichever platform you want to use. commandintegrator is platform independent and can be used even with a simple command-line app as demonstrated below.
1616

1717

1818
## Example
1919

2020
Here's a short example of how to create a virtual assistant that tells you what time it is.
21-
For a more comprehensive example, please read the `demo_feature.py` file [here](https://github.com/dotchetter/CommandIntegrator/blob/master/examples/demo_feature.py)
21+
For a more comprehensive example, please read the `demo_feature.py` file [here](https://github.com/dotchetter/commandintegrator/blob/master/examples/demo_feature.py)
2222

2323
```python
24-
import CommandIntegrator as ci
24+
import commandintegrator as ci
2525
import time
2626
from pprint import pprint
2727

__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# ------- NOTES: COMMANDINTEGRATOR .SETTINGS FILE ------- #
2828
"""
29-
The details below will read and configure CommandIntegrator
29+
The details below will read and configure commandintegrator
3030
according to the settings found in the settings file, by default
3131
named "commandintegrator.settings".
3232
The settings file is presumed to be located within the package
@@ -59,7 +59,7 @@
5959
# ---------------- Assert settings file presence --------------- #
6060

6161
if not os.path.isfile(CONFIG_FILE_FULLPATH):
62-
_msg = f'CommandIntegrator: Could not find config file ' \
62+
_msg = f'commandintegrator: Could not find config file ' \
6363
f'{CONFIG_FILE_NAME} in {CONFIG_FILE_DIR}'
6464
sys.stderr.write(_msg)
6565

@@ -102,7 +102,7 @@
102102
a part of the framework forever, that's the way it is. Consider
103103
yourself the founder of an easteregg.
104104
105-
// Simon Olofsson, lead developer and founder of CommandIntegrator
105+
// Simon Olofsson, lead developer and founder of commandintegrator
106106
107107
"""
108108

baseclasses/baseclasses.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
import random
2-
import json
3-
import traceback
4-
import sys
51

6-
from types import LambdaType
7-
from ast import literal_eval
8-
from pprint import pprint
9-
from os import system
10-
from datetime import datetime, timedelta, time
11-
from enum import Enum, auto
2+
import sys
123
from abc import ABC, abstractmethod
134

14-
from ..core.callback import Callback
15-
from ..core.internals import _cim
16-
from ..core.enumerators import CommandPronoun
17-
from ..models.message import Message
5+
from commandintegrator.core.callback import Callback
6+
from commandintegrator.core.internals import _cim
7+
from commandintegrator.core.enumerators import CommandPronoun
8+
from commandintegrator.models.message import Message
9+
1810

1911
"""
2012
Details:
2113
2020-06-21
2214
23-
CommandIntegrator framework baseclass source file
15+
commandintegrator framework baseclass source file
2416
2517
Module details:
2618
2719
This file contains abstract and base classes for
28-
the framework called CommandIntegrator.
20+
the framework called commandintegrator.
2921
3022
In order for a developer to integrate their software
3123
with a way to bind certain actions and methods in their

commandintegrator.settings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"log_filename": "CommandIntegrator.log",
2+
"log_filename": "commandintegrator.log",
33

44
"log_dir": ".",
55

core/callback.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from itertools import zip_longest
2-
from ..models.message import Message
2+
from commandintegrator.models.message import Message
33

44
"""
55
Details:
66
2020-07-17
77
8-
CommandIntegrator framework source file with Callback
8+
commandintegrator framework source file with Callback
99
objects
1010
1111
This module contains objects that are designed to make
@@ -86,7 +86,7 @@ def matches(self, message: Message) -> bool:
8686
exits with False.
8787
8888
:param message:
89-
CommandIntegrator.Message
89+
commandintegrator.Message
9090
:returns:
9191
Bool, True if self matches command
9292
"""

core/commandprocessor.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,22 @@
33
import traceback
44

55
from collections.abc import Iterable
6-
7-
from .internals import _cim
8-
from .interpretation import Interpretation
9-
from .pronounlookuptable import PronounLookupTable
10-
11-
from ..models.message import Message
12-
from ..baseclasses.baseclasses import FeatureBase
6+
from commandintegrator.core.internals import _cim
7+
from commandintegrator.core.interpretation import Interpretation
8+
from commandintegrator.core.pronounlookuptable import PronounLookupTable
9+
from commandintegrator.models.message import Message
10+
from commandintegrator.baseclasses.baseclasses import FeatureBase
1311

1412
"""
1513
Details:
1614
2020-07-05
1715
18-
CommandIntegrator framework ComandProcessor source file
16+
commandintegrator framework ComandProcessor source file
1917
2018
Module details:
2119
2220
The CommandProcessor is the routing object of
23-
CommandIntegrator, acting as the main agent that
21+
commandintegrator, acting as the main agent that
2422
will direct messages to Features in the application.
2523
"""
2624

core/enumerators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Details:
55
2020-07-05
66
7-
CommandIntegrator framework CommandPronoun source file
7+
commandintegrator framework CommandPronoun source file
88
99
Module details:
1010

core/internals.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
Details:
77
2020-07-05
88
9-
CommandIntegrator framework internal source file
9+
commandintegrator framework internal source file
1010
1111
Module details:
1212
1313
data containers and functions used by objects in
14-
the CommandIntegrator package.
14+
the commandintegrator package.
1515
"""
1616

1717

@@ -38,9 +38,9 @@ class _cim:
3838
"""
3939
This class is only used as a namespace
4040
for internal messages used by exceptions
41-
or elsewhere by CommandIntegrator classes
41+
or elsewhere by commandintegrator classes
4242
and functions. Not for instantiating.
4343
"""
44-
deprecated_warn: str = "CommandIntegrator DEPRECATED WARNING"
45-
warn: str = "CommandIntegrator WARNING"
46-
err: str = "CommandIntegrator ERROR"
44+
deprecated_warn: str = "commandintegrator DEPRECATED WARNING"
45+
warn: str = "commandintegrator WARNING"
46+
err: str = "commandintegrator ERROR"

core/interpretation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from dataclasses import dataclass
2-
from .enumerators import CommandPronoun
2+
from commandintegrator.core.enumerators import CommandPronoun
33

44
"""
55
Details:
66
2020-07-05
77
8-
CommandIntegrator framework Interpretation source file
8+
commandintegrator framework Interpretation source file
99
1010
Module details:
1111

0 commit comments

Comments
 (0)