Skip to content

Commit

Permalink
Add GHAs
Browse files Browse the repository at this point in the history
  • Loading branch information
kmesiab committed Dec 23, 2024
1 parent d6d7d99 commit 0f450bd
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
- package-ecosystem: "gomod"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
33 changes: 33 additions & 0 deletions .github/go-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

defaults:
run:
shell: bash

on:
push:
branches:
- '**'

jobs:

build_go:
name: "🏗 Compile"

runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout Code
uses: actions/checkout@v3

- name: 🚀 Set up Go
uses: actions/[email protected]
with:
go-version: '1.23'
cache: true
check-latest: true

- name: 🧹 Tidy
run: go mod tidy

- name: 🤖 Build
run: go build .
52 changes: 52 additions & 0 deletions .github/go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Lint

defaults:
run:
shell: bash

on:
push:
branches:
- '**'

jobs:

lint-markdown:

name: "🧹 Markdown"
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout Code
uses: actions/checkout@v3

- name: 📦 Install Node.js and npm
uses: actions/setup-node@v3
with:
node-version: '20.0.0'

- name: 📚 Install markdownlint-cli
run: npm install -g markdownlint-cli

- name: 🖊️ Run markdownlint
run: find . -name '*.md' -exec markdownlint {} +

lint_go:
name: "️‍️🕵️ Golang"

runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout Code
uses: actions/checkout@v3

- name: 🚀 Set up Go
uses: actions/[email protected]
with:
go-version: '1.23'
cache: true
check-latest: true

- name: 🕵️‍♂️ Run GolangCI-Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
41 changes: 41 additions & 0 deletions .github/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

defaults:
run:
shell: bash

on:
push:
branches:
- '**'

jobs:
build:
name: 🧪 Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.23

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest

# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: 🧪 Execute Tests
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
# Upload the original go test log as an artifact for later review.
- name: Upload test log
uses: actions/upload-artifact@v2
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ Your_Name_Checking_eStatement (2).pdf

## Importing Your Statements

The importer parses your Chime statements into a SQLite database for analysis. For details on setting up and running the importer, see the [README in the `importer` folder](./importer/README.md).
The importer parses your Chime statements into a SQLite database for
analysis. For details on setting up and running the importer,
see the [README in the `importer` folder](./importer/README.md).

---

## Running the App

This app allows you to interact with your imported Chime transactions using AI. Once you've set up your `transactions.db` using the importer:
This app allows you to interact with your imported Chime transactions
using AI. Once you've set up your `transactions.db` using the importer:

1. **Start the AI Interface** (Coming Soon):

```bash
./chime-ai
```
Expand Down Expand Up @@ -82,14 +86,7 @@ where you could potentially reduce spending if necessary.
- [x] Import Chime bank statements into SQLite
- [x] Clean up parsed text files
- [x] Implement DB repository functions
- [ ] Add AI chat functionality for transaction queries
- [ ] Add tool calling and open ended query building agent
- [x] Add AI chat functionality for transaction queries
- [x] Add tool calling and open ended query building agent
- [ ] Improve error handling and data validation
- [ ] Support for additional bank formats

---

## License

This project is licensed under the MIT License. See the LICENSE file for details.

47 changes: 29 additions & 18 deletions importer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,46 @@ Your_Name_Checking_eStatement (2).pdf

## Converting Your Statements

This program automatically converts your Chime PDF statements into plain text using `pdftotext`. It then parses the data and imports it into a SQLite database for analysis.
This program automatically converts your Chime PDF statements into
plain text using `pdftotext`. It then parses the data and imports
it into a SQLite database for analysis.

If `pdftotext` is not installed, the script will notify you.

### Installing `pdftotext`

For most Linux distributions:

```bash
sudo apt-get install poppler-utils
```

On macOS (via Homebrew):

```bash
brew install poppler
```

On Windows:
- Download and install Poppler from [https://blog.alivate.com.au/poppler-windows/](https://blog.alivate.com.au/poppler-windows/).
- Add the `bin` folder containing `pdftotext.exe` to your PATH.

---
- Download and install Poppler from [https://blog.alivate.com.au/poppler-windows/](https://blog.alivate.com.au/poppler-windows/).<!-- markdownlint-disable-line MD013 -->
- Add the `bin` folder containing `pdftotext.exe` to your PATH.

## Building the Importer

1. **Install Go**: Make sure you have Go installed. You can download it from [https://go.dev/dl/](https://go.dev/dl/).
**Install Go**:

Make sure you have Go installed. You can download it from [https://go.dev/dl/](https://go.dev/dl/).<!-- markdownlint-disable-line MD013 -->

**Clone the Repository**:

2. **Clone the Repository**:
```bash
git clone <repository-url>
cd chime-ai/importer
```

3. **Build the Program**:
**Build the Program**:

```bash
go build -o importer
```
Expand All @@ -61,7 +68,8 @@ go build -o importer

## Running the Importer

Once built, you can run the program and point it to the directory containing your Chime statements:
Once built, you can run the program and point it to the directory
containing your Chime statements:

```bash
./importer -dir /path/to/your/statements
Expand All @@ -78,7 +86,8 @@ The program will:

## Output

- The transactions will be stored in a SQLite database named `transactions.db`.
- The transactions will be stored in a SQLite database named
`transactions.db`.
- Each transaction includes:
- Date
- Description
Expand All @@ -91,25 +100,28 @@ The program will:

## Example Usage

### Input Directory Structure:
### Input Directory Structure

```plaintext
/path/to/your/statements/
├── Your_Name_Checking_eStatement (1).pdf
├── Your_Name_Checking_eStatement (2).pdf
├── Your_Name_Checking_eStatement (3).pdf
```

### Command:
### Command

```bash
./importer -dir /path/to/your/statements
```

### Output:
### Example Output

```plaintext
Found 3 PDF files for conversion.
Converted Your_Name_Checking_eStatement (1).pdf to Your_Name_Checking_eStatement (1).txt
Converted Your_Name_Checking_eStatement (2).pdf to Your_Name_Checking_eStatement (2).txt
Converted Your_Name_Checking_eStatement (3).pdf to Your_Name_Checking_eStatement (3).txt
Converted Your_Name_Checking_eStatement (1).pdf to Your_Name_Checking_eStatement (1).txt<!-- markdownlint-disable-line MD013 -->
Converted Your_Name_Checking_eStatement (2).pdf to Your_Name_Checking_eStatement (2).txt<!-- markdownlint-disable-line MD013 -->
Converted Your_Name_Checking_eStatement (3).pdf to Your_Name_Checking_eStatement (3).txt<!-- markdownlint-disable-line MD013 -->
Processing Your_Name_Checking_eStatement (1).txt...
Processing Your_Name_Checking_eStatement (2).txt...
Processing Your_Name_Checking_eStatement (3).txt...
Expand All @@ -128,6 +140,5 @@ All files processed and cleaned up successfully!

- Ensure that your PDF statements are formatted properly and contain structured text.
- The program will skip duplicate transactions to avoid redundant entries.
- The SQLite database can be queried using tools like DB Browser for SQLite or programmatically with any library supporting SQLite.

---
- The SQLite database can be queried using tools like DB Browser for SQLite or
programmatically with any library supporting SQLite.

0 comments on commit 0f450bd

Please sign in to comment.