Skip to content

Commit be93012

Browse files
committed
Initial batch of documentation for CRUD functions
1 parent 82bff1d commit be93012

12 files changed

Lines changed: 786 additions & 1 deletion

.gitignore

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/
139+
140+
# batch files
141+
*.bat
142+
143+
labs
144+
migrations
145+
backend/uploads
146+
.idea
147+
148+
# Testing
149+
*.sqlite*
150+
151+
# frontend
152+
node_modules
153+
154+
# ruff
155+
.ruff_cache

.pre-commit-config.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-ast
7+
- id: check-builtin-literals
8+
- id: check-byte-order-marker
9+
- id: check-case-conflict
10+
- id: check-docstring-first
11+
- id: check-executables-have-shebangs
12+
- id: check-json
13+
- id: check-merge-conflict
14+
- id: check-shebang-scripts-are-executable
15+
- id: check-symlinks
16+
- id: check-toml
17+
- id: check-vcs-permalinks
18+
- id: check-xml
19+
- id: check-yaml
20+
- id: debug-statements
21+
exclude: tests/
22+
- id: destroyed-symlinks
23+
- id: detect-aws-credentials
24+
- id: detect-private-key
25+
- id: end-of-file-fixer
26+
exclude: tests/test_changes/
27+
files: \.(py|sh|rst|yml|yaml)$
28+
- id: pretty-format-json
29+
args: [--autofix]
30+
- id: sort-simple-yaml
31+
- id: trailing-whitespace
32+
33+
- repo: https://github.com/charliermarsh/ruff-pre-commit
34+
# Ruff version.
35+
rev: "v0.1.3"
36+
hooks:
37+
- id: ruff
38+
39+
- repo: https://github.com/pycqa/isort
40+
rev: 5.12.0
41+
hooks:
42+
- id: isort
43+
name: isort (python)
44+
45+
- repo: https://github.com/psf/black
46+
rev: 23.10.1
47+
hooks:
48+
- id: black
49+
exclude: tests/
50+
51+
#- repo: https://github.com/asottile/pyupgrade
52+
# rev: v3.15.0
53+
# hooks:
54+
# - id: pyupgrade
55+
# args: [--py311-plus]
56+
57+
58+
#- repo: https://github.com/gitguardian/ggshield
59+
# rev: v1.20.0
60+
# hooks:
61+
# - id: ggshield
62+
# language_version: python3
63+
# stages: [commit]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.0

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
11
# SQLModel-CRUD-Utilities
2-
A set of CRUD utilities to expedite operations with SQLModel
2+
A set of CRUD utilities to expedite operations with SQLModel.
3+
4+
## Instructions
5+
6+
- Run `pip install sqlmodel_crud_utils` or add `sqlmodel_crud_utils` to your
7+
requirements files
8+
- Declare the value for the `SQL_DIALECT` environmental variable. It can either
9+
be actively loaded within the environment or added to a `.env` file, courtesy
10+
of `dotenv`.
11+
- For a list of available native and 3rd party dialects, please see here: https://docs.sqlalchemy.org/en/20/dialects/#included-dialects
12+
13+
## Inspiration
14+
The reason behind creating this package was to streamline the CRUD operations
15+
across multiple personal and team-based projects that rely on SQLModel for its
16+
ORM operations.
17+
18+
Because of existing commitments to SQLModel within the tech stack of multiple
19+
projects, this package will be continuously supported and developed. A close eye
20+
will be kept on the SQLModel's ongoing roadmap and eventual uplift to SQLAlchemy
21+
2.0 and Pydantic 2.0.
22+
## Development Roadmap
23+
- [ ] Release working Alpha version
24+
- [ ] Test across existing projects to ensure complete coverage
25+
- [ ] 100% test coverage
26+
- [ ] Complete autonomous CICD for on-demand testing and building
27+
28+
## Roadmap
29+
- [ ] Alpha release
30+
- [ ] Beta release
31+
- [ ] Solicit community feedback
32+
- [ ] 360 Development Review

core_requirements.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
loguru
2+
python-dateutil
3+
python-dotenv
4+
sqlmodel

core_requirements.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --strip-extras core_requirements.in
6+
#
7+
colorama==0.4.6
8+
# via loguru
9+
greenlet==3.0.1
10+
# via sqlalchemy
11+
loguru==0.7.2
12+
# via -r core_requirements.in
13+
pydantic==1.10.13
14+
# via sqlmodel
15+
python-dateutil==2.8.2
16+
# via -r core_requirements.in
17+
python-dotenv==1.0.0
18+
# via -r core_requirements.in
19+
six==1.16.0
20+
# via python-dateutil
21+
sqlalchemy==1.4.50
22+
# via sqlmodel
23+
sqlalchemy2-stubs==0.0.2a37
24+
# via sqlmodel
25+
sqlmodel==0.0.11
26+
# via -r core_requirements.in
27+
typing-extensions==4.8.0
28+
# via
29+
# pydantic
30+
# sqlalchemy2-stubs
31+
win32-setctime==1.1.0
32+
# via loguru

crud/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)