/usr/lib/python2.7/dist-packages/ledger_autosync-0.3.5.egg-info/PKG-INFO is in ledger-autosync 0.3.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | Metadata-Version: 1.1
Name: ledger-autosync
Version: 0.3.5
Summary: Automatically sync your bank's data with ledger
Home-page: https://gitlab.com/egh/ledger-autosync
Author: Erik Hetzner
Author-email: egh@e6h.org
License: GPLv3
Description-Content-Type: UNKNOWN
Description: ledger-autosync
===============
ledger-autosync is a program to pull down transactions from your bank
and create `ledger <http://ledger-cli.org/>`__ transactions for them. It
is designed to only create transactions that are not already present in
your ledger files (that is, deduplicate transactions). This should make
it comparable to some of the automated synchronization features
available in products like GnuCash, Mint, etc. In fact, ledger-autosync
performs OFX import and synchronization better than all the alternatives
I have seen.
Features
--------
- supports `ledger <http://ledger-cli.org/>`__ 3 and
`hledger <http://hledger.org/>`__
- like ledger, ledger-autosync will never modify your files directly
- interactive banking setup via
`ofxclient <https://github.com/captin411/ofxclient>`__
- multiple banks and accounts
- support for non-US currencies
- support for 401k and investment accounts
- tracks investments by share, not dollar value
- support for complex transaction types, including transfers, buys,
sells, etc.
- import of downloaded OFX files, for banks not supporting automatic
download
- import of downloaded CSV files from Paypal, Amazon and Mint
Platforms
---------
ledger-autosync is developed on Linux with ledger 3 and python 2.7; it has been
tested on Windows (although it will run slower) and should run on OS X. It
requires ledger 3 or hledger, but it should run faster with ledger, because it
will not need to start a command to check every transaction.
Quickstart
----------
Installation
~~~~~~~~~~~~
If you are on Debian or Ubuntu, an (older) version of ledger-autosync
should be available for installation. Try:
::
$ sudo apt-get install ledger-autosync
If you use pip, you can install the latest released version:
::
$ pip install ledger-autosync
You can also install from source, if you have downloaded the source:
::
$ python setup.py install
You may need to install the following libraries (on debian/ubuntu):
::
$ sudo apt-get install libffi-dev libpython-dev libssl-dev libxml2-dev python-pip libxslt-dev
Running
~~~~~~~
Once you have ledger-autosync installed, you can download an OFX file
from your bank and run ledger-autosync against it:
::
$ ledger-autosync download.ofx
This should print a number of transactions to stdout. If you add these
transactions to your default ledger file (whatever is read when you run
``ledger`` without arguments), you should find that if you run
ledger-autosync again, it should print no transactions. This is because
of the deduplicating feature: only new transactions should be printed
for insertion into your ledger files.
Using the ofx protocol for automatic download
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ledger-autosync also supports using the OFX protocol to automatically
connect to banks and download data. You can use the ofxclient program
(which should have been installed with ledger-autosync) to set up
banking:
::
$ ofxclient
When you have added your institution, quit ofxclient.
(At least one user has reported being signed up for a pay service by
setting up OFX direct connect. Although this seems unusual, please be
aware of this.)
Edit the generated ``~/ofxclient.ini`` file. Change the ``description``
field of your accounts to the name used in ledger. Optionally, move the
``~/ofxclient.ini`` file to your ``~/.config`` directory.
Run:
::
ledger-autosync
This will download a maximum of 90 days previous activity from your
accounts. The output will be in ledger format and printed to stdout. Add
this output to your ledger file. When that is done, you can call:
::
ledger-autosync
again, and it should print nothing to stdout, because you already have
those transactions in your ledger.
Syncing a file
--------------
Some banks allow users to download OFX files, but do not support
fetching via the OFX protocol. If you have an OFX file, you can convert
to ledger:
::
ledger-autosync /path/to/file.ofx
This will print unknown transactions in the file to stdout in the same
way as ordinary sync. If the transaction is already in your ledger, it
will be ignored.
How it works
------------
ledger-autosync stores a unique identifier, (for OFX files, this is a
unique ID provided by your institution for each transaction), as
metadata in each transaction. When syncing with your bank, it will check
if the transaction exists by running the ledger or hledger command. If
the transaction exists, it does nothing. If it does not exist, the
transaction is printed to stdout.
Syncing a CSV file
------------------
If you have a CSV file, you may also be able to import it using a recent
(installed via source) version of ledger-autosync. ledger-autosync can
currently process CSV files as provided by Paypal, Amazon, or Mint. You
can process the CSV file as follows:
::
ledger-autosync /path/to/file.csv -a Assets:Paypal
With Amazon and Paypal CSV files, each row includes a unique identifier,
so ledger-autosync will be able to deduplicate against any previously
imported entries in your ledger files.
With Mint, a unique identifier based on the data in the row is generated
and stored. If future downloads contain identical rows, they will be
deduplicated. This method is probably not as robust as a method based on
unique ids, but Mint does not provide a unique id, and it should be
better than nothing. It is likely to generate false negatives:
transactions that seem new, but are in fact old. It will not generate
false negatives: transactions that are not generated because they seem
old.
If you are a developer, you should fine it easy enough to add a new CSV
format to ledger-autosync. See, for example, the ``MintConverter`` class
in the ``ledgerautosync/converter.py`` file in this repository.
Assertions
----------
If you supply the ``--assertions`` flag, ledger-autosync will also print
out valid ledger assertions based on your bank balances at the time of
the sync. These otherwise empty transactions tell ledger that your
balance *should* be something at a given time, and if not, ledger will
fail with an error.
401k and investment accounts
----------------------------
If you have a 401k account, ledger-autosync can help you to track the
state of it. You will need OFX files (or an OFX protocol connection as
set up by ofxclient) provided by your 401k.
In general, your 401k account will consist of buy transactions,
transfers and reinvestments. The type will be printed in the payee line
after a colon (``:``)
The buy transactions are your contributions to the 401k. These will be
printed as follows:
::
2016/01/29 401k: buymf
; ofxid: 1234
Assets:Retirement:401k 1.12345 FOOBAR @ $123.123456
Income:Salary -$138.32
This means that you bought (contributed) $138.32 worth of FOOBAR (your
investment fund) at the price of $123.123456. The money to buy the
investment came from your income. In ledger-autosync, the
``Assets:Retirement:401k`` account is the one specified using the
``--account`` command line, or configured in your ``ofxclient.ini``. The
``Income:Salary`` is specified by the ``--unknown-account`` option.
If the transaction is a “transfer” transaction, this usually means
either a fee or a change in your investment option:
::
2014/06/30 401k: transfer: out
; ofxid: 1234
Assets:Retirement:401k -1.61374 FOOBAR @ $123.123456
Transfer $198.69
You will need to examine your statements to determine if this was a fee
or a real transfer back into your 401k.
Another type of transaction is a “reinvest” transaction:
::
2014/06/30 401k: reinvest
; ofxid: 1234
Assets:Retirement:401k 0.060702 FOOBAR @ $123.123456
Income:Interest -$7.47
This probably indicates a reinvestment of dividends. ledger-autosync
will print ``Income:Interest`` as the other account.
resync
------
By default, ledger-autosync will process transactions backwards, and
stop when it sees a transaction that is already in ledger. To force it
to process all transactions up to the ``--max`` days back in time
(default: 90), use the ``--resync`` option. This can be useful when
increasing the ``--max`` option. For instance, if you previously
synchronized 90 days and now want to get 180 days of transactions,
ledger-autosync would stop before going back to 180 days without the
``--resync`` option.
python bindings
---------------
If the ledger python bindings are available, ledger-autosync can use them if you
pass in the ``--python`` argument.Note, however, they can be buggy, which is why
they are disabled by default
Plugin support (Experimental)
-----------------------------
ledger-autosync has experimental support for plugins. By placing python files a
directory named ``~/.config/ledger-autosync/plugins/`` it should be possible to
automatically load python files from there. This allows you to extend the csv
converters with your own code. For example, given the input CSV file:
::
"Date","Name","Amount","Balance"
"11/30/2016","Dividend","$1.06","$1,000“
The following converter in the file ``~/.config/ledger-autosync/plugins/my.py``:
::
from ledgerautosync.converter import CsvConverter, Posting, Transaction, Amount
import datetime
import re
class SomeConverter(CsvConverter):
FIELDSET = set(["Date", "Name", Amount", "Balance"])
def __init__(self, *args, **kwargs):
super(SomeConverter, self).__init__(*args, **kwargs)
def convert(self, row):
md = re.match(r"^(\(?)\$([0-9,\.]+)", row['Amount'])
amount = md.group(2).replace(",", "")
if md.group(1) == "(":
reverse = True
else:
reverse = False
if reverse:
account = 'expenses'
else:
account = 'income'
return Transaction(
date=datetime.datetime.strptime(row['Date'], "%m/%d/%Y"),
payee=row['Name'],
postings=[Posting(self.name, Amount(amount, '$', reverse=reverse)),
Posting(account, Amount(amount, '$', reverse=not(reverse)))])
Running ``ledger-autosync file.csv -a assets:bank`` will generate:
::
2016/11/30 Dividend
assets:bank $1.06
income -$1.06
For more examples, see
https://gitlab.com/egh/ledger-autosync/blob/master/ledgerautosync/converter.py#L421
Testing
-------
ledger-autosync uses nose for tests. To test, run nosetests in the
project directory. This will test the ledger, hledger and ledger-python
interfaces. To test a single interface, use nosetests -a hledger. To
test the generic code, use nosetests -a generic. To test both, use
nosetests -a generic -a hledger. For some reason nosetests -a '!hledger'
will not work.
Keywords: ledger accounting
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Office/Business :: Financial
|