Metadata-Version: 2.4
Name: dinary
Version: 0.5.0
Summary: Server for [Dinary - your dinar diary](https://github.com/andgineer/dinary). Track expenses, scan receipts, analyze spending with AI
Project-URL: Homepage, https://andgineer.github.io/dinary/
Project-URL: Documentation, https://andgineer.github.io/dinary/
Author-email: Andrey Sorokin <andrey@sorokin.engineer>
License: Copyright (c) 2026 Andrey Sorokin <andrey@sorokin.engineer>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the “Software”), to deal in
        the Software without restriction, including without limitation the rights to use,
        copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
        Software, and to permit persons to whom the Software is furnished to do so,
        subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
        OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
        HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
        WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
        FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
        OTHER DEALINGS IN THE SOFTWARE.
License-File: LICENSE.txt
Keywords: budget,expenses,receipts
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.13
Requires-Dist: cachetools>=7.0.6
Requires-Dist: fastapi>=0.115.0
Requires-Dist: google-auth>=2.38.0
Requires-Dist: gspread>=6.1.0
Requires-Dist: holidays>=0.94
Requires-Dist: httpx>=0.28.0
Requires-Dist: pydantic-settings>=2.8.0
Requires-Dist: sr-invoice-parser>=1.0.3
Requires-Dist: tenacity>=9.1.4
Requires-Dist: tzdata>=2024.1
Requires-Dist: uvicorn[standard]>=0.34.0
Requires-Dist: yoyo-migrations>=9.0.0
Description-Content-Type: text/markdown

[![Build Status](https://github.com/andgineer/dinary/workflows/CI/badge.svg)](https://github.com/andgineer/dinary/actions)
[![Coverage](https://raw.githubusercontent.com/andgineer/dinary/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/andgineer/dinary/blob/python-coverage-comment-action-data/htmlcov/index.html)
# Dinary

Track expenses, scan receipts, analyze spending with AI

# Documentation

[Dinary](https://andgineer.github.io/dinary/)

# Local development

Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then:

```bash
uv sync

# Create .deploy/.env from the template (one-time, .deploy/ is gitignored)
cp -r .deploy.example .deploy

# First time — or whenever you want a clean slate:
#   wipes data/dinary.db (and the WAL/SHM sidecars), runs schema migrations, seeds the
#   hardcoded 3D taxonomy (groups / categories / events / tags), then
#   starts uvicorn on http://127.0.0.1:8000 with auto-reload.
uv run inv dev --reset

# Subsequent runs — DB is preserved, migrations still apply on startup
# via the FastAPI lifespan, so editing a migration and restarting is
# enough (no separate ``inv migrate`` needed for the local DB):
uv run inv dev
```

`inv dev` **disables Google-Sheets logging by default** so test expenses
you create while debugging don't leak into the prod logging spreadsheet
(the env var from `.deploy/.env` is overridden just for this process).
Pass `--sheet-logging` if you specifically want to exercise the drain
loop end-to-end.

To point local dev at a copy of prod data instead of an empty DB:

```bash
uv run inv backup                         # snapshot prod into ~/Library/dinary/<ts>/
cp ~/Library/dinary/<ts>/data/dinary.db data/
uv run inv dev                            # NOT --reset; keep the snapshot
```

Credentials are read from `~/.config/gspread/service_account.json` (standard gspread location).
Don't have a service account key yet?
See [Google Sheets Setup](https://andgineer.github.io/dinary/google-sheets-setup/).

### Run tests

```bash
inv test
```

### Pre-commit hooks

Use [pre-commit](https://pre-commit.com/#install) for code quality:

    pre-commit install

### Scripts

Install [invoke](https://docs.pyinvoke.org/en/stable/) preferably with [uv tool](https://docs.astral.sh/uv/):

    uv tool install invoke

For a list of available scripts run:

    invoke --list

### Deploy to Oracle Cloud

Configure `.deploy/.env` (see `.deploy.example/.env`), then:

```bash
inv setup-server    # one-time: install deps, clone, create systemd services, upload creds
inv deploy          # pull latest code and restart
inv status --remote # check service status
inv logs --remote   # tail server logs
```

See [Oracle Cloud deployment guide](https://andgineer.github.io/dinary/deploy-oracle/) for details.

## Reports

* [Allure test report](https://andgineer.github.io/dinary/builds/tests/)
* [Codecov](https://app.codecov.io/gh/andgineer/dinary/tree/main/src%2Fdinary)
* [Coveralls](https://coveralls.io/github/andgineer/dinary)

> Created with cookiecutter using [template](https://github.com/andgineer/cookiecutter-python-package)
