Skip to content

Commit

Permalink
restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Nov 22, 2024
1 parent f67321d commit f17f2b8
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/__init__.py → rs_trader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .main import Exchange
from .storage.json import JsonDatabase
from .structs.structs import Order, OrderLink, OrderPart, OrderStatus, OrderType
from .storage import JsonDatabase
from .structs import Order, OrderLink, OrderPart, OrderStatus, OrderType

__all__ = [
# main
Expand Down
3 changes: 3 additions & 0 deletions rs_trader/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .database import DatabaseInterface

__all__ = ["DatabaseInterface"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
from typing import Optional
from uuid import UUID

from src.structs.structs import Order, OrderLink, OrderPart, OrderStatus, OrderType
from rs_trader.structs.structs import (
Order,
OrderLink,
OrderPart,
OrderStatus,
OrderType,
)


class DatabaseInterface(ABC):
Expand Down
10 changes: 8 additions & 2 deletions src/main.py → rs_trader/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from datetime import datetime

from src.interfaces.database import DatabaseInterface
from src.structs.structs import Order, OrderLink, OrderPart, OrderStatus, OrderType
from rs_trader.interfaces.database import DatabaseInterface
from rs_trader.structs.structs import (
Order,
OrderLink,
OrderPart,
OrderStatus,
OrderType,
)


class Exchange:
Expand Down
3 changes: 3 additions & 0 deletions rs_trader/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .json import JsonDatabase

__all__ = ["JsonDatabase"]
10 changes: 8 additions & 2 deletions src/storage/json.py → rs_trader/storage/json.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
from typing import Optional
from uuid import UUID

from src.interfaces.database import DatabaseInterface
from src.structs.structs import Order, OrderLink, OrderPart, OrderStatus, OrderType
from rs_trader.interfaces.database import DatabaseInterface
from rs_trader.structs.structs import (
Order,
OrderLink,
OrderPart,
OrderStatus,
OrderType,
)


class JsonDatabase(DatabaseInterface):
Expand Down
9 changes: 9 additions & 0 deletions rs_trader/structs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .structs import Order, OrderLink, OrderPart, OrderStatus, OrderType

__all__ = [
"Order",
"OrderLink",
"OrderPart",
"OrderStatus",
"OrderType",
]
File renamed without changes.
Empty file removed src/interfaces/__init__.py
Empty file.
Empty file removed src/structs/__init__.py
Empty file.
8 changes: 4 additions & 4 deletions tests/test_exchange.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest

from src.interfaces.database import DatabaseInterface
from src.main import Exchange
from src.storage.json import JsonDatabase
from src.structs.structs import Order, OrderStatus, OrderType
from rs_trader import Exchange
from rs_trader.interfaces import DatabaseInterface
from rs_trader.storage import JsonDatabase
from rs_trader.structs import Order, OrderStatus, OrderType


@pytest.fixture
Expand Down

0 comments on commit f17f2b8

Please sign in to comment.