Skip to content

Commit

Permalink
docs(README): add better install + usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Oct 5, 2023
1 parent 40e167d commit 9c65e61
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ brew "pyenv"
brew "pyenv-virtualenv"
brew "tesseract"
brew "terraform"
brew "precommit"
brew "pre-commit"
brew "make"
brew "john-jumbo"
60 changes: 29 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
# Usage
Monopoly can be run as a Python package, allowing you to extract, transform and write bank statements to a CSV file.
# Monopoly
Monopoly is a Python library that extracts transactions from bank statement PDFs using Tesseract

To see an example of how Monopoly works, you can run
```bash
root_dir=$(git rev-parse --show-toplevel)
cd $root_dir && python3 $root_dir/monopoly/examples/single_statement.py
```
Supported banks:
- Citibank
- HSBC
- OCBC

# Install
Install using
Only credit card statements are supported (for now)

```sh
# Install
Install dependencies using [Homebrew](https://brew.sh/)
```bash
brew bundle
```

Install the gcloud CLI
```sh
cd ~
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-440.0.0-linux-x86_64.tar.gz
tar -xf google-cloud-cli-440.0.0-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh
./google-cloud-sdk/bin/gcloud init
cd -
Clone the repo
```bash
git clone https://github.com/benjamin-awd/monopoly.git
```

Then generate credentials with
```sh
gcloud auth application-default login
Create a virtual environment and install Python dependencies
```bash
pyenv virtualenv 3.11.4 monopoly
pyenv shell monopoly
poetry install
```

Enable the Gmail API and authorize access:
https://developers.google.com/gmail/api/quickstart/python
# Usage
Monopoly can be run as a Python package, allowing you to extract, transform and write bank statements to a CSV file.

Get API credentials
```sh
python3 quickstart.py
To see an example of how Monopoly works, you can use this [example](monopoly/examples/single_statement.py)
```bash
python3 $root_dir/monopoly/examples/single_statement.py
```

# Developing
Set up the pre-commit hooks
```sh
pre-commit install
```
# Features
Monopoly can be run on Google Cloud as a scheduled Cloud Run job.

Current implementation:

![Screenshot](docs/monopoly_gcp.png)
Binary file added docs/monopoly_gcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c65e61

Please sign in to comment.