ab-user-service 0.1.2__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.
@@ -0,0 +1,195 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
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.lock
114
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
115
+ # in version control.
116
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
117
+ .pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
122
+ __pypackages__/
123
+
124
+ # Celery stuff
125
+ celerybeat-schedule
126
+ celerybeat.pid
127
+
128
+ # SageMath parsed files
129
+ *.sage.py
130
+
131
+ # Environments
132
+ .env
133
+ .venv
134
+ env/
135
+ venv/
136
+ ENV/
137
+ env.bak/
138
+ venv.bak/
139
+
140
+ # Spyder project settings
141
+ .spyderproject
142
+ .spyproject
143
+
144
+ # Rope project settings
145
+ .ropeproject
146
+
147
+ # mkdocs documentation
148
+ /site
149
+
150
+ # mypy
151
+ .mypy_cache/
152
+ .dmypy.json
153
+ dmypy.json
154
+
155
+ # Pyre type checker
156
+ .pyre/
157
+
158
+ # pytype static type analyzer
159
+ .pytype/
160
+
161
+ # Cython debug symbols
162
+ cython_debug/
163
+
164
+ # PyCharm
165
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
166
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
167
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
168
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
169
+ #.idea/
170
+
171
+ # Abstra
172
+ # Abstra is an AI-powered process automation framework.
173
+ # Ignore directories containing user credentials, local state, and settings.
174
+ # Learn more at https://abstra.io/docs
175
+ .abstra/
176
+
177
+ # Visual Studio Code
178
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
179
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
180
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
181
+ # you could uncomment the following to ignore the entire vscode folder
182
+ # .vscode/
183
+
184
+ # Ruff stuff:
185
+ .ruff_cache/
186
+
187
+ # PyPI configuration file
188
+ .pypirc
189
+
190
+ # Cursor
191
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
192
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
193
+ # refer to https://docs.cursor.com/context/ignore-files
194
+ .cursorignore
195
+ .cursorindexingignore
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Matthew Coulter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: ab-user-service
3
+ Version: 0.1.2
4
+ Author-email: Matthew Coulter <53892067+mattcoulter7@users.noreply.github.com>
5
+ License-File: LICENSE
6
+ Requires-Python: <4,>=3.12
7
+ Requires-Dist: fastapi<0.116,>=0.115.14
8
+ Requires-Dist: pydantic<3,>=2.11.7
9
+ Requires-Dist: uvicorn<0.36,>=0.35.0
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Open Banking, Opened | User Service
13
+
14
+ User Service for Open Banking, Opened API packages.
@@ -0,0 +1,3 @@
1
+ # Open Banking, Opened | User Service
2
+
3
+ User Service for Open Banking, Opened API packages.
@@ -0,0 +1,71 @@
1
+ [build-system]
2
+ build-backend = "hatchling.build"
3
+ requires = ["hatchling"]
4
+
5
+ [dependency-groups]
6
+ dev = [
7
+ "debugpy>=1.8.14,<2",
8
+ "isort>=6.0.1,<7",
9
+ # "ab-test-fixtures",
10
+ "pre-commit>=4.2.0,<5",
11
+ "pytest-asyncio>=1.0.0,<2",
12
+ "pytest-cov>=6.2.1,<7",
13
+ "pytest>=8.4.1,<9",
14
+ "ruff>=0.12.3,<0.13",
15
+ "tox>=4.27.0,<5"
16
+ ]
17
+
18
+ [project]
19
+ authors = [{email = "53892067+mattcoulter7@users.noreply.github.com", name = "Matthew Coulter"}]
20
+ dependencies = [
21
+ "fastapi>=0.115.14,<0.116",
22
+ # "ab-database[postgres-async]",
23
+ # "ab-user",
24
+ "pydantic>=2.11.7,<3",
25
+ "uvicorn>=0.35.0,<0.36"
26
+ ]
27
+ description = ""
28
+ name = "ab-user-service"
29
+ readme = "README.md"
30
+ requires-python = ">=3.12, <4"
31
+ version = "0.1.2"
32
+
33
+ [tool.hatch.build.targets.sdist]
34
+ include = ["src/ab_service"]
35
+
36
+ [tool.hatch.build.targets.wheel]
37
+ include = ["src/ab_service"]
38
+
39
+ [tool.hatch.build.targets.wheel.sources]
40
+ "src/ab_service" = "ab_service"
41
+
42
+ [tool.pytest.ini_options]
43
+ asyncio_default_fixture_loop_scope = "session"
44
+ asyncio_mode = "auto"
45
+ markers = [
46
+ "integration: Assigns the test to the integration test suite.",
47
+ "regression: Assigns the test to the regression test suite"
48
+ ]
49
+
50
+ [tool.ruff]
51
+ line-length = 120
52
+ src = ["src"]
53
+ target-version = "py312"
54
+
55
+ [tool.ruff.lint]
56
+ exclude = [".git", ".venv", "__pycache__", "proto"]
57
+ fixable = ["ALL"]
58
+ ignore = [
59
+ "D104" # missing docstring in public package
60
+ ]
61
+ select = [
62
+ "ARG001", # unused arguments
63
+ "B", # flake8-bugbear
64
+ "C4", # flake8-comprehensions
65
+ "D", # pydocstyle (docstring checks)
66
+ "E", # pycodestyle errors
67
+ "F", # pyflakes
68
+ "I", # isort
69
+ "UP", # pyupgrade
70
+ "W" # pycodestyle warnings
71
+ ]
File without changes
@@ -0,0 +1,47 @@
1
+ import logging
2
+ import logging.config
3
+ import os
4
+
5
+ from fastapi import FastAPI
6
+
7
+ from ab_service.user.routes.user import router as user_router
8
+
9
+ ROOT_LEVEL = os.environ.get("PROD", "INFO")
10
+
11
+ LOGGING_CONFIG = {
12
+ "version": 1,
13
+ "disable_existing_loggers": True,
14
+ "formatters": {
15
+ "standard": {"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s"},
16
+ },
17
+ "handlers": {
18
+ "default": {
19
+ "level": "INFO",
20
+ "formatter": "standard",
21
+ "class": "logging.StreamHandler",
22
+ "stream": "ext://sys.stdout", # Default is stderr
23
+ },
24
+ },
25
+ "loggers": {
26
+ "": { # root logger
27
+ "level": ROOT_LEVEL, # "INFO",
28
+ "handlers": ["default"],
29
+ "propagate": False,
30
+ },
31
+ "uvicorn.error": {
32
+ "level": "DEBUG",
33
+ "handlers": ["default"],
34
+ },
35
+ "uvicorn.access": {
36
+ "level": "DEBUG",
37
+ "handlers": ["default"],
38
+ },
39
+ },
40
+ }
41
+
42
+ logging.config.dictConfig(LOGGING_CONFIG)
43
+
44
+ logger = logging.getLogger(__name__)
45
+
46
+ app = FastAPI()
47
+ app.include_router(user_router)
@@ -0,0 +1,35 @@
1
+ from typing import Annotated
2
+
3
+ from fastapi import APIRouter
4
+ from fastapi import Depends as FDepends
5
+ from ab_core.database.session_context import db_session_async
6
+ from ab_core.dependency import Depends
7
+ from ab_core.user.model import User
8
+ from ab_core.user.service import UserService
9
+ from sqlalchemy.ext.asyncio.session import AsyncSession
10
+
11
+ router = APIRouter(
12
+ prefix="/user",
13
+ tags=["Template"],
14
+ )
15
+
16
+
17
+ @router.get(
18
+ "/{user_id}",
19
+ response_model=User,
20
+ )
21
+ async def get_user_by_id(
22
+ user_id: str,
23
+ db_session: Annotated[
24
+ AsyncSession,
25
+ FDepends(db_session_async),
26
+ ],
27
+ user_service: Annotated[
28
+ UserService,
29
+ Depends(UserService, persist=True),
30
+ ],
31
+ ):
32
+ return await user_service.get_user_by_id(
33
+ user_id=user_id,
34
+ db_session=db_session,
35
+ )
File without changes