summaryrefslogtreecommitdiff
path: root/penny.cabal
blob: 3fed94d8fc7d613b46591beca87e9251c70baa08 (plain)
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
Name: penny
Version: 0.30.0.0
Cabal-version: >=1.8
Build-Type: Simple
License: BSD3
Copyright: 2012-2013 Omari Norman.
author: Omari Norman
maintainer: omari@smileystation.com
stability: Experimental
homepage: http://www.github.com/massysett/penny
bug-reports: omari@smileystation.com
Category: Console, Finance
License-File: LICENSE

synopsis: Extensible double-entry accounting system

description: Penny is a double-entry accounting system. It is inspired
  by, but incompatible with, John Wiegley's Ledger, which is available
  at <http://ledger-cli.org/>. Installing this package with cabal
  install will install the executable program and the necessary
  libraries.

  .

  * Penny is a double-entry accounting system. It uses traditional
  accounting terminology, such as the terms \"Debit\" and
  \"Credit\". If you need a refresher on the basics of double-entry
  accounting, pick up a used accounting textbook from your favorite
  bookseller (they can be had cheaply, for less than ten U.S. dollars
  including shipping) or check out
  <http://www.principlesofaccounting.com/>, a great free online text.

  .

  * Penny is based around "Penny.Lincoln", a core library to represent
    transactions and postings and their components, such as their
    amounts and whether they are debits and credits. You can use
    Lincoln all by itself even if you don't use the other components
    of Penny, which you may find handy if you are a Haskell
    programmer. I wrote Penny because I wanted a precise library to
    represent my accounting data so I could analyze it programatically
    and verify its consistency.

  .

  * Penny's command line interface and its reports give you
    great flexibility to filter and sort postings. Each posting
    within a transaction may have its own flags assigned (e.g. to
    indicate whether the posting is cleared) and each posting may have
    infinite \"tags\" assigned to it, giving you another way to
    categorize your postings. For instance, you might have vacation
    related postings in several different accounts, but you can give
    them all a \"vacation\" tag.

  .

  * You can easily build a program to process downloads of Open
    Financial Exchange data from your financial institution. Your
    program will merge new transactions into your ledger
    automatically.

  .

  * Full Unicode support.

  .

  * Penny's reports have color baked in from the beginning. You do not
    have to use color, which is handy if you are sending
    output to a file or if, well, you just don't like color.

  .

  * Penny's reports automatically adjust themselves to the width of
    your screen. You can easily specify how much or how little data to
    see with command line options.

  .

  * Penny handles multiple commodities (for example, multiple
    currencies, stocks and bonds, tracking other assets, etc.) in an
    easy and transparent way that is consistent with double-entry
    accounting principles. It embraces the philosophy outlined in this
    tutorial on multiple commodity accounting:
    <http://www.mscs.dal.ca/~selinger/accounting/tutorial.html>.

  .

  * Penny stores amounts using only integers.  This ensures the
    accuracy of your data, as using floating point values to represent
    money is a bad idea. Here is one explanation:
    <http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency>. The
    use of integer arithmetic also makes Penny simpler internally, as
    there is no need for arbitrary rounding to compensate for the
    bizarre and inaccurate results that sometimes arise from the use of
    floating-point values to represent currencies.

  .

  * Freely licensed under the MIT license. If you take this code,
    improve it, lock it up and make it proprietary, and sell it,
    AWESOME! I haven't lost anything because I still have my code and,
    what's more, then maybe I can buy your product and not have to
    maintain this one any more!

  .

  * Tested using QuickCheck. The tests are available in the Git
    repository that also contains the main library. Not everything
    is tested, but the tests that exist so far have already rooted
    out some strange corner-case bugs.

  .

  Non-features / disadvantages:

  .

  * Written in Haskell. Yes, I think Haskell is the best tool ever,
    but its compiler is not as commonly installed as compilers for C
    or C++, and non-Haskellers will probably find Penny to be more
    difficult to install than Ledger, as the latter is written in C++.

  .

  * Handling commodities requires that you set up multiple accounts;
    some might find this cumbersome.

  .

  * Young and not well tested yet.

  .

  * Runs only on Unix-like operating systems.

  .

  * Full Penny functionality is available without a Haskell compiler;
    you could even use a pre-compiled binary.  However, Penny does not
    read configuration files at runtime; instead, to change the
    default settings, you will need to have GHC installed so that you
    can compile a custom binary.

  .

  * Can be slow and memory hungry with large data sets. I have a
    ledger file with about 28,000 lines. On my least capable machine
    (which has an Intel Core 2 Duo at 1.6 GHz) this takes about 1.4
    seconds to parse. Not horrible but not instantaneous
    either. Generating a report about all these transactions can take
    about seven seconds and a little less than 300 MB of memory. I
    have eliminated all the obvious slowness from the code and
    attempted a rewrite of the parser, which made no difference; other
    ideas to speed up Penny with large data sets would involve
    substantial changes and this is not at the top of my list because
    the program is currently usable with relatively recent hardware.

  .

  Unfortunately running \"cabal install\" will not
  install the documentation, so you will need to find the downloaded
  archive (usually in
  \"$HOME/.cabal/packages/hackage.haskell.org/penny\") and unpack it
  to see the documentation. You will want to start by reading the
  README file, which will point you to additional documentation and
  how to install it if you wish.

extra-source-files:
    install-docs
  , README
  , doc/*.dot
  , doc/*.hs
  , doc/examples/*.pny
  , doc/man/*.1
  , doc/man/*.7

source-repository head
  type: git
  location: git://github.com/massysett/penny.git

Library
  Build-depends:
      base ==4.6.*
    , action-permutations ==0.0.0.0
    , bytestring ==0.10.*
    , cereal ==0.3.*
    , containers ==0.5.*
    , matchers ==0.12.*
    , multiarg ==0.24.*
    , ofx ==0.4.*
    , old-locale ==1.0.*
    , parsec >= 3.1.2 && < 3.2
    , prednote == 0.16.*
    , pretty-show ==1.5.*
    , rainbow ==0.4.*
    , semigroups ==0.9.*
    , split ==0.2.*
    , text ==0.11.*
    , time ==1.4.*
    , transformers == 0.3.*

  Exposed-modules:
      Penny
    , Penny.Brenner
    , Penny.Brenner.Clear
    , Penny.Brenner.Database
    , Penny.Brenner.Import
    , Penny.Brenner.Info
    , Penny.Brenner.Merge
    , Penny.Brenner.OFX
    , Penny.Brenner.Print
    , Penny.Brenner.Types
    , Penny.Brenner.Util
    , Penny.Cabin
    , Penny.Cabin.Balance
    , Penny.Cabin.Balance.Convert
    , Penny.Cabin.Balance.Convert.Chunker
    , Penny.Cabin.Balance.Convert.ChunkerPct
    , Penny.Cabin.Balance.Convert.Options
    , Penny.Cabin.Balance.Convert.Parser
    , Penny.Cabin.Balance.MultiCommodity
    , Penny.Cabin.Balance.MultiCommodity.Chunker
    , Penny.Cabin.Balance.MultiCommodity.Parser
    , Penny.Cabin.Balance.Util
    , Penny.Cabin.Interface
    , Penny.Cabin.Meta
    , Penny.Cabin.Options
    , Penny.Cabin.Parsers
    , Penny.Cabin.Posts
    , Penny.Cabin.Posts.Allocated
    , Penny.Cabin.Posts.BottomRows
    , Penny.Cabin.Posts.Fields
    , Penny.Cabin.Posts.Growers
    , Penny.Cabin.Posts.Chunk
    , Penny.Cabin.Posts.Meta
    , Penny.Cabin.Posts.Parser
    , Penny.Cabin.Posts.Spacers
    , Penny.Cabin.Posts.Types
    , Penny.Cabin.Row
    , Penny.Cabin.Scheme
    , Penny.Cabin.Scheme.Schemes
    , Penny.Cabin.TextFormat
    , Penny.Copper
    , Penny.Copper.Interface
    , Penny.Copper.Parsec
    , Penny.Copper.Render
    , Penny.Copper.Terminals
    , Penny.Liberty
    , Penny.Lincoln
    , Penny.Lincoln.Balance
    , Penny.Lincoln.Bits
    , Penny.Lincoln.Bits.DateTime
    , Penny.Lincoln.Bits.Open
    , Penny.Lincoln.Bits.Price
    , Penny.Lincoln.Bits.Qty
    , Penny.Lincoln.Builders
    , Penny.Lincoln.Ents
    , Penny.Lincoln.Equivalent
    , Penny.Lincoln.HasText
    , Penny.Lincoln.Matchers
    , Penny.Lincoln.Natural
    , Penny.Lincoln.Predicates
    , Penny.Lincoln.Predicates.Siblings
    , Penny.Lincoln.PriceDb
    , Penny.Lincoln.Queries
    , Penny.Lincoln.Queries.Siblings
    , Penny.Lincoln.Serial
    , Penny.Shield
    , Penny.Steel
    , Penny.Steel.Sums
    , Penny.Wheat
    , Penny.Zinc

  Other-modules:
      Paths_penny

  hs-source-dirs: lib

  if flag(incabal)
    cpp-options: -Dincabal

  ghc-options: -Wall
  if flag(debug)
    ghc-options: -auto-all -caf-all

Executable penny
  Build-depends:
      penny
    , base ==4.6.*

  hs-source-dirs: bin
  Main-is: penny-main.hs
  Other-modules: Paths_penny
  GHC-Options: -Wall
  if flag(debug)
    GHC-Options: -rtsopts -auto-all -caf-all

  if ! flag(build-penny)
    buildable: False

Flag build-penny
  Description: Build the penny executable
  Default: True

Executable penny-selloff
  Build-depends:
      penny
    , base == 4.6.*
    , containers ==0.5.*
    , either ==3.4.*
    , semigroups ==0.9.*
    , text ==0.11.*
    , parsec ==3.1.*
    , multiarg ==0.24.*
    , transformers ==0.3.*

  other-modules: Paths_penny
  hs-source-dirs: bin
  Main-is: penny-selloff.hs
  GHC-Options: -Wall
  if flag(debug)
    GHC-Options: -rtsopts -auto-all -caf-all

  if ! flag(build-selloff)
    buildable: False

Flag build-selloff
  Description: Build the penny-selloff executable
  Default: True

Executable penny-diff
  Build-depends:
      penny
    , base ==4.6.*
    , text ==0.11.*
    , multiarg ==0.24.*

  hs-source-dirs: bin
  Main-is: penny-diff.hs
  Other-modules: Paths_penny
  GHC-Options: -Wall
  if flag(debug)
    GHC-Options: -rtsopts -auto-all -caf-all

  if ! flag(build-diff)
    buildable: False

Flag build-diff
  Description: Build the penny-diff executable
  Default: True

Executable penny-reprint
  Build-depends:
      penny
    , base ==4.6.*
    , multiarg ==0.24.*
    , pretty-show ==1.5.*
    , text ==0.11.*

  hs-source-dirs: bin
  main-is: penny-reprint.hs
  Other-modules: Paths_penny
  ghc-options: -Wall
  if ! flag(build-reprint)
    buildable: False

Flag build-reprint
  Description: Build the penny-reprint executable
  Default: True

Executable penny-reconcile
  Build-depends:
      penny
    , base ==4.6.*
    , text ==0.11.*
    , multiarg ==0.24.*

  hs-source-dirs: bin
  main-is: penny-reconcile.hs
  Other-modules: Paths_penny
  ghc-options: -Wall
  if ! flag(build-reconcile)
    buildable: False

Flag build-reconcile
  Description: Build the penny-reconcile executable
  Default: True

Test-Suite penny-test
  type: exitcode-stdio-1.0
  Main-is: penny-test.hs
  other-modules:
      Copper
    , Copper.Gen.Parsers
    , Copper.Gen.Terminals
    , Copper.Parser
    , Copper.Render
    , Lincoln
  hs-source-dirs: tests

  -- Be sure the build-depends are listed within the if block;
  -- otherwise, cabal install will always include these
  -- build-dependencies in any build, even non-test builds. However,
  -- you still have to list all the build-depends--the library
  -- build-depends are included for dependency resolving purposes but
  -- not for building purposes.

  -- Test dependencies. test-framework has issues with newer versions,
  -- see
  -- https://github.com/batterseapower/test-framework/issues/34

  -- For details on why penny is a dependency here, see
  -- http://stackoverflow.com/questions/6711151

  build-depends:
      penny
    , QuickCheck ==2.5.*
    , random-shuffle ==0.0.4

    , base ==4.6.*
    , multiarg ==0.24.*
    , parsec >= 3.1.2 && < 3.2
    , semigroups ==0.9.*
    , text ==0.11.*
    , time ==1.4.*
    , transformers == 0.3.*

  ghc-options: -Wall

Executable penny-gibberish
  Main-is: penny-gibberish.hs
  other-modules:
      Copper.Gen.Parsers
    , Copper.Gen.Terminals
  hs-source-dirs: tests

  if flag(test)
    build-depends:
          penny
        , QuickCheck ==2.5.*
        , random-shuffle ==0.0.4
        , random ==1.0.*

        , base ==4.6.*
        , multiarg ==0.24.*
        , semigroups ==0.9.*
        , text ==0.11.*
        , time ==1.4.*
        , transformers == 0.3.*

  else
    buildable: False

  ghc-options: -Wall

Flag debug
  Description: turns on some debugging options
  Default: False

Flag test
  Description: enables QuickCheck tests
  Default: False

Flag incabal
  Description: enables imports that only Cabal makes available
  Default: True