Skip to content

Reformat in PyPI-compatible way #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.egg-info
__pycache__/

53 changes: 35 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,19 @@ Any Transaction used as a template is removed by the plugin during processing. T

## Installation

Import the plugin however your beancount repository dictates.
### Using pip

The author currently uses this method, as this plugin is not yet set up as a properly-importable Python package:
Use pip to install the package:

```shell
$ grep pythonpath main.beancount
option "insert_pythonpath" "True"
$ grep repete main.beancount
plugin "plugins.beancount-repete.plugin"
$ cd plugins
$ git submodule add https://github.com/jpluscplusm/beancount-repete
Cloning into 'beancount-repete'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), 12.65 KiB | 762.00 KiB/s, done.
pip install git+https://github.com/jpluscplusm/beancount-repete
```

### Dependencies
Add this line to your beancount file to enable the plugin:

Install the [Recurrent](https://github.com/kvh/recurrent) library. It is available [from PyPI](https://pypi.org/project/recurrent/).
```
plugin "beancount_repete"
```

## Usage

Expand All @@ -44,9 +35,8 @@ Given this `example.beancount` input, and the beancount-repete plugin (set up as

```shell
$ cat example.beancount
option "insert_pythonpath" "True"

plugin "plugins.beancount-repete.plugin"
plugin "beancount_repete"
plugin "beancount.plugins.auto_accounts"

2022-01-01 ! "Supermarket" "Weekly shop"
Expand Down Expand Up @@ -160,3 +150,30 @@ $ bean-report example.beancount print
```

Note that the original template, on 2022-01-01, is not present in this output. This is always true: if a template's schedule would not generate its original date when evaluated, the template Transaction will not be produced.


## Installation into beancount repository

As an alternative to the default install method, you can copy the files of this plugin directly into the folder of your beancount file. Use the beancount option `insert_pythonpath` in this case. To access a subfolder, prepend it and separate with a dot, like for Python modules.

This is how the setup of the author currently looks like:

```shell
$ grep pythonpath main.beancount
option "insert_pythonpath" "True"
$ grep repete main.beancount
plugin "plugins.beancount-repete"
$ cd plugins
$ git submodule add https://github.com/jpluscplusm/beancount-repete
Cloning into 'beancount-repete'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), 12.65 KiB | 762.00 KiB/s, done.
```

When using this method, you have to install dependencies manually:

Install the [Recurrent](https://github.com/kvh/recurrent) library. It is available [from PyPI](https://pypi.org/project/recurrent/).

File renamed without changes.
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
name = "beancount_repete"
version = "1.0"
description = "A Beancount plugin that expands recurring transactions using natural language rules."
authors = [
{ name = "Jonathan Matthews", email = "[email protected]" }
]
license = "MIT"
readme = "README.md"
requires-python = ">=3.8"

dependencies = [
"python-dateutil",
"recurrent",
"beancount",
]

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"