codex-services 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codex_services-0.1.0/.github/workflows/ci.yml +76 -0
- codex_services-0.1.0/.github/workflows/docs.yml +71 -0
- codex_services-0.1.0/.github/workflows/publish.yml +45 -0
- codex_services-0.1.0/.gitignore +218 -0
- codex_services-0.1.0/.pre-commit-config.yaml +38 -0
- codex_services-0.1.0/CHANGELOG.md +25 -0
- codex_services-0.1.0/PKG-INFO +113 -0
- codex_services-0.1.0/README.md +68 -0
- codex_services-0.1.0/docs/en/api/booking/index.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/shared/calculator.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/shared/dto.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/shared/exceptions.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/shared/interfaces.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/shared/validators.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/slot_master/api.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/slot_master/chain_finder.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/slot_master/dto.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/slot_master/index.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/slot_master/modes.md +5 -0
- codex_services-0.1.0/docs/en/api/booking/slot_master/scorer.md +5 -0
- codex_services-0.1.0/docs/en/api/calendar/engine.md +5 -0
- codex_services-0.1.0/docs/en/api/calendar/index.md +5 -0
- codex_services-0.1.0/docs/en/api/index.md +10 -0
- codex_services-0.1.0/docs/en/architecture/README.md +78 -0
- codex_services-0.1.0/docs/en/architecture/booking_engine.md +115 -0
- codex_services-0.1.0/docs/evolution/changelog.md +3 -0
- codex_services-0.1.0/docs/index.md +13 -0
- codex_services-0.1.0/docs/ru/architecture/README.md +81 -0
- codex_services-0.1.0/docs/ru/architecture/booking_engine.md +115 -0
- codex_services-0.1.0/docs/stylesheets/extra.css +18 -0
- codex_services-0.1.0/mkdocs.yml +96 -0
- codex_services-0.1.0/project_structure.txt +24 -0
- codex_services-0.1.0/pyproject.toml +114 -0
- codex_services-0.1.0/scripts/generate_api_docs.py +91 -0
- codex_services-0.1.0/src/codex_services/__init__.py +1 -0
- codex_services-0.1.0/src/codex_services/booking/__init__.py +37 -0
- codex_services-0.1.0/src/codex_services/booking/_shared/__init__.py +1 -0
- codex_services-0.1.0/src/codex_services/booking/_shared/calculator.py +330 -0
- codex_services-0.1.0/src/codex_services/booking/_shared/dto.py +82 -0
- codex_services-0.1.0/src/codex_services/booking/_shared/exceptions.py +318 -0
- codex_services-0.1.0/src/codex_services/booking/_shared/interfaces.py +66 -0
- codex_services-0.1.0/src/codex_services/booking/_shared/validators.py +132 -0
- codex_services-0.1.0/src/codex_services/booking/room/__init__.py +7 -0
- codex_services-0.1.0/src/codex_services/booking/slot_master/__init__.py +58 -0
- codex_services-0.1.0/src/codex_services/booking/slot_master/api.py +171 -0
- codex_services-0.1.0/src/codex_services/booking/slot_master/chain_finder.py +450 -0
- codex_services-0.1.0/src/codex_services/booking/slot_master/dto.py +446 -0
- codex_services-0.1.0/src/codex_services/booking/slot_master/modes.py +44 -0
- codex_services-0.1.0/src/codex_services/booking/slot_master/scorer.py +168 -0
- codex_services-0.1.0/src/codex_services/calendar/__init__.py +5 -0
- codex_services-0.1.0/src/codex_services/calendar/engine.py +101 -0
- codex_services-0.1.0/src/codex_services/py.typed +0 -0
- codex_services-0.1.0/tests/conftest.py +11 -0
- codex_services-0.1.0/tests/integration/__init__.py +0 -0
- codex_services-0.1.0/tests/integration/conftest.py +9 -0
- codex_services-0.1.0/tests/integration/test_chain_finder_integration.py +58 -0
- codex_services-0.1.0/tests/unit/__init__.py +0 -0
- codex_services-0.1.0/tests/unit/conftest.py +9 -0
- codex_services-0.1.0/tests/unit/test_api.py +124 -0
- codex_services-0.1.0/tests/unit/test_booking_validator.py +147 -0
- codex_services-0.1.0/tests/unit/test_calendar_engine.py +127 -0
- codex_services-0.1.0/tests/unit/test_chain_finder.py +552 -0
- codex_services-0.1.0/tests/unit/test_dto.py +406 -0
- codex_services-0.1.0/tests/unit/test_exceptions.py +167 -0
- codex_services-0.1.0/tests/unit/test_scorer.py +246 -0
- codex_services-0.1.0/tests/unit/test_slot_calculator.py +251 -0
- codex_services-0.1.0/tools/__init__.py +0 -0
- codex_services-0.1.0/tools/dev/README.md +23 -0
- codex_services-0.1.0/tools/dev/__init__.py +0 -0
- codex_services-0.1.0/tools/dev/check.py +28 -0
- codex_services-0.1.0/tools/dev/generate_project_tree.py +8 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: CI Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ develop ]
|
|
6
|
+
paths-ignore: [ '**.md', 'docs/**', '.gitignore' ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main ]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
quality-gate:
|
|
12
|
+
name: Quality Gate
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
cache: 'pip'
|
|
20
|
+
|
|
21
|
+
- name: Install Dev Dependencies
|
|
22
|
+
run: |
|
|
23
|
+
python -m pip install --upgrade pip
|
|
24
|
+
pip install -e ".[dev]"
|
|
25
|
+
|
|
26
|
+
- name: Pre-commit (Ruff, Format, Bandit, Secrets)
|
|
27
|
+
uses: pre-commit/action@v3.0.1
|
|
28
|
+
|
|
29
|
+
- name: Run pip-audit
|
|
30
|
+
run: pip install pip-audit && pip-audit
|
|
31
|
+
|
|
32
|
+
- name: Run Mypy
|
|
33
|
+
run: pip install mypy && mypy src/
|
|
34
|
+
|
|
35
|
+
unit-tests:
|
|
36
|
+
name: Unit Tests (Python ${{ matrix.python-version }})
|
|
37
|
+
needs: quality-gate
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
45
|
+
uses: actions/setup-python@v5
|
|
46
|
+
with:
|
|
47
|
+
python-version: ${{ matrix.python-version }}
|
|
48
|
+
cache: 'pip'
|
|
49
|
+
|
|
50
|
+
- name: Install All Dependencies
|
|
51
|
+
run: |
|
|
52
|
+
python -m pip install --upgrade pip
|
|
53
|
+
pip install -e ".[dev]"
|
|
54
|
+
|
|
55
|
+
- name: Run Unit Tests
|
|
56
|
+
run: pytest tests/ -m "unit" -v --tb=short
|
|
57
|
+
|
|
58
|
+
integration-tests:
|
|
59
|
+
name: Integration Tests
|
|
60
|
+
needs: unit-tests
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
- name: Set up Python 3.12
|
|
65
|
+
uses: actions/setup-python@v5
|
|
66
|
+
with:
|
|
67
|
+
python-version: "3.12"
|
|
68
|
+
cache: 'pip'
|
|
69
|
+
|
|
70
|
+
- name: Install All Dependencies
|
|
71
|
+
run: |
|
|
72
|
+
python -m pip install --upgrade pip
|
|
73
|
+
pip install -e ".[dev]"
|
|
74
|
+
|
|
75
|
+
- name: Run Integration Tests
|
|
76
|
+
run: pytest tests/ -m "integration" -v --tb=short
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'Version alias to deploy (e.g. 0.x, 1.x)'
|
|
11
|
+
required: true
|
|
12
|
+
alias:
|
|
13
|
+
description: 'Alias (latest, stable, or leave empty)'
|
|
14
|
+
required: false
|
|
15
|
+
default: 'latest'
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
deploy:
|
|
25
|
+
name: Build & Deploy Docs
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Configure Git Credentials
|
|
34
|
+
run: |
|
|
35
|
+
git config user.name github-actions[bot]
|
|
36
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
37
|
+
|
|
38
|
+
- name: Set up Python 3.12
|
|
39
|
+
uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
cache: 'pip'
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
run: |
|
|
46
|
+
python -m pip install --upgrade pip
|
|
47
|
+
pip install -e ".[docs]"
|
|
48
|
+
|
|
49
|
+
- name: Resolve version alias (tag push)
|
|
50
|
+
if: github.event_name == 'push'
|
|
51
|
+
id: version
|
|
52
|
+
run: |
|
|
53
|
+
TAG="${GITHUB_REF_NAME}" # e.g. v1.2.3
|
|
54
|
+
MAJOR=$(echo "$TAG" | sed 's/^v//' | cut -d. -f1)
|
|
55
|
+
echo "alias=${MAJOR}.x" >> "$GITHUB_OUTPUT"
|
|
56
|
+
|
|
57
|
+
- name: Deploy versioned docs (tag push)
|
|
58
|
+
if: github.event_name == 'push'
|
|
59
|
+
run: |
|
|
60
|
+
mike deploy --push --update-aliases "${{ steps.version.outputs.alias }}" latest
|
|
61
|
+
mike set-default --push latest
|
|
62
|
+
|
|
63
|
+
- name: Deploy versioned docs (manual)
|
|
64
|
+
if: github.event_name == 'workflow_dispatch'
|
|
65
|
+
run: |
|
|
66
|
+
if [ -n "${{ inputs.alias }}" ]; then
|
|
67
|
+
mike deploy --push --update-aliases "${{ inputs.version }}" "${{ inputs.alias }}"
|
|
68
|
+
else
|
|
69
|
+
mike deploy --push "${{ inputs.version }}"
|
|
70
|
+
fi
|
|
71
|
+
mike set-default --push latest
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-n-publish:
|
|
10
|
+
name: Build and publish to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: pypi
|
|
14
|
+
url: https://pypi.org/project/codex-booking/
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
cache: 'pip'
|
|
30
|
+
|
|
31
|
+
- name: Install build tools
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install --upgrade pip
|
|
34
|
+
python -m pip install build twine hatchling
|
|
35
|
+
|
|
36
|
+
- name: Build sdist and wheel
|
|
37
|
+
run: python -m build
|
|
38
|
+
|
|
39
|
+
- name: Check artifacts
|
|
40
|
+
run: twine check dist/*
|
|
41
|
+
|
|
42
|
+
- name: Publish to PyPI
|
|
43
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
44
|
+
with:
|
|
45
|
+
print-hash: true
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
208
|
+
|
|
209
|
+
# Claude Code
|
|
210
|
+
.claude/
|
|
211
|
+
|
|
212
|
+
# IDEs
|
|
213
|
+
.idea/
|
|
214
|
+
.vscode/
|
|
215
|
+
|
|
216
|
+
# OS junk
|
|
217
|
+
.DS_Store
|
|
218
|
+
Thumbs.db
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-json
|
|
9
|
+
- id: check-added-large-files
|
|
10
|
+
args: ['--maxkb=2000']
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
|
|
13
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
+
rev: v0.9.6
|
|
15
|
+
hooks:
|
|
16
|
+
- id: ruff
|
|
17
|
+
args: [--fix]
|
|
18
|
+
- id: ruff-format
|
|
19
|
+
|
|
20
|
+
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
21
|
+
rev: v0.44.0
|
|
22
|
+
hooks:
|
|
23
|
+
- id: markdownlint
|
|
24
|
+
args: ["--fix", "--disable", "MD013"]
|
|
25
|
+
|
|
26
|
+
- repo: https://github.com/PyCQA/bandit
|
|
27
|
+
rev: 1.8.2
|
|
28
|
+
hooks:
|
|
29
|
+
- id: bandit
|
|
30
|
+
args: ["-c", "pyproject.toml"]
|
|
31
|
+
additional_dependencies: ["bandit[toml]"]
|
|
32
|
+
|
|
33
|
+
# 2. Поиск "забытых" секретов и паролей (усиленный)
|
|
34
|
+
- repo: https://github.com/Yelp/detect-secrets
|
|
35
|
+
rev: v1.5.0
|
|
36
|
+
hooks:
|
|
37
|
+
- id: detect-secrets
|
|
38
|
+
# Baseline will be added after manual creation
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- Type: TRACKING -->
|
|
2
|
+
|
|
3
|
+
# Changelog
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
All notable changes to this project will be documented in this file.
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Core Library Architecture**: Initial split from monolithic `codex_tools` repository.
|
|
12
|
+
- **CRM Booking Engine** (`codex_services.crm.booking`):
|
|
13
|
+
- Unified API for availability and reservations.
|
|
14
|
+
- Multi-mode support: `STRICT`, `FLEXIBLE`, and `OVERBOOK`.
|
|
15
|
+
- Interfaces and algorithms for finding overlapping or chained slots (`chain_finder`, `scorer`).
|
|
16
|
+
- Validation engines for business constraints (`validators`).
|
|
17
|
+
- Strict immutable DTOs and custom exceptions.
|
|
18
|
+
- **CRM Calculator Engine** (`codex_services.crm.calculator`):
|
|
19
|
+
- `SlotCalculator` for dynamically analyzing duration and capacity based on business constraints.
|
|
20
|
+
- **CRM Calendar Engine** (`codex_services.crm.calendar`):
|
|
21
|
+
- Complete engine for shift generation, schedule building, and timezone-aware recurring events.
|
|
22
|
+
- **Documentation**:
|
|
23
|
+
- Implemented standard 6-layer `DocArchitect` layout (API, Architecture, Tasks, Evolution, Landing, Planning).
|
|
24
|
+
- Structured API reference using `mkdocstrings`.
|
|
25
|
+
- Multi-language support structure designed (en/ru).
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codex-services
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Reusable business logic engines for Codex platform (CRM, finance, HR, inventory)
|
|
5
|
+
Project-URL: Homepage, https://github.com/codexdlc/codex-services
|
|
6
|
+
Project-URL: Documentation, https://codexdlc.github.io/codex-services/
|
|
7
|
+
Project-URL: Repository, https://github.com/codexdlc/codex-services
|
|
8
|
+
Project-URL: Issues, https://github.com/codexdlc/codex-services/issues
|
|
9
|
+
Author: CodexDLC
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
Keywords: booking,business,calculator,crm,scheduling,waas
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: codex-core
|
|
21
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
22
|
+
Provides-Extra: all
|
|
23
|
+
Requires-Dist: holidays>=0.40; extra == 'all'
|
|
24
|
+
Provides-Extra: calendar
|
|
25
|
+
Requires-Dist: holidays>=0.40; extra == 'calendar'
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: bandit>=1.7; extra == 'dev'
|
|
28
|
+
Requires-Dist: detect-secrets>=1.5; extra == 'dev'
|
|
29
|
+
Requires-Dist: holidays>=0.40; extra == 'dev'
|
|
30
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
31
|
+
Requires-Dist: pip-audit>=2.7; extra == 'dev'
|
|
32
|
+
Requires-Dist: pre-commit>=3.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: mike>=2.0; extra == 'docs'
|
|
39
|
+
Requires-Dist: mkdocs-include-markdown-plugin; extra == 'docs'
|
|
40
|
+
Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
|
|
41
|
+
Requires-Dist: mkdocs-static-i18n[material]>=1.2.0; extra == 'docs'
|
|
42
|
+
Requires-Dist: mkdocs>=1.5; extra == 'docs'
|
|
43
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# codex-services
|
|
47
|
+
<!-- Type: LANDING -->
|
|
48
|
+
|
|
49
|
+
[](https://pypi.org/project/codex-services/)
|
|
50
|
+
[](https://pypi.org/project/codex-services/)
|
|
51
|
+
[](https://github.com/codexdlc/codex-services/actions/workflows/ci.yml)
|
|
52
|
+
[](LICENSE)
|
|
53
|
+
|
|
54
|
+
Pure-Python business logic engines for booking, scheduling, and CRM workflows.
|
|
55
|
+
No ORM, no framework dependencies — drop into any Python project or use as a building block inside the Codex ecosystem.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install codex-services
|
|
63
|
+
|
|
64
|
+
# With holiday calendar support
|
|
65
|
+
pip install "codex-services[calendar]"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from codex_services.booking.slot_master import find_slots, BookingEngineRequest, ServiceRequest, BookingMode
|
|
72
|
+
from datetime import date
|
|
73
|
+
|
|
74
|
+
request = BookingEngineRequest(
|
|
75
|
+
service_requests=[
|
|
76
|
+
ServiceRequest(service_id="haircut", duration_minutes=60, possible_master_ids=["m1", "m2"]),
|
|
77
|
+
],
|
|
78
|
+
booking_date=date.today(),
|
|
79
|
+
mode=BookingMode.SINGLE_DAY,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
result = find_slots(request, masters_availability=[...])
|
|
83
|
+
if result.has_solutions:
|
|
84
|
+
print(result.best.starts_at)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Modules
|
|
88
|
+
|
|
89
|
+
| Module | Extra | Description |
|
|
90
|
+
| :--- | :--- | :--- |
|
|
91
|
+
| `codex_services.booking.slot_master` | — | Recursive chain-finder for multi-service bookings with scoring and waitlist |
|
|
92
|
+
| `codex_services.booking._shared` | — | Low-level slot arithmetic — windows, gaps, busy interval merging |
|
|
93
|
+
| `codex_services.calendar` | `[calendar]` | Calendar grid generator for UI rendering with holiday awareness |
|
|
94
|
+
|
|
95
|
+
## Documentation
|
|
96
|
+
|
|
97
|
+
Full docs with architecture, API reference, and data flow diagrams:
|
|
98
|
+
|
|
99
|
+
**[https://codexdlc.github.io/codex-services/](https://codexdlc.github.io/codex-services/)**
|
|
100
|
+
|
|
101
|
+
## Part of the Codex ecosystem
|
|
102
|
+
|
|
103
|
+
| Package | Role |
|
|
104
|
+
| :--- | :--- |
|
|
105
|
+
| [codex-core](https://github.com/codexdlc/codex-core) | Foundation — immutable DTOs, PII masking, env settings |
|
|
106
|
+
| [codex-platform](https://github.com/codexdlc/codex-platform) | Infrastructure — Redis, Streams, ARQ workers, Notifications |
|
|
107
|
+
| [codex-ai](https://github.com/codexdlc/codex-ai) | LLM layer — unified async interface for OpenAI, Gemini, Anthropic |
|
|
108
|
+
| **codex-services** | Business logic — Booking engine, CRM, Calendar |
|
|
109
|
+
|
|
110
|
+
Each library is **fully standalone** — install only what your project needs.
|
|
111
|
+
Together they form the backbone of **[codex-bot](https://github.com/codexdlc/codex-bot)**
|
|
112
|
+
(Telegram AI-agent infrastructure built on aiogram) and
|
|
113
|
+
**[codex-django](https://github.com/codexdlc/codex-django)** (Django integration layer).
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# codex-services
|
|
2
|
+
<!-- Type: LANDING -->
|
|
3
|
+
|
|
4
|
+
[](https://pypi.org/project/codex-services/)
|
|
5
|
+
[](https://pypi.org/project/codex-services/)
|
|
6
|
+
[](https://github.com/codexdlc/codex-services/actions/workflows/ci.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
Pure-Python business logic engines for booking, scheduling, and CRM workflows.
|
|
10
|
+
No ORM, no framework dependencies — drop into any Python project or use as a building block inside the Codex ecosystem.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install codex-services
|
|
18
|
+
|
|
19
|
+
# With holiday calendar support
|
|
20
|
+
pip install "codex-services[calendar]"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from codex_services.booking.slot_master import find_slots, BookingEngineRequest, ServiceRequest, BookingMode
|
|
27
|
+
from datetime import date
|
|
28
|
+
|
|
29
|
+
request = BookingEngineRequest(
|
|
30
|
+
service_requests=[
|
|
31
|
+
ServiceRequest(service_id="haircut", duration_minutes=60, possible_master_ids=["m1", "m2"]),
|
|
32
|
+
],
|
|
33
|
+
booking_date=date.today(),
|
|
34
|
+
mode=BookingMode.SINGLE_DAY,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
result = find_slots(request, masters_availability=[...])
|
|
38
|
+
if result.has_solutions:
|
|
39
|
+
print(result.best.starts_at)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Modules
|
|
43
|
+
|
|
44
|
+
| Module | Extra | Description |
|
|
45
|
+
| :--- | :--- | :--- |
|
|
46
|
+
| `codex_services.booking.slot_master` | — | Recursive chain-finder for multi-service bookings with scoring and waitlist |
|
|
47
|
+
| `codex_services.booking._shared` | — | Low-level slot arithmetic — windows, gaps, busy interval merging |
|
|
48
|
+
| `codex_services.calendar` | `[calendar]` | Calendar grid generator for UI rendering with holiday awareness |
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
Full docs with architecture, API reference, and data flow diagrams:
|
|
53
|
+
|
|
54
|
+
**[https://codexdlc.github.io/codex-services/](https://codexdlc.github.io/codex-services/)**
|
|
55
|
+
|
|
56
|
+
## Part of the Codex ecosystem
|
|
57
|
+
|
|
58
|
+
| Package | Role |
|
|
59
|
+
| :--- | :--- |
|
|
60
|
+
| [codex-core](https://github.com/codexdlc/codex-core) | Foundation — immutable DTOs, PII masking, env settings |
|
|
61
|
+
| [codex-platform](https://github.com/codexdlc/codex-platform) | Infrastructure — Redis, Streams, ARQ workers, Notifications |
|
|
62
|
+
| [codex-ai](https://github.com/codexdlc/codex-ai) | LLM layer — unified async interface for OpenAI, Gemini, Anthropic |
|
|
63
|
+
| **codex-services** | Business logic — Booking engine, CRM, Calendar |
|
|
64
|
+
|
|
65
|
+
Each library is **fully standalone** — install only what your project needs.
|
|
66
|
+
Together they form the backbone of **[codex-bot](https://github.com/codexdlc/codex-bot)**
|
|
67
|
+
(Telegram AI-agent infrastructure built on aiogram) and
|
|
68
|
+
**[codex-django](https://github.com/codexdlc/codex-django)** (Django integration layer).
|