From 8aeaa49dd8a6be2d1eb698cb186d6afd5534775b Mon Sep 17 00:00:00 2001 From: president Date: Fri, 19 Dec 2025 15:15:41 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=81=AE=E7=92=B0=E5=A2=83=E8=A8=AD=E5=AE=9A=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=80=81README.md=E3=81=AB=E9=96=8B=E7=99=BA=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=83=88=E3=82=A2=E3=83=83=E3=83=97=E6=89=8B=E9=A0=86=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E8=A8=98=E3=80=82=E4=BD=9C=E6=A5=AD=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E7=94=A8=E3=81=AEdiary.md=E3=82=92=E6=96=B0=E8=A6=8F=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=81=97=E3=80=81.gitignore=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=A6=E4=B8=8D=E8=A6=81=E3=81=AA=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E9=99=A4=E5=A4=96=E3=80=82?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?CSV=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cursorrules | 2 + .env.example | 3 + .gitignore | 187 ++------------------------------ Doc/diary.md | 1 + README.md | 30 ++++- Sample-data/IDEMITSU_2512-2.csv | 9 ++ Sample-data/IDEMITSU_2601.csv | 25 +++++ requirements-dev.txt | 4 + requirements.txt | 4 + 9 files changed, 87 insertions(+), 178 deletions(-) create mode 100644 .env.example create mode 100644 Doc/diary.md create mode 100644 Sample-data/IDEMITSU_2512-2.csv create mode 100644 Sample-data/IDEMITSU_2601.csv create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/.cursorrules b/.cursorrules index 4178698..6619b3f 100644 --- a/.cursorrules +++ b/.cursorrules @@ -3,3 +3,5 @@ - コーディング: 既存のコードスタイル・命名規則に従う - プロジェクト概要:クレジットカードCSVデータを分類、レポートを作るWebアプリケーション - 注意点(任意):仕様書の確認する +- /Doc/diary.md に、作業ログ記録 何をやったかを箇条書きでOK +- この端末にはpostgreのCLIがインストールされています 本体は https:labo.sunamura-llc.com に設置 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..bd7ffc4 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +DJANGO_SECRET_KEY=change-me +DJANGO_DEBUG=true +DATABASE_URL=postgresql://postgres:postgres@localhost:5432/card_data_sorting diff --git a/.gitignore b/.gitignore index 7297cad..d6766b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,178 +1,13 @@ -Sample-data/ - -# ---> Python -# Byte-compiled / optimized / DLL files -__pycache__/ *.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# UV -# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -#uv.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/latest/usage/project/#working-with-version-control -.pdm.toml -.pdm-python -.pdm-build/ - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments +*.swp +.DS_Store .env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ - -# Ruff stuff: -.ruff_cache/ - -# PyPI configuration file -.pypirc - +.venv/ +__pycache__/ +*.sqlite3 +*.log +/.pytest_cache/ +/.mypy_cache/ +/.ruff_cache/ +/staticfiles/ +/media/ diff --git a/Doc/diary.md b/Doc/diary.md new file mode 100644 index 0000000..f1199b5 --- /dev/null +++ b/Doc/diary.md @@ -0,0 +1 @@ +# 作業日誌 (作業ログです) \ No newline at end of file diff --git a/README.md b/README.md index c01d30c..2c233f7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ -# ------ +# Card-data-sorting -何某の元ネタとなる \ No newline at end of file +Business-focused Django app for importing credit card CSV statements and splitting business vs household expenses. + +## Development setup + +### Prerequisites + +- Python 3.9+ (local) +- PostgreSQL 14+ +- libffi/libpango/libcairo (for WeasyPrint) + +### Setup steps + +```bash +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements-dev.txt +cp .env.example .env +``` + +### Environment variables + +Edit `.env` to match your local DB. + +### Next actions + +- Initialize the Django project and app structure. +- Configure PostgreSQL settings and migrations. diff --git a/Sample-data/IDEMITSU_2512-2.csv b/Sample-data/IDEMITSU_2512-2.csv new file mode 100644 index 0000000..fd9496d --- /dev/null +++ b/Sample-data/IDEMITSU_2512-2.csv @@ -0,0 +1,9 @@ +J[h,@ +x,2025/12/08 +񂲐z,0000004690 + +p,pXyяi,{lEƑ敪,x敪,O敪,pz,l +2025/09/26,dsb{@@iO}ވ]j,,P,,970, +2025/09/26,dsb{@@iވ]쁨O}j,,P,,970, +2025/10/08,dsb{@@i鐲r`Xj,,P,,1780, +2025/10/30,dsb{@@iO}ވ]j,,P,,970, diff --git a/Sample-data/IDEMITSU_2601.csv b/Sample-data/IDEMITSU_2601.csv new file mode 100644 index 0000000..c9e5953 --- /dev/null +++ b/Sample-data/IDEMITSU_2601.csv @@ -0,0 +1,25 @@ +J[h,oS[hJ[h +x,2026/01/07 +񂲐z,0000132408 + +p,pXyяi,{lEƑ敪,x敪,O敪,pz,l +2025/11/26,L@@@@@@@@@@,,P,,23926,ʁFPXR +2025/11/10,`ookd@bnl@ahkk,,P,,150, +2025/11/12,`ookd@bnl@ahkk,,P,,480, +2025/11/13,vm@^LJe,,P,,18128, +2025/11/15,Kl嗤PCwOX,,P,,57000, +2025/11/24,`adl`v~A,,P,,1080, +2025/11/26,nodm`h@bg`sfos@rtarbq,,P,,3568,nʉ݊zFQQDOO@trc +,ir`m@eq`mbhrbnj,,,,,~Z[gFPP^QV@PUQDPWPX +2025/11/26,cn,,P,,2774, +2025/11/28,`vC,,P,,2950, +2025/11/28,`ookd@bnl@ahkk,,P,,1350, +2025/11/28,zNVbveeVȂX,,P,,3065, +2025/11/30,`l`ynmDbnDio,,P,,1577, +2025/11/30,`l`ynmDbnDio,,P,,4971, +2025/12/01,GbNXT|o|^l,,P,,2200, +2025/12/01,OD@hCT[rX,,P,,272, +2025/12/01,`ookd@bnl@ahkk,,P,,1200, +2025/12/03,`ookd@bnl@ahkk,,P,,480, +2025/12/08,OD^T|o|,,P,,2612, +2025/12/10,AbgEjteB,,P,,4625, diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..fdd567d --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,4 @@ +-r requirements.txt +pytest>=7.4,<8.0 +pytest-django>=4.5,<5.0 +ruff>=0.3,<0.4 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e0c2805 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Django>=4.2,<5.0 +psycopg[binary]>=3.1,<4.0 +chardet>=5.2,<6.0 +WeasyPrint>=60.0,<61.0