Re: building python package

2023-12-20 Thread Alexis
Hi

Ledger's internal session handling is getting in your way here.
The way it is has been bothering me for quite some as it does
not work as I think it should, but that is for another time and debate.

In order to read journals multiple times they need to be closed
in between. The following works for me:

  % python
  >>> import ledger
  >>> journal = ledger.read_journal('test/input/drewr3.dat')
  >>> len(journal)
  11
  >>> ledger.close_journal_files()
  >>> journal = ledger.read_journal('test/input/drewr3.dat')
  >>> len(journal)
  11

May I ask for what purpose you plan to use Ledger Python and would
you be okay with me contacting you outside of this list?


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/mnag4pp27x455ck4bi74c7qut6tjkojxmymacyvmsncqmgbjhw%404cpqk5howwre.


Re: building python package

2023-12-19 Thread Alexis
Yay!

Glad to hear that you managed to get it working.
Welcome to the quirky and wonderful world of Ledger Python! :)

I've been using Ledger Python for several years time, happy to answer
questions and take inspiration for future API development from your
experience with it.

To answer your question, yes, as long as ledger.so is compiled properly
for the architecture and system you expect it to run on, you can place
it were you like and tell Python about its location using PYTHONPATH
or other means Python offers to load modules.

If you have the time and would like to give back, some feedback on
what would have helped you in terms of documentation or examples to
get Python Ledger installed would be appreciated.


Cheers
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/bizdkvfjt5sfjh5xyyqa6e4p6s2o33apjp6a4i5hfgvqn5uorm%40xdnysnj4nc4x.


Re: building python package

2023-12-19 Thread Alexis
Hi,

quite frankly I'm not particularly fond of acprep and prefer to use
the tools it wraps. Please find below the commands I use to cleanly
build ledger with Python support on macOS with a build environment
setup from nix flake and using cmake and make directly:

  % rm ledger{,.so}
  % rm -rf build
  % cmake -Bbuild -S. -DUSE_PYTHON:BOOL=ON -DPython_ROOT_DIR=$(which 
python)/../../
  % make -Cbuild -j8
  % ls -lsa ./build/ledger{,.so}
   428 -rwxr-xr-x 1 $USER staff  435664 Dec 19 21:27 ./build/ledger
  5684 -rwxr-xr-x 1 $USER staff 5819184 Dec 19 21:27 ./build/ledger.so
  % ./build/ledger --version | head -2
  Ledger 3.3.2-20230330, the command-line accounting tool
  without support for gpg encrypted journals and with Python support
  % env PYTHONPATH=/does/not/exist python -c 'import ledger; 
print(ledger.__version__)'
  Traceback (most recent call last):
File "", line 1, in 
  ModuleNotFoundError: No module named 'ledger'
  % env PYTHONPATH=$PWD/build python -c 'import ledger; 
print(ledger.__version__)'
  3.3.2

Not sure how helpful this is going to be yet the following works for me too:

  % ./acprep clean
  % ls -lsa ./ledger{,.so}
  ls: cannot access './ledger': No such file or directory
  ls: cannot access './ledger.so': No such file or directory
  % ./acprep configure --python -- -DPython_ROOT_DIR=$(which python)/../../
  % ./acprep make -j8
  % ls -lsa ./ledger{,.so}
   928 -rwxr-xr-x 1 $USER staff  948368 Dec 19 21:19 ./ledger
  8916 -rwxr-xr-x 1 $USER staff 9126192 Dec 19 21:19 ./ledger.so
  % ./ledger --version | head -2
  Ledger 3.3.2-20230330, the command-line accounting tool
  without support for gpg encrypted journals and with Python support
  % PYTHONPATH=. python -c 'import ledger; print(ledger.__version__)'
  3.3.2

爛

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/kbqmrocglev7lk4ekavxeuikqs5cakvdjtfgfyedcn3tltng4w%40ghjgcivqdwst.


Re: building python package

2023-12-19 Thread Alexis
Hi,

> I can run $ ./ledger --version and I'm getting "Ledger 3.3.2-20230330", 

Posting the complete output of ./ledger --version is helpful as the
version info includes a note about Python support:

  % ledger --version | head -2
  Ledger 3.3.2-20230330, the command-line accounting tool
  with support for gpg encrypted journals and with Python support

> which is great, but the python test, fails on "import ledger".

Seeing how you invoke Python, which version is run, and the actual
error message when "the python test fails on "import ledger" can be
insightful, e.g.:

  % /usr/bin/python3
  Python 3.9.6 (default, Nov 10 2023, 13:38:27)
  [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import ledger
  Traceback (most recent call last):
File "", line 1, in 
  ModuleNotFoundError: No module named 'ledger'

Maybe you could do a complete clean build from within a shell started
with script(1) and reply to this mail with the output (ledger-build.log)
attached?

  % script ledger-build.log
  % ./acprep 
  % exit

Looking at the linked libraries of the ledger (ldd output) built on
your system I do not see any references to Python, which exist for me
on my machine (see below).

  % otool -L $(which ledger)
  ~/.nix-profile/bin/ledger:

/nix/store/zm4a348a65ilcl35dg1sc5wmr98f0qnn-ledger-3.3.2/lib/libledger.3.dylib 
(compatibility version 3.0.0, current version 3.0.0)

/nix/store/3zkxk2nzf3b59fmdqi7s8fasl4asgx37-gpgme-1.23.0/lib/libgpgmepp.6.dylib 
(compatibility version 27.0.0, current version 27.0.0)

/nix/store/z0nnwdh4p692yvf3qgwgj3bn78w99q6y-python3-3.11.6/lib/libpython3.11.dylib
 (compatibility version 3.11.0, current version 3.11.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
1292.60.1)

/nix/store/3zkxk2nzf3b59fmdqi7s8fasl4asgx37-gpgme-1.23.0/lib/libgpgme.11.dylib 
(compatibility version 44.0.0, current version 44.0.0)

/nix/store/sc9h2pf31m4pqbnq9h5f5yj0ccgr1hb6-libassuan-2.5.6/lib/libassuan.0.dylib
 (compatibility version 9.0.0, current version 9.6.0)
/nix/store/l455b10bq8vri2gzgy7jk5fzjh6q24b8-mpfr-4.2.1/lib/libmpfr.6.dylib 
(compatibility version 9.0.0, current version 9.1.0)

/nix/store/1mlfpdjs99nhkin3gi2ns37vggkskkr4-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
 (compatibility version 16.0.0, current version 16.0.0)

/nix/store/4w0d6ly44x9mczv4s0x26dyhisgshb01-libedit-20221030-3.1/lib/libedit.0.dylib
 (compatibility version 1.0.0, current version 1.70.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_date_time.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_filesystem.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_atomic.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_system.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_iostreams.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_regex.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_unit_test_framework.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_python311.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/rd912bdihq9azqhmx37p39yp05mv8vca-boost-1.81.0/lib/libboost_nowide.dylib
 (compatibility version 0.0.0, current version 0.0.0)

/nix/store/0w070w3a2azyy1gs4mgskz9j3pq0g5dy-libcxxabi-16.0.6/lib/libc++abi.1.dylib
 (compatibility version 1.0.0, current version 1.0.0)

/nix/store/jkp27cvkfzy264pgmwgry17rkyi50m3r-gettext-0.21.1/lib/libintl.8.dylib 
(compatibility version 12.0.0, current version 12.0.0)
/nix/store/a78xnmg223s3iffja69ydg6sswbwd3i3-libiconv-50/lib/libiconv.dylib 
(compatibility version 7.0.0, current version 7.0.0)

/nix/store/p5wr7bxrs2naa4rwy9sqs19rljr7g7qh-libcxx-16.0.6/lib/libc++.1.0.dylib 
(compatibility version 1.0.0, current version 1.0.0)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/k4o2wmyfnwsdezmrjevtnzyo6u3vvr4znwah7g5yy4dri46ifu%402sqeunfvyujt.


Re: building python package

2023-12-19 Thread Alexis
Hi,

some of the things that you might try to resolve this are:

1. Disable use of libedit by appending -DHAVE_EDIT:BOOL=NO to the
   ./acprep call

2. Define LDFLAGS="-L$PATH_TO_NCURSES_LIBDIR -lncurses" in the
   environment when running acprep hoping cmake will pick it up
   properly.

3. Manually disable use of libedit in CMakeLists.txt by
   adding the following below line 256¹
   set(HAVE_EDIT 0)


Cheers
Alexis

¹ https://github.com/ledger/ledger/blob/master/CMakeLists.txt#L256

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/26pw2c5e7dgyz7oledcmp5rg5p4fqcplr26ffw5jwjpykjnspg%40vjr4ut3cvpho.


Re: building python package

2023-12-19 Thread Alexis
Hi,

> Based on your suggestions I made some progress. It finds boost in configure 

That's great to hear!

> but it is not being picked up. Is there an option to add something to make 
> INCLUDE?

There sure is: CMake's FindBoost Module¹ also offers hints with which
an installation prefix or the preferred include and library directory
can be set (for details see the FindBoost documentation²).
Does specifying -DBOOST_ROOT help?

  % ./acprep configure --python -- \
-DPython_ROOT_DIR=/home/sergiu/miniconda3/envs/ldg-build/ \
-DBOOST_ROOT=/home/sergiu/miniconda3/envs/ldg-build/ \
-DBoost_NO_SYSTEM_PATHS:BOOL=ON

The last hint "disable[s] searching in locations not specified by these
hint variables"; configuring ledger using CMake may work without it.


Godspeed :)


¹ https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake
² https://cmake.org/cmake/help/latest/module/FindBoost.html#hints

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/ihtpkcksyf5jdjcbn4557wny47nujtcj3qodjqcwxyocdpidpx%40xcfrjk4jzxxg.


Re: building python package

2023-12-17 Thread Alexis
Hi

from the information presented I have no clear understanding of the
environment and setup and I'm unfamiliar with conda and its specialities.

It seems to me as if some environment manager (miniconda?) is
setting up the environment so its Python (version 3.9) is preferred.
Is there a way, where you could have a shell that only uses the system
Python and retry building ledger with Python support?

Unfortunately I have no good advice for troubleshooting CMake
apart from reading FindPython.cmake¹ :/

What I suggest is giving CMake a hint about which Python you'd prefer to
be used (see Python_ROOT_DIR in FindPython module documentation²).

If I'm not mistaken on Ubuntu the Python root installation directory
should be /usr as the python executable resides in /usr/bin/python
and its libraries in /usr/lib/python3.8; at least according the
file Ubunut filelist³

How about trying the following:
  % rm -rf ./build
  % ./acprep configure --python -- -DPython_ROOT_DIR=/usr
  % ./acprep make
  % /usr/bin/env PYTHONPATH=$PWD/build/ledger/debug python3 -c 'import ledger; 
dir(ledger)'

or if your prefer to avoid using acprep:
  % rm -rf ./build
  % cmake --fresh -Bbuild -S. -DUSE_PYTHON:BOOL=ON -DPython_ROOT_DIR=/usr
  % make -j8 -Cbuild
  % /usr/bin/env PYTHONPATH=$PWD/build python3 -c 'import ledger; dir(ledger)'


Hope this helps!
If it's not too much to ask I'd appreciate to hear back if you run
into issues and if you succeed I'd be interested in what you think
would have helped you and made building Ledger Python easier for you.


Best
Alexis

¹ https://github.com/Kitware/CMake/blob/master/Modules/FindPython.cmake
² https://cmake.org/cmake/help/latest/module/FindPython.html#hints
³ https://packages.ubuntu.com/focal/amd64/libpython3.8-minimal/filelist

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/4hyhauhsdy76vtegnzzildstw5hc5gdugmeurrsvi2cwbwiufd%40yqsgq7nl4ox6.


Re: building python package

2023-12-14 Thread Alexis
Hi,

CMake is quite explicit about which python it has found:

-- Found Python: /home/sergiu/miniconda3/envs/invest_01/bin/python3.9

This does not match with the 3.8 that is in your environment.

In order to build Ledger Python correctly the Python found by CMake
must match the Python that boost was compiled with (typically system
Python). I'd try to avoid using venv or conda and stick with the system
Python.

I've been working on and off on adding support to make Ledger
installable via pip (see https://github.com/ledger/ledger/pull/2246)
but it may be a while until that is finished completely.


Hope this helps :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/6pi2yv4hhaqnwo52pfj6frzblwf3232izwzkmmkhhbv4svholv%40sloseahq5l2p.


Re: building python package

2023-12-14 Thread Alexis
Hi,

It seems that in the environment in which you are trying to build
ledger has Python version 3.9 installed (maybe a venv?), but
the Boost library (version 1.71) provides bindings for Python 3.8.

Did you run `./acprep dependencies`?
What Linux distro and version are you on?
Are you running a venv (or something similar)?


Cheers
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/lzm2nxteujoscxigxmeg2jquvknmm6zobmvinrzzv6b4aukeev%404wblc5iwi25r.


Ledger turns 20 today!

2023-09-29 Thread Alexis
Hi all,

according to the commit history on GitHub¹ ledger turns 20 today!
And ledger has come a long way since its initial revision.

Thank you, John, for writing ledger and thank you everyone else who
has contributed over the years to or is using it!!


Here's to 20 more
Alexis

¹ 
https://github.com/ledger/ledger/commit/e95ea133d0953953ba74f4e5c6163706194971cb

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/q6ugjkdg2bqeouztzn6ncnryctjei7ykp7qfwqdxv7v7iv44yx%40qqv5mv7kqdir.


Re: Printing to stdout

2023-06-11 Thread Alexis
Thanks John for providing support and thanks for raising this issue Bob.
Looking at the code there are few questions that arise for me:

* Should ledger really be looking for and use less if PAGER is unset?
  Isn't the absence of PAGER and indicator that the user prefers their
  output straight to the terminal?

* When looking for less shouldn't ledger search all directories in PATH
  instead of hard-coded locations?
  If yes, does anyone know of a UNIX PATH searching function readily
  available, e.g. in the Boost Filesystem  Library¹ before a custom
  one is added?

* Where and how is LEDGER_PAGER used in the source code?
  A quick grep for LEDGER_PAGER did not 

  Is there some generic code that allows any ledger command-line option
  to be used as an upper-cased and LEDGER_-prefix environment variable?
  If yes, where is it implemented?
  
* How could this be tested along with other unit tests, so that
  once a desired behaviour is defined its implementation is tested.


Alexis

¹ https://www.boost.org/doc/libs/1_82_0/libs/filesystem/doc/index.htm

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/fqhkfu4f5mo4x3zven7u4zjnizlxbkf3pba25hihlimkaclsle%40istn5dx5viwl.


Re: Reducing repetition/duplication of amount value in entries

2023-06-08 Thread Alexis
Hello Viraj,

I know of two options to reduce the duplication of the amount value:

1. Using transaction typed metadata

  2023/06/06 McDonalds
  ; amount_spent:: $23.98
  Expenses:Food:Restaurants(tag("amount_spent"))
  Liabilities:Apple Card  (-tag("amount_spent"))
  Income:Credit Card Rewards (-(tag("amount_spent")) * 0.02)
  Assets:Apple Cash

  See https://ledger-cli.org/doc/ledger3.html#Typed-metadata


2. Using a define 

  define spent_amount=$23.98
  2023/06/06 McDonalds
  Expenses:Food:Restaurants   (spent_amount)
  Liabilities:Apple Card (-spent_amount)
  Income:Credit Card Rewards(-(spent_amount) * 0.02)
  Assets:Apple Cash

  See https://ledger-cli.org/doc/ledger3.html#index-define


Hope this helps,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/ty4szlg6plx7c4ty4ixuf6gohf4hyx4yjqnpct4xeetpkj5rcs%40fgfvyi2zrlm5.


Re: Docs site unreadable in dark theme

2023-04-30 Thread Alexis
On Sun, Apr 30, 2023 at 02:59:53AM +0700, Yuri Khan wrote:
> Works now, thanks!

Thanks for confirming, Yuri Khan, much appreciated.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/p5wrakh7aop7t5w5jpim5dxirsgiwrhhxlabi4e4gtbpz4f53b%40pyx4lmnwhiqt.


Re: Docs site unreadable in dark theme

2023-04-29 Thread Alexis
Hello Yuri Khan,

thank you for reporting the issue. This has now been fixed.
Please be sure invalidate any cached CSS before reloading the page.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/ea3jrdjmq3y7bjugp6pl7tbl54rkadfcs33mrjtzdj7pvgsabw%40tkpzqyw2c43p.


Re: Requesting feedback from users of Ledger's Python API

2023-04-20 Thread Alexis
Hello all,

those who feel comfortable with installing Python packages from
source and installing Ledger's dependencies are invited to help
test the very first draft Pull Request¹ that allows the Ledger
Python package to be install via pip² (or other installation
methods supporting pyproject.toml³).

With Ledger's main dependencies installed (boost, boost-python, gmp,
mpfr, and gpgme) you can run the following (ideally from a Python 
virtual environment) to install the Ledger Python package:

  % /usr/bin/env CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu) \
pip install --verbose --no-dependencies \
git+https://github.com/afh/ledger.git@pypi

to test run:

  % python ${PATH_TO}/ledger.git/python/demo.py

Head over to https://github.com/ledger/ledger/pull/2246 for
further the details and leave feedback and comments on the PR.

If you are interested in helping shape the future of Ledger
Python package API now is the time to chime in.


Best
Alexis

¹ https://github.com/ledger/ledger/pull/2246
² https://pypi.org/project/pip
³ https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230420220710.lj5i37y32rxbbc5y%40kei.local.


[ANNOUNCE] ledger API documentation available online

2023-04-11 Thread Alexis
Hello all,

ledger's API documentation is now available at:

  https://ledger-cli.org/doc/api/

The API documentation is generated from ledger's source code using
doxygen. It features a custom navigation header you all know
and love from ledger-cli.org, support for dark mode, SVG based
dependency graphs, and more.
The API documentation is updated as needed, at the very least with
every ledger release.

Note that improving the documentation is an ongoing effort, if you have
experience with technical documentation or doxygen or C++ or all of
the aforementioned you are welcome to contribute. As stated on the API
documentation main page:
"In case you find [the API] documentation incorrect, incomplete, unclear,
or lacking please open a pull request 
[https://git.ledger-cli.org/ledger/pulls].;


Enjoy
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230411195709.6d7h5xcry7fbgm72%40kei.local.


Re: The documentation link on the website is broken.

2023-03-24 Thread Alexis
Hi all,

the need arose to migrate the website from AWS to GitHub Pages.
Unfortunately this migration took longer than expected and some folks
have noticed and reported broken links.
The migration has now been completed and the website should function
as expected.

Please allow for a 24-48 hour grace period for changes to the DNS
to fully propagate, i.e. before the git, wiki, and list subdomains
will redirect to the appropriate content.

If you come across an issue with the website please report it at
https://github.com/ledger/ledger.github.io/issues/new/choose
or contribute by creating a pull request.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/w755mmishutjg4ing54ebkcpl5oz74jrdx6lwomf3a2zyoqurk%40lz6fcqyzvgbz.


Re: Updating Ledger's dependencies regularly

2023-03-23 Thread Alexis
Thanks for your input on this John, much appreciated.

To move this conversation forward more specifically I went
ahead and created PR #¹ that bumps the versions of
ledger's major dependencies to a reasonable version that
is about 4 years old.


Alexis

¹ https://github.com/ledger/ledger/pull/

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230323140727.merhtrzjsrxpshdp%40kei.local.


Re: Requesting feedback from users of Ledger's Python API

2023-03-02 Thread Alexis
Hello Ryan,

On Mon, Feb 27, 2023 at 01:29:46PM -0600, Ryan Nowakowski wrote:
> On Mon, Feb 27, 2023 at 05:11:46PM +0100, Alexis wrote:
> > > Alternatively and perhaps more interesting, you could create a separate
> > > python package on PyPI that depends on ledger.  That would allow you to
> > > iterate more quickly than the current pace of ledger releases.
> > 
> > Interesting idea, thanks for the suggestions. I'll look into what is
> > needed to make it happen. Though I do like Ledger's Python API to be
> > so close to the native code. I need to dabble around with it to get
> > a better understanding of the pros and cons.
> 
> Let me know if you need someone to bounce ideas off of.

Thanks for the offer, Ryan, much appreciated. I have a personal project
that I could use to get a feel for backwards compatible Ledger Python
API changes and also get acquainted with the process of creating
and maintaining a Python Package dependent on Ledger's Python Package
/ Module.

> The gist below pretty much covers it.

Great, I'll have a closer look.

> In priority order:
> 
> 1. Comprehensive API documentation
> 2. A Quickstart guide

Ideally comprehensive API would be generated from code. Do you happen
to have any knowledge or experience with that?

In your mind is demo.py¹ a good starting point for a quickstart guide
that mainly needs some prose for explanation?
If not, is there an example of a good and helpful quickstart guide
that you've come across and could share?


Best
Alexis

¹ https://github.com/ledger/ledger/blob/master/python/demo.py

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230302083448.aayhcxpywb6nmdyp%40kei.local.


Re: Requesting feedback from users of Ledger's Python API

2023-02-27 Thread Alexis
Hello Ryan,

thank you for your detailed response, it is very helpful and
much appreciated.

> Is there a way to add the package but retain backward compatibility?

Yes, there is a way to add the package and retain backward compatibility.
I disliked the way I initially thought of, though, fortunately your
question made me think about it some more and I may have another idea,
that is backward compatible and offers a clean API.

> Alternatively and perhaps more interesting, you could create a separate
> python package on PyPI that depends on ledger.  That would allow you to
> iterate more quickly than the current pace of ledger releases.

Interesting idea, thanks for the suggestions. I'll look into what is
needed to make it happen. Though I do like Ledger's Python API to be
so close to the native code. I need to dabble around with it to get
a better understanding of the pros and cons.

> I use it as an import in scripts and ad-hoc in ipython.

Anything you'd be willing to share?

> I use it as a parser[1] to then be able to automatically edit my journal
> via Python.  I also use that same parser to import my ledger into some
> Django models for easy editing via the web.
> 
> [1] https://gist.github.com/tubaman/0e80cec388d3d5d61e3f300e2477a9ae

Interesting. With only a rough look at the code are you aware of
Ledger's Data File Parsing Information¹?

> Documentation is pretty sparse.  Most of my use comes from exploring the
> API in ipython.

What would you find most helpful?
A technical documentation? A tutorial? Something else?

> The one I filed a couple of weeks ago ;)

I assume you mean #2169.² I'll have another look.


Best
Alexis

¹ https://www.ledger-cli.org/3.0/doc/ledger3.html#Data-File-Parsing-Information
² https://github.com/ledger/ledger/issues/2169

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230227161146.jtvki66q5bgtwixn%40kei.local.


Re: Requesting feedback from users of Ledger's Python API

2023-02-14 Thread Alexis
Hello Dan,

thank you for your reply.

At this point I'm too invested in Ledger's Python API with all the
scripts and the setup that I have and I'm unwilling to switch any
time soon, if ever :)

As a developer/Ledger contributor I'm interested in learning about
use-cases that folks have for a Python API.

Is there anything specific that you'd be willing to share in greater
detail? Any scripts, reports, or workflows would be interesting.


Thanks
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230214180729.sdw2loxdcczjnulg%40kei.local.


Requesting feedback from users of Ledger's Python API

2023-02-14 Thread Alexis
Hello all,

I've been using Ledger's Python API extensively for many years now
and have worked around some of its quirks and limitations in odd ways.

In my mind Ledger's Python API (and Ledger itself) has a lot of
unused potential.

I believe one next step towards unlocking that potential is converting
Ledger's Python module to a Python package.

"What's the difference?" someone might ask.

A Python module is a single shared library compiled from Ledger's
C++ code that can be used by Python. The bridging from C++ to Python
code (and vice versa) is done via Boost.Python¹.

A Python package on the other hand is a bundle of Python modules and
pure Python files which in combination offer a richer and more
versatile API.
A Python package allows to extend the functionality of C++ native types
by adding new functions to them or provide entirely new classes written
only in Python. This would allow for easier exploration for
new features. And if a new feature proves useful but is slow in Python
it would likely be less tedious to port it to C++ than develop it in
C++ from the beginning.

The PR #2196² is a draft that introduces Ledger Python package.

While the PR breaks existing scripts the fix is as simple as changing
`import ledger` to `import ledger.core as ledger`.

I kindly ask people relying on or using Ledger's Python API to provide
feedback on how the Ledger Python is used.

  How do you invoke Ledger Python?
  (ledger python, python script, in-line journal python, other)

  Which parts of the Ledger API do you use most?
  (Examples would be helpful)

  What features are missing from Ledger Python?

  Which existing Ledger Python bugs are limiting?

Getting answers to these questions would help drive development
in a direction that is most useful for API users.


Best
Alexis

¹ https://www.boost.org/doc/libs/1_81_0/libs/python/doc/html/index.html
² https://github.com/ledger/ledger/pull/2196

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230214104819.r7rd6fpg7fguubo5%40kei.local.


Updating Ledger's dependencies regularly

2023-02-14 Thread Alexis
Hello all,

occasionally there are build issues¹ with third-party dependencies.
Some of these can be attested to the fact that Ledger has infrequently
updated the minimum required version of its dependencies.

According to the README Ledger specifies the following version
requirements for its dependencies (I took the liberty to add columns
for age, release date, latest version, and latest release date
for comparison):


Required| Version  |  | Release  || Latest  | Release 
Dependency  | (or greater) |  Age | Date || Version | Date
|--|--|- || |-
[CMake] | 3.0.0|  4 years | Dec 2018 || 3.5.2   | Jan 2023
[Boost] | 1.49 | 11 years | Feb 2012 || 1.81.0  | Dec 2022
[GMP]   | 4.2.2| 16 years | Sep 2007 || 6.2.1   | Nov 2020
[MPFR]  | 2.4.0| 14 years | Jan 2009 || 4.2.0   | Jan 2023
[utfcpp]| 2.3.4|  8 years | Sep 2015 || 3.2.3   | Dec 2022


Optional| Version  |  | Release  || Latest  | Release  
Dependency  | (or greater) |  Age | Date || Version | Date 
|--|--|--||-|--
[Python]| 3.9  | ~3 years | Oct 2020 || 3.11| Oct 2022 
[gettext]   | 0.17 | 16 years | Nov 2007 || | Jul 2020 
[libedit]   | 20090111-3.0 | 14 years | Sep 2009 || 20221030-3.1. | Oct 2022
[doxygen]   | 1.5.7.1  |>13 years | Unknown  || 1.9.6   | Dec 2022 
[graphviz]  | 2.20.3   | >2 years | Unknown  || 7.1.0   | Jan 2023 
[texinfo]   | 4.13 | 15 years | Sep 2008 || 7.0.2   | Jan 2023 
[lcov]  | 1.6  |  ? years | Uknown   || 1.16| Jun 2022 
[sloccount] | 2.26 |  ? years | Uknown   || Same| Same


I believe there is value in deciding how old the minimum required
version for a dependency should be, so that dependencies can be updated
regularly and code handling compatibility for outdated dependencies
is removed and does not accumulate over time.

This allows to gradually adapt to dependencies deprecating API
rather than last minute when breaking change is (about to be) introduced
by one of Ledger's dependencies.

A conservative approach—possibly maintaining overly high backwards
compatibility—could be to decide that once a year Ledger's dependencies
are updated to the latest version of each dependency that is 4 years old.

A more progressive approach—likely to still maintain a high backwards
compatibility—is to update each dependency to the latest version that
is 2 years old

My very first take on this is #2194² which changes CMake's minimum
required version to 3.12.0 (released over 4 years ago in Nov 2018).

If the more progressive approach would be taken for the #2194 PR
CMake could be upgraded to version 3.19.
This would break support for Debian stable³ as it offers version
3.18, hence it seems CMake 3.18 is a better option as it is a
good compromise between recency and backwards compatibility.

I'd love to hear your thoughts, especially if you contribute to
Ledger or maintain a distribution port.


Best
Alexis

¹ https://github.com/ledger/ledger/issues?q=is%3Aissue+boost+is%3Aclosed
² https://github.com/ledger/ledger/pull/2194
³ https://packages.debian.org/bullseye/cmake)


Release Pages:
CMakehttps://github.com/Kitware/CMake/releases/
Boosthttps://sourceforge.net/projects/boost/files/boost-binaries/
GMP  https://gmplib.org/download/gmp/
MPFR https://www.mpfr.org/history.html
utfcpp   https://github.com/nemtrif/utfcpp/releases

Python   https://www.python.org/downloads/
gettext  https://ftp.gnu.org/pub/gnu/gettext
doxygen  https://github.com/doxygen/doxygen/releases
 https://sourceforge.net/projects/doxygen/files/
graphviz https://www.graphviz.org/download/source/
lcov https://github.com/linux-test-project/lcov.git
libedit  https://thrysoee.dk/editline/
Texinfo  https://ftp.gnu.org/gnu/texinfo/

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230214100228.qmi4nrtqrglnlzsj%40kei.local.


Re: [ANNOUNCE] ledger 3.3.0

2023-02-08 Thread Alexis
Thank you Martin for driving this release!
It's been long overdue, so great to see all these fixes
and improvements finally being officially released.

Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230208152330.qo7p2p26ofp7onau%40kei.local.


Re: Planning new ledger release

2023-01-20 Thread Alexis
On Fri, Jan 20, 2023 at 12:19:28PM +0800, Martin Michlmayr wrote:
> I've been saying for months that we need a new release of ledger.
> There have been a lot of fixes in the last ~2 years.

Fully agree!

> If anyone has pending fixes or contributions, please open PRs now.

Let's also add any pending fixes that should be considered for
the next release to the 3.3 milestone
(https://github.com/ledger/ledger/milestone/4).

And can the 3.3.x milestone
(https://github.com/ledger/ledger/milestone/6) be merged with the
3.3 one?

> I intend to make a new release of ledger soon.  Ideally this month.
> Your help is appreciated!

Crunch time :)


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20230120151056.3iwifcbh472r3b6f%40kei.local.


Re: Virtual postings from python

2022-12-27 Thread Alexis
Thanks for reaching out, Ryan,

at first glance this seems to be a valid issue as
`post.xdata().has_flags(ledger.POST_MUST_BALANCE)` returns `False`
when `post.must_balance()` returns `True`.
Using `post.must_balance()` might be a viable interim solution.

Unfortunately there is no `is_virtual()` function on the `Posting`
type and the exposed `has_flags` fails with the following error for me:

```
did not match C++ signature:
has_flags(supports_flags {lvalue}, unsigned 
char)
```

It would be greatly appreciated if you could file a bug against
ledger for this.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20221227161300.zzlpikezcig3qp66%40kei.local.


Re: Floating point exception on future entry

2018-01-27 Thread Alexis
Hello John Wiegley on Tuesday, 2018-01-23 at 15:17:08-0800, you wrote:
> Is anyone willing to help me set this up?

Of course, I welcome the change. How do we best move forward with this?


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python module

2016-11-11 Thread Alexis
Hello Paulo,

when ledger is compiled with Python support (add -DUSE_PYTHON=ON when
running cmake) a binary Python module (ledger.so on unix systems) is
created.

When you place this file somewhere, so it is found by the Python runtime
(e.g. with PYTHONPATH) you can `import ledger`.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger Hackathon next month?

2016-11-08 Thread Alexis
Hello Manuel Amador (Rudd-O) on Saturday, 2016-11-05 at 04:08:48+, you 
wrote:
> As you get there, make sure to eat at:
> 
> * Little Sheep hot pot
> * Oola
> * Prospect
> * Nabe

Thank for the recommendations I'll check the out.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ledger Hackathon Nov 12-13 [was: Ledger Hackathon next month?]

2016-11-08 Thread Alexis
Hi everyone,

great news: the location was confirmed, which means we can meet up in
the heart of San Francisco!

Please register if you'd like to participate in the first official
Ledger Hackathon / Plain Text Accounting Conference on Nov 12th-13:
https://docs.google.com/forms/d/e/1FAIpQLScf9ezBpe1sBcrNoZVu6VPKovYMmFKsY2WZMT5RtOMrmfPSpw/viewform

Organisational details will follow via email shortly after registration.


So excited!
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger Hackathon next month?

2016-11-04 Thread Alexis
Hello everyone,

the prospect of getting together for a weekend is a dream come true.

Keep your fingers crossed! I may have a location in San Francisco's
financial district; need to verify beginning of next week on site.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger Hackathon next month?

2016-10-31 Thread Alexis
Hello everyone,

great to see that there's interest in a Ledger Hackathon!

I'll be in San Francisco from the November 7th until December 2nd
and it would be wonderful if we find a date within that timeframe.

Some responded that their C++, Boost, or Python experience is a bit
rusty; that's perfectly fine. The people more familiar with the
technologies can possibly give a jump-start and there are also other
areas that would benefit greatly from a bit of attention and work.
>From the top of my head:
  * Testing
  * Documentation
  * Build System


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ledger Logo

2016-08-27 Thread Alexis
Hello all,

I've proposed Ledger for an offer for a free logo here:
https://news.ycombinator.com/item?id=12372374

please vote for Ledger if you think the project could make good
use of a professionally designed logo for free!


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Moving ledger-mode out of the main ledger repository

2016-08-04 Thread Alexis
Hi John,

can you include the doc/ledger-mode.texi file in the ledger-mode repo
also? I think it makes sense to move the documentation to the sources.


Cheers
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Moving ledger-mode out of the main ledger repository

2016-08-02 Thread Alexis
Much in favor of this :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Time for 3.1.2 release?

2016-08-01 Thread Alexis
Hello everyone,

I pushed the latest changes from next to the release/3.1.2 branch
and kindly ask that anyone willing to spend some time and effort
test those changes and report any issues.

Hopefully there are no (or only minor) issues.  If you think a
currently outstanding pull request should make it into this release
please speak up and help integrate it.

To test ledger please:
  * build the release/3.1.2 branch
  * run the tests (make test)
  * do your own test with your personal workflow
  * report success or any issues to this mailing list,
be sure to include the operating system
boost version, and build output

I'm planning to publish the release in a week from now:

  Monday, 8th of August 2016,

giving those who want to participate in testing roughly a week
to review the latest changes.


Thanks
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Time for 3.1.2 release?

2016-08-01 Thread Alexis
Hi Martin,

Sure, already on it.


Best
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger and Cygwin (again)

2016-06-23 Thread Alexis
Hell Josh,

currently all tests pass on Travis CI¹,
and any change should not break them.

Please run the tests verbosely, for example using:
  % ctest --output-on-failure

This hopefully gives a hint on which causes the regression.
Please post your findings to the list and add them to Bug 1166.


Best
Alexis

¹ https://travis-ci.org/ledger/ledger

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new portal site for ledger-likes; content, naming

2016-02-09 Thread Alexis
Hello everyone,
how about we start a fundraiser and acquire ledger.org?

And how about having different related projects as subdomains?

  beancount.ledger.org
  h.ledger.org
  doc.ledger.org
  hub.ledger.org


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't compile ledger on Linux Slackware

2016-02-08 Thread Alexis
Hi,
ledger should build just fine with boost 1.54.0.
The continuous integration has been using 1.58.0 for quite some
time and was recently updated to use 1.60.0.

Can you find the range_fwd.hpp file on your system? My first guess is
that additional boost packages need to be installed.


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting Started With Ledger - a free (upcoming) introductory book on Ledger

2016-01-26 Thread Alexis
Hello Rolf,
I'll gladly help reviewing the book and would be interested in a copy too.

Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Call For Testing: Ledger Python 3 Support

2016-01-26 Thread Alexis
Hi everyone,
I managed to finalize support for Python 3
(standing on the shoulder of giants here)
and I could use some help with testing the changes.

The Work-In-Progress code can be found here:
  https://github.com/afh/ledger/tree/wip/python3

Currently there are 5 unit tests failing:
   BaselineTest_dir-import_py (Failed)
   BaselineTest_dir-python_py (Failed)
   BaselineTest_feat-import_py (Failed)
   BaselineTest_feat-option_py (Failed)
   BaselineTest_feat-value_py (Failed)

One major change is replacing the ledger module (ledger.so)
with a ledger package¹ (see below), which includes aforementioned
ledger module yet allows extending ledger through python more easily.

Another major change is the clean-up of the CMake infrastructure
(>= 2.8.8 is required now), to improve the maintainability.

To build ledger with python3 support² run:
% mkdir build_py3
% (cd build_py3; \
  cmake \
  -DBUILD_DEBUG=ON \
  -DBUILD_DOCS=ON \
  -DBUILD_WEB_DOCS=ON \
  -DUSE_PYTHON=ON \
  -DPython_ADDITIONAL_VERSIONS=3.5 \
  -DPYTHON_INCLUDE_DIR=$PATH_TO_PYTHON_INCLUDE_DIR \
  )
% make -Cbuild_py3
% make -Cbuild_py3 doc
% make -Cbuild_py3 install

Should this fail due to required software not being found add the
following options to the cmake command and replace the $PATH_TO_...
variable with the absolute path to the directory where the required
software can be found on your system:

  -DGmp_ROOT_DIR=$PATH_TO_GMP_ROOT
  -DMpfr_ROOT_DIR=$PATH_TO_MPFR_ROOT
  -DIcu_ROOT_DIR=$PATH_TO_ICU_ROOT
  -DLibintl_ROOT_DIR=$PATH_TO_GETTEXT_ROOT
  -DBOOST_ROOT=$PATH_TO_BOOST_ROOT

To test please run the unit tests:

% (cd build_py3; ctest --output-on-failure)

and the (inofficial) python test suite:

% ./build_py3/ledger python python/demo.py
% PYTHONPATH=$PATH_TO_PYTHON_SITE_PACKAGES python3 python/demo.py

In addition to that I'm keen on seeing any other ledger python related
code that you use for testing or yourself and are willing to share.

I would also like to open a dialog about how to best handle the ledger
python API. Currently `>>> import ledger` loads the ledger module
(ledger.so) into python.

When using packages it makes sense to put the ledger module in
ledger.core (or something similar), which breaks compatibility with
existing scripts.

I've written the __init__.py files in a way that `import ledger` works
in both scenarios (using ledger python and python3 directly), but from
a python API standpoint a different approach might make more sense:
Keep the python namespace clean by requiring users to think about
which aspects from the ledger python API they want, e.g.
import python vs from ledger.core import *

When invoking `% ledger python` only the core ledger module is available
not the extensions that the package may provide in the future (unless
PYTHONPATH is set accordingly).
This is because when using `% ledger python` the ledger command
registers ledger as a built-in python module (provided by its own
binary) with the python runtime.

Without PYTHONPATH set accordingly only the core ledger module is known
to python, with PYTHONPATH set the python runtime can find
and load the ledger package just fine.

I hope you can still follow my train of thought ;) and I look forward to
your feedback!


Happy testing,
Alexis

¹ https://docs.python.org/2/tutorial/modules.html#packages
² You have to choose between Python 2 or Python 3 when configuring
  your build.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Interesting(?) segfault in ledger-cli with 7 bytes input

2016-01-21 Thread Alexis
Hi Markus,
thanks for the report. I've written a test that reproduces
the misbehaviour you mentioned. I've also found a possible fix, and
only need to find a way on how to test the good case.

I'll let you know as soon as I have a topic branch for you to review.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upcoming Ledger Release

2016-01-11 Thread Alexis
Hello Martin,
thank you for your test report and opinion on the versioning.

I'm glad to hear that all of the official and your personal test pass.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upcoming Ledger Release

2016-01-11 Thread Alexis
Hi John,
  
apologies if my mail came across the wrong way. It was written with 
  
the notion that I myself could do more to help improve ledger and   
  
move it forward.
  

  
I'm keeping an eye on ledger's build compatibility on Mac using 
  
Homebrew, which is fairly quick with the latest Boost versions. 
  

  
Also every build of the master branch on Travis CI will use 
  
the required minimum Boost version, i.e. 1.49.0,
  
all other non-master builds will use the latest 
  
Boost version configured in .travis.yml, currently 1.60.0.  
  

  
So there is a little automated help for testing the ledger build
  
against different versions of boost.
  

  
Off-topic question: Did you attend http://conf.nixos.org ?  
  
Too bad I missed it…
  

  

  
Cheers, 
  
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upcoming Ledger Release

2016-01-11 Thread Alexis
Hello Juergen,
thanks for the report and taking the time to test the latest changes.

The boost build warnings you mentioned (and that I see also)
are a boost issue (see https://github.com/boostorg/iostreams/pull/24).


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Upcoming Ledger Release

2016-01-02 Thread Alexis
Hello everyone,
a while ago I wanted to publish a new ledger release, but didn't
(and I'd rather not have you asking why ;)

Ledger's bitrot is becoming more and more of a problem (especially with
newer boost versions, namely 1.58, 1.59, and 1.60)
so I think a new release is quite necessary.

I pushed the latest changes to the next and the release/3.1.1 branch
and kindly ask that anyone willing to spend some time and effort
test those changes and report any issues.

Hopefully there are no (or only minor) issues.

To test ledger please:
  * build the release/3.1.1 branch
  * run the tests (make test)
  * do your own test with your personal workflow
  * report success or any issues to this mailing list,
be sure to include the operating system,
boost version, and build output

I'm setting a fixed release date: Monday, 11th of January 2016,
and will release on this day unless there are major blocking issues.
This gives those you want to participate roughly a week to test the
latest changes.

Some folks wanted the next release to be numbered 3.2.0 instead of
3.1.1, and I'd like the community to decide. If you have an opinion
on the matter please reply to this email and make your mark.

  The next ledger release should be numbered:

[ ] 3.1.1
[ ] 3.2.0


Thanks,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [howto] Automatic transaction that convert currency

2015-12-02 Thread Alexis
Hi Chris,
what is your motivation behind the conversion?

When dealing with multiple currencies I keep the currency
of the transaction (e.g. CHF) in my books and do the conversion
I need (e.g. EUR for tax reports) in my reports using the
--exchange option¹⁾²⁾.


Alexis

¹⁾ 
http://ledger-cli.org/3.0/doc/ledger3.html#index-_002d_002dexchange-COMMODITY-2
²⁾ http://ledger-cli.org/3.0/doc/ledger3.html#Commodity-reporting

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [HOWTO] Register of virtual accounts related to a main account?

2015-11-23 Thread Alexis
Hello François,
from my understanding Ledger has more of a filter than a query language,
and I'm uncertain how one do with ledger what you want to do.

Surely one could script it using the Ledger Python API, but with only
commandline options, I don't know.

Can someone else shed some light on the issue?


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: register - How to display transactions' persistent notes?

2015-11-23 Thread Alexis
Hello Kuba,
you can use the --payee option and have it display the transaction note.

% ledger reg --payee note
13.11.2015 chicken soup Assets:Checking USD -15 USD -15
13.11.2015 chicken soup Expenses:FoodUSD 15   0


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [HOWTO] Register of virtual accounts related to a main account?

2015-11-22 Thread Alexis
Hello François,
using the --limit virtual or --display virtual option should give
you the reports you want.

Search for --limit and --display in the "Commands & Options Index"
sectionš of the manual to find references for explanations and
examples of how they work.

The main difference being that --limit affects the running total being
shown, whereas --display doesn't.


Cheers,
Alexis

š http://ledger-cli.org/3.0/doc/ledger3.html#Commands-_0026-Options-Index

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger 3.1.1 release candidate

2015-10-27 Thread Alexis
Hi Bruce,
> It looks to me like that 'if not line' test is invalid... consider
> read_test() is called from a loop inside run_tests(). Eventually it hits
> the end of the file and the readline() test fails. That has no bearing on
> whether the test case is passing or failing.

You are right the test did not make much sense.


> What if you try the verbose output for one of the tests as above?

Then I also see the warnings, thanks for pointing this out.

I've pushed a fix for this issue to the next branch.
The test/RegressTests.py scripts now checks the test filesize
and properly fails if it is empty.

Let me know if this works for you.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can I filter by Transaction, instead of Posting?

2015-09-23 Thread Alexis
Hello Michael,
I find the Ledger Python module quite handy for custom needs
such as exports or reports.

Can you show me an example of your Python attempt and describe
what you were missing from it or what didn't work for you?


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger 3.1.1 release candidate

2015-09-21 Thread Alexis
Hello Sharon,
I'm uncertain about what is going on.

The commit you mentioned:
> v3.1-464-gfd6fabb

I cannot find it within the ledger repository.
Could it be that there are changes local to your repository?

> Seeing the link you gave I can see immediately why it failed, I don't
> have anything labelled as a "liability"! I have one credit card with no
> debts on it, and no payments being made to it, hence no liabilities.

Maybe running the following command sheds some light onto the issue:
% git log  git log test/baseline/feat-fixated-prices.test

In the meantime I'll try to reproduce the issue
with a virtualized Debian 8 on my side.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger 3.1.1 release candidate

2015-09-21 Thread Alexis
Hello Sharon,
just a quick update from my side.

I ran the tests on a Debian 8 in a VirtualBox on my workstation.
All tests passed except one DocTests (namely 82150D9) and I
assume it failed due to an encoding error.

The tests uses the Euro-Sign ('€'), yet I had set LC_ALL to C,
in order to work around another issue in Boost facets.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger 3.1.1 release candidate

2015-09-20 Thread Alexis
Hello Bruce,
> Here's the output for all of the failing tests. Not sure what's going on
> with the "WARNING: Empty testfile detected" errors.

I've added the code below to test/RegressTests.py a little while ago:
  line = self.fd.readline() # self.fd is a file object created with open()
  if not line:
print >>sys.stderr, "WARNING: Empty testfile detected: %s" % (self.filename)
return False

I thought it would only fail for testfiles that are empty,
as it seems that is not the case.

I wonder what readline() returns that the `if not line:` test succeeds,
even though the file isn't empty.

In a previous message you mentioned Python 2.7.10 is used on Cygwin,
I use the same version on Mac OS X 10.11 El Capitan, yet I do not see
the issues.

Maybe you could rerun the tests with the following slight modification
of test/RegressTests.py to aid in debugging:
  line = self.fd.readline() # self.fd is a file object created with open()
  if not line:
print >>sys.stderr, "WARNING: Empty testfile detected: %s »%s«" % 
(self.filename, line)
return False

And just to be safe please provide the SHA256 sums of those files, e.g.:
% $SHELL --version
zsh 5.0.8 (x86_64-apple-darwin15.0)
% for t in 
test/baseline/{cmd-price{s,db},feat-fixated-prices,opt-{datetime-format,gain,historical,market,price,revalued,time-report}}.test;
 do \
  echo -n "$t: "; openssl dgst -sha256 < $t; \
done | column -t
test/baseline/cmd-prices.test:   
dbee77184f7355ba172a672bd6ed21ffd3dfdc995508fdcfea8d7c61f13b4ff7
test/baseline/cmd-pricedb.test:  
e6e8ca3e914ae90ca34b9f4ca32075af456b2526a41a7882bb6cf5bc11d9b45c
test/baseline/feat-fixated-prices.test:  
0d7040bd96d527345c890b3844382893afecece997957291de2208c053c56fd5
test/baseline/opt-datetime-format.test:  
2acaef081ad742ae1ad05544e08ad863ed539599d717e5195ef15c9beebae3b3
test/baseline/opt-gain.test: 
36b11c393ee915cedcbf7c9d6eafdbce3c22c30e0cc68f0e4810926ebfec4155
test/baseline/opt-historical.test:   
6a408b24917e409fdf18745f708eaa7e94b3ed95700cc9e98ae9c0194b7823bf
test/baseline/opt-market.test:   
110ce3bf772460149b4832090b630fc71df55bdd54ef1fa38daf76ed1f6cb6c1
test/baseline/opt-price.test:
0dad7401c8e28bf9a604c5f2cab52a4ed9c4ea61827a519649b3979c0ddaf8f0
test/baseline/opt-revalued.test: 
e8792ae0bc1b47e4d2d76851a122944be7d89eb65a2be0493b227be1c4337d72
test/baseline/opt-time-report.test:  
87582cbb559735558bc9041ab53517d4f8e187bafa550fe41843bdd0935cbbcd

>  - the sort order for pricedb is different (I tried changing the input
> order, but the output came out in a different order again)

I've seen this happen in Travis CI too.
Who has an idea what might be happening here?

>  - the time report output has an extra line with a single *

That's odd. If timelog entries are cleared, using a capital oh ('O')
for the check-out time,they are marked with an asterisk ('*') in the output.
But none of the entries in the opt-datetime-format.test are cleared.

Basically the --time-report option is just an alias for the
--balance-format option with a pre-defined format string.
The code can be found in src/report.h:973 (ff).

I'm doing some experiments to get a better idea what might be going wrong.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger 3.1.1 release candidate

2015-09-19 Thread Alexis
Hello Sharon,
thank you for you report.

> Built and 'sudo make install' and tests done on a stock default debian
> jessie and passed all tests except one

What did you exactly build?  The following commands might be helpful:
% git rev-parse --short HEAD
% git describe

> WARNING: Empty testfile detected: 
> /home/boudiccas/git/ledger/test/baseline/feat-fixated-prices.test

That's odd, on my side (git revision 88ad616) the file is 731 bytes
in size and its SHA256 is:
0d7040bd96d527345c890b3844382893afecece997957291de2208c053c56fd5

Here's a link to what it should look like:
https://github.com/ledger/ledger/blob/next/test/baseline/feat-fixated-prices.test


Best,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python bindings with macports

2015-09-19 Thread Alexis
Hi Reuben,
looking at the ledger Portfile, ledger is configured with:
configure.cmd   ${worksrcpath}/acprep opt config

By default Python bindings are not enabled, one needs to pass
the --python option to acprep above.

So I assume ledger Python bindings are not available from MacPorts.


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger 3.1.1 release candidate

2015-09-15 Thread Alexis
Hello Bruce,
thank you for the report!

> 92% tests passed, 28 tests failed out of 353

Not too bad, yet there seems to be room improvement :)

> The python support is broken (running ledger python gives a segfault) so
> I'm not surprised by the _py test failures

Which Python version do you use?
Currently only Python 2.x is supported.

Can you provide a stacktrace?
It would be interesting to see what is going on.

> How do I run individual tests to investigate further?

To run individual tests use:
% ctest --output-on-failure -R ${REGEX_FOR_TESTS_TO_RUN_HERE}

To see which tests would be run add the -N flag, e.g.:
% ctest --output-on-failure -R BaselineTest_feat -N
Test project /Volumes/Users/afh/src/ledger/build
  Test #52: BaselineTest_feat-annotations
  Test #53: BaselineTest_feat-balance-assignments
  Test #54: BaselineTest_feat-balance_assert-off
  Test #55: BaselineTest_feat-balance_assert
  Test #56: BaselineTest_feat-balance_assert_split
  Test #57: BaselineTest_feat-check
  Test #58: BaselineTest_feat-convert-with-directives
  Test #59: BaselineTest_feat-fixated-prices
  Test #60: BaselineTest_feat-import_py
  Test #61: BaselineTest_feat-option_py
  Test #62: BaselineTest_feat-value-expr
  Test #63: BaselineTest_feat-value_py

Total Tests: 12


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ledger 3.1.1 release candidate

2015-09-15 Thread Alexis
Hi everyone,
ledger has seen several improvements and lately also some bitrot
(especially with newer boost version, namely 1.58 and 1.59).

So I think a new release is in order.

I pushed the latest changes to the next and the release/3.1.1 branch
and kindly ask that anyone willing to spend some time and effort
test those changes and report any issues.

Hopefully there are no (or only minor) issues and we can publish
ledger 3.1.1 by the end of September.

To test ledger please:
  * build the release/3.1.1 branch
  * run the tests (make test)
  * do your own test with your personal workflow
  * report success or any issues to this mailing list,
be sure to include the operating system,
boost version, and build output


Thanks,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to install 3.1 from source on MacOS?

2015-09-04 Thread Alexis
Hello Richard,
> It *looks* like I'm already on the 'next' branch:
> $ git branch
> * next
> 
> Is that correct?

Yes, it is.

You may find https://try.github.io helpful.
Branches are discussed from challenge 18 onwards:
https://try.github.io/levels/1/challenges/18


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to install 3.1 from source on MacOS?

2015-09-02 Thread Alexis
Hello Richard,
> 1) What are the various branches in the 3.x release that I might reasonably
> want to use, and what are the tradeoffs between them?

master: The current stable branch, which is currently a bit stale
doesn't build with boost >=1.59
It moves slowly

next: The branch where all development happens, may break occasionally,
  but has been rather stable the last months

release/*: The branches used for releases, currently abandoned

I recommend you use next, it would help the community if you find and
report bugs.

> 2) Once I've decided which branch to use, what is the git command to check
> out that branch?

% git checkout -b next origin/next # where next is the branch you decide upon


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to install 3.1 from source on MacOS?

2015-09-01 Thread Alexis
Hello Richard,
acprep is a convenience build script, which basically runs:

% cmake . && make

So that command should compile ledger for you using the dependencies
from MacPorts.

I'm working on improving and documenting the ledger CMake files,
so that using cmake directly and knowing about the various
configuration options will become easier.

Here's a list of options ledger's cmake process understands:
% grep option CMakeLists.txt
option(USE_PYTHON "Build support for the Python scripting bridge" OFF)
option(USE_DOXYGEN "Build reference documentation using Doxygen" OFF)
option(DISABLE_ASSERTS "Build without any internal consistency checks" OFF)
option(BUILD_DEBUG "Build support for runtime debugging" OFF)
option(BUILD_LIBRARY "Build and install Ledger as a library" ON)
option(BUILD_DOCS "Build and install documentation" OFF)
option(BUILD_WEB_DOCS "Build version of documentation suitable for viewing 
online" OFF)
option(BUILD_EMACSLISP "Build and install ledger-mode for Emacs" OFF)

So if you would like to use the ledger's Python module you would need to run:
% cmake -DUSE_PYTHON=ON . && make # I recommend using make -j

Please report back if certain dependencies such as boost, gmp or mpfr
aren't found.


Happy compiling ledger,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python 3 support?

2015-05-26 Thread Alexis
Hello Martin Blais on Sun, May 24, 2015 at 11:39:33PM CEST, you wrote:
 Does Ledger support extension modules with Python v3?

No, not yet.

 Boost.Python apparently does, I wonder if anyone has tried.

Yes, some (including me) have tried and have yet to succeed,
e.g.: https://github.com/mistotebe/ledger/tree/python3


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


More help needed to document ledger options and functions

2015-01-30 Thread Alexis
Hi all,
while documenting some of the Ledger value expression functions
in the manpage and the texinfo manual I've also extended the
CheckManpage.py and CheckTexinfo.py scripts to check for
(un)documented value expression functions.

If you know what any of the following options or value expression
functions below do please document them or reply to this message
with a short informative text to have it documented, thanks!


Cheers,
Alexis


Missing manpage option entries for:
  --auto-match
  --base
  --cache
  --datetime-format
  --exact
  --explicit
  --full-help
  --historical
  --import
  --lots-actual
  --revalued
  --revalued-only
  --revalued-total
  --rich-data
  --sort-all
  --time-report
  --value-expr
  --verify-memory

Missing manpage function entries for:
  amount_expr
  display_amount
  display_total
  format
  format_datetime
  get_at
  is_seq
  justify
  lot_date
  lot_price
  lot_tag
  nail_down
  now
  options
  print
  round
  rounded
  scrub
  should_bold
  strip
  to_amount
  to_balance
  to_boolean
  to_date
  to_datetime
  to_mask
  to_sequence
  today
  top_amount
  total_expr
  truncated
  unround
  unrounded


Missing texinfo option entries for:
  --auto-match
  --base
  --cache
  --datetime-format
  --day-break
  --exact
  --explicit
  --full-help
  --historical
  --import
  --lots-actual
  --revalued
  --revalued-only
  --revalued-total
  --rich-data
  --sort-all
  --time-report
  --value-expr
  --verify-memory

texinfo entry for unknown options:
  --getquote

Missing texinfo function entries for:
  amount_expr
  commodity
  display_amount
  display_total
  format
  format_datetime
  get_at
  is_seq
  join
  lot_date
  lot_price
  lot_tag
  market
  nail_down
  now
  options
  print
  quantity
  round
  rounded
  scrub
  should_bold
  strip
  to_amount
  to_balance
  to_boolean
  to_date
  to_datetime
  to_mask
  to_sequence
  to_string
  today
  top_amount
  total_expr
  truncated
  unround
  unrounded

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Segmentation fault on Travis CI

2015-01-21 Thread Alexis

Hi all,
as some of you have noticed the continuous integration
on Travis CI, when ledger is built with clang, fails.

I've managed to reproduce the misbehaviour on VirtualBox,
but I'm not sure what's going wrong.

Here's a LLDB backtrace:
https://gist.github.com/afh/d740c9d72e2790f8f6d2

Any ideas?


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed to document ledger options

2015-01-21 Thread Alexis
Hi all,
I've refactored the initial test/CheckTests.py script
into smaller test scripts that specifically test one
aspect of the documentation:

  * CheckManpage.py
Checks that the manpage documents all options
available in ledger

  * CheckTexinfo.py
Checks that the texinfo manual documents all options
available in ledger

  * CheckBaselineTests.py
Checks that there is a baseline test for each option
available in ledger

All of these scripts are run from ctest and currently
fail due to missing documentation.

If you know what any of the undocumented options below
do please document them or reply to this message with
a short informative text to have it documented, thanks!


Cheers,
Alexis

Missing manpage entries for:
  --auto-match
  --base
  --cache
  --datetime-format
  --day-break
  --exact
  --explicit
  --full-help
  --historical
  --import
  --lots-actual
  --no-pager
  --permissive
  --revalued
  --revalued-only
  --revalued-total
  --rich-data
  --sort-all
  --time-report
  --value-expr
  --verify-memory

Missing texinfo entries for:
  --auto-match
  --base
  --cache
  --datetime-format
  --day-break
  --exact
  --explicit
  --full-help
  --historical
  --import
  --lots-actual
  --no-pager
  --permissive
  --revalued
  --revalued-only
  --revalued-total
  --rich-data
  --sort-all
  --time-report
  --value-expr
  --verify-memory

texinfo entry for unknown options:
  --getquote

Missing Baseline test for:
  --cleared-format
  --generated
  --no-pager
  --no-rounding
  --permissive
  --value-expr
  --verify-memory

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DocTests failure

2015-01-20 Thread Alexis
Hi Thierry,
ah yes, on the one hand it's convenient to have the data files
for old test stick around for manual testing, on the other hand
this may lead to issues with subsequent test runs.


Glad you resolved the issue,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed to document ledger options

2015-01-16 Thread Alexis
Hi Erik
 Nice work.

Thanks :) I stand on the should of giants.

 Is something like this possible for formatting handlers as well. 

Maybe, I'm not sure yet.
I would like to have every aspect of Ledger (including formatting
handlers) documented and have that documentation tested and validated
by ledger.

 I was trying lately to use the roundto primitive, but could not work out 
 how to use it. Did not find anything in the documentation. Trial and error 
 resulted in a segmentation fault.

Ah a segmentation fault, gotta love those ;)
Please check if the one you found has already been reported to
bugs.ledger-cli.org and report it if it hasn't giving step-by-step
instructions and test data to reproduce the issue.
It would be super helpful.

And can you give an example of what documentation you would've
considered helpful? This could give me a start on how that
documentation may be written, tested and validated.


Best,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to view both number of items and their price in balance report.

2015-01-16 Thread Alexis

Hello Ivanov Dmitry on Wed, Jan 14, 2015 at 09:55:30PM CET, you wrote:
 Is it possible to get the sum of money, spent on that:
 22 GAL $44 Expenses:Gasoline

Yes, that's possible by changing the balance format using the
--balance-format option (see the manual¹ for details), here's an example:

% ledger -f test1.txt \
  --exchange $ \
  --format \
  '%(strip(amount)) %(display_amount) %(ansify_if(account, blue))\n' \
  bal expenses
22 GAL $44 Expenses:Gasoline


Cheers,
Alexis

¹ 
http://ledger-cli.org/3.0/doc/ledger3.html#index-_002d_002dbalance_002dformat-FORMAT_005fSTRING-1

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help needed to document ledger options

2015-01-15 Thread Alexis
Hello everyone,
I have pushed some changes to the next branch that break
the tests. This is because I have integrated the test/CheckTests.py
script into the test suite and it shows areas where ledger can
be improved.

The script checks whether all options know to ledger are documented
in the manpage (doc/ledger.1) and in the manual (doc/ledger3.texi),
and whether there are options documented in those files that aren't
supported by ledger.

Please find below a list of errors reported by test/CheckTests.py,
if you know what (some of) those options do I kindly ask you to
to write a short documentation and issue a pull request on github
or respond to this mail, so we can improve the documentation.

In order to document options in the manpage follow the given
mdoc (7) formatting: .It Fl \-option-to-document

I have commented many undocumented options running the following
command will show you which those are:
% grep '.\.It Fl' doc/ledger.1

To test the options documented in the manual I have expanded
test/CheckTets.py so that it searches for lines with @c option,
e.g.: @item --help @c option

There are also several FIXME's in doc/ledger3.texi, that need,
well fixing ;)

Should you document an option in the manual please add the string
`@c option` to it, so that CheckTests.py can verify it and search
for the option in the whole manual, it may be documented in several
places.


Thanks!
Alexis


Here's the output of:
% python test/CheckTests.py --ledger ${PATH_TO}/ledger --source .

  Missing man page entries for:
--auto-match
--base
--cache
--day-break
--exact
--explicit
--full-help
--help-calc
--help-comm
--help-disp
--import
--lots-actual
--no-pager
--permissive
--revalued
--revalued-only
--revalued-total
--rich-data
--sort-all
--time-report
--value-expr
--verify-memory

  Missing texi entries for:
--auto-match
--base
--cache
--datetime-format
--day-break
--exact
--full-help
--help-calc
--help-comm
--help-disp
--import
--lots-actual
--no-pager
--permissive
--revalued
--revalued-only
--revalued-total
--rich-data
--sort-all
--time-report
--value-expr
--verify-memory

  Texi entry for unknown option:
--getquote

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DocTests failure

2015-01-15 Thread Alexis
Hi Jostein,
 When I run the python test command:
 
 jostein:~/dw/ledger2$ python test/DocTests.py -l ./build/ledger -f 
 doc/ledger3.texi
 EE

Do you have a built ledger binary in ./build/ledger?
If yes, please rerun the command adding the -vv option
  % python test/DocTests.py -l ./build/ledger -f doc/ledger3.texi

If no please give the path to the built ledger binary as an argument
to the -l (--ledger) option:
  % python test/DocTests.py -l ${PATH_TO}/ledger -f doc/ledger3.texi


Thanks,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DocTests failure

2015-01-14 Thread Alexis
Hi,
I just fired up my Debian Wheezy VirtualBox and updated it
to 7.8. I have Python 2.7.3 installed, compiled
the master and next branch from ledger, and ran:
% ctest --output-on-failure -R DocTests
% python test/DocTests.py -l ./build/ledger -f doc/ledger3.texi

Both commands ran successfully. Who else is using Debian Wheezy
and would like to test this potential issue?


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


balance report comparing balance at two dates?

2015-01-12 Thread Alexis H
Hello Martin,
maybe this could also be done using Ledger's Python module.

And have a look at Ledger's select command, it allows sql like queries on
ledger journals, I know too little about it, since I don't use it (yet ;).

Cheers,
Alexis
--
Sent from mobile

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger Releases and Thirdparty Code

2015-01-11 Thread Alexis
Hi John,
 None, great idea, Alexis.

After having slept over the changes I proposed
I'm leaning towards an updated git submodule approach,
see https://github.com/ledger/ledger/pull/366

It would be great if you and/or other people building
Ledger from the git repo could do some testing,
as to ensure smooth sailing as things improve
with the build system.
I'm willing to accompany those tests on #ledger.

It is get better folks, but may be a bit bumpy
in the beginning.


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Report format strings

2015-01-11 Thread Alexis
Hi Richard,
I've copied the register-format string from the manual and put it
into a lyons.ledgerrc file
https://gist.githubusercontent.com/afh/1b7d85928f464c99bcee/raw/707d3963f9cd5eccc41dc60e2a7a737ed20b2373/lyons.ledgerrc

When I run ledger --init-file lyons.ledgerrc test/input/sample.dat
I see the familiar register output.

When I start editing lyons.ledgerrc I can change the register output
to my heart's desire. Please download the above gist and store
it as a .ledgerrc and retry.


Hope this helps,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Report format strings

2015-01-10 Thread Alexis
Hello Richard,
search for --register-format the Output Customization¹ section
of the manual, there you will also find format strings for
other reports which have served me well as learning examples.

If you have any suggestions on how to best improve the documentation for
the format strings please let me know.


Cheers,
Alexis

¹ http://ledger-cli.org/3.0/doc/ledger3.html#Output-customization

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Report format strings

2015-01-10 Thread Alexis
Hi Richard,
 omitting the initial --.  It would be nice to see an example 
 configuration file, 

To quote from the manual:

--init-file FILE
-i FILE
  Causes FILE to be read by ledger before any other ledger file. This
  file may not contain any postings, but it may contain option settings.
  To specify options in the init file, use the same syntax as on the
  command-line, but put each option on its own line. Here is an example
  init file:

--price-db ~/finance/.pricedb
--wide
; ~/.ledgerrc ends here

  Option settings on the command-line or in the environment always take
  precedence over settings in the init file.

(http://ledger-cli.org/3.0/doc/ledger3.html#index-_002d_002dinit_002dfile-FILE-2)

 It does not seem to be specified 
 in the man page, or the manual, but I am assuming ledger looks for 
 ~/.config/ledger/config or ~/.config/ledger.conf or ~/.ledger/config or 
 similar. 

It's ~/.ledgerrc 
(http://ledger-cli.org/3.0/doc/ledger3.html#index-_002d_002dinit_002dfile-FILE-1)


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Further Ledger Development

2015-01-07 Thread Alexis
Hi John,
the way I understand git-flow is that for frequent pre-releases the
release branches are used, so master always points to the last stable release,
currently this would be release/3.1.0 (created from the v3.1 tag).

As development on 3.1.1 begins a branch named release/3.1.1 is created
from next, and as development on next comes along every 'stable' state
(meaning all the tests run) of next is merged into release/3.1.1.

Once the official 3.1.1 version is tagged and released the release/3.1.1
branch is merged into master and the release/3.1.1 branch becomes
'stale' and only important bugfixes are merged into it from that point on.

How does this sound?


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting Python bindings working when installing ledger from source

2015-01-07 Thread Alexis
Hi Craig,
 I get a segfailt after building everything (boost, boost-python and
 ledger)  from source.  I will look into it more later.

Building Ledger from source with Python bindings is a bit of a hassle
if Ledger's dependencies have been installed using Homebrew, since
the dependencies aren't easily found.

I have custom (read: messy) Makefile that does the job for me,
maybe we can talk in #ledger to solve your issue.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Further Ledger Development

2015-01-07 Thread Alexis
Hi Martin,
oh wow, can't wait to read through those and try them!

Maybe it's a good idea add the links to the ledger-cli.org/docs.html,
what do you think? John, Simon?


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Further Ledger Development

2015-01-07 Thread Alexis
Thanks all for the warm welcome =)

Eric, I agree Ledger can you more documentation, I think the
Ledger Cookbookš could use many more examples.
If you have any gems you'd like to share please do so and
if you know of any conversations on the list please share a
link so we can include that knowledge into the manual.

š http://ledger-cli.org/3.0/doc/ledger3.html#Cookbook


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting Python bindings working when installing ledger from source

2015-01-06 Thread Alexis H
Hi Craig,
Homebrew features a separate package for boost python, which needs to be
installed in addition to boost.
% brew install boost boost-python

I'm uncertain for what reasons this was done, I think because many people
want boost, few boost python and supporting both system Python 2.7.x and
Homebrew Python 3.x.x is somewhat of a hassle.


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting Python bindings working when installing ledger from source

2015-01-05 Thread Alexis
Hi Tim,
I've investigated the issue and to me it seems that it is also
necessary to pass the --python option to the ./acprep clean,
otherwise CMake does not try to find and use Python and
removing CMakeCache.txt before ./acprep --python --debug update
isn't enough to (re-)activate Python support for Ledger.

Here's what I've done:

  % export CXX=$(which clang++) # Had to install clang++ since, g++ would 
segfault in VirtualBox
  % ./acprep gitclean  # Note that this may remove files you'd like to keep; 
use with caution!
  % ./acprep --python dependencies
  % ./acprep --python --output build clean
  % ./acprep --python --output build --jobs 2 update
  % export LC_ALL=en_US.UTF_8 # Otherwise I'd see an Exception during 
initialization: locale::facet::_S_create_c_locale name not valid
  % ./build/ledger python -- --version
  Python 2.7.6
  % ./build/ledger python python/demo.py
  Welcome to the Ledger.Python demo!
  Demo completed successfully.


Hope this helps,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Keeping it consistent

2015-01-02 Thread Alexis
Hello Vikas Rawal on Fri, Jan 02, 2015 at 07:34:33AM CET, you wrote:
 1. How does one use the separate accounts file? Should one include it in the 
 ledger journal?

Yes, a separate accounts should be included in the ledger journal.

 2. How are payees defined? The examples given only specify accounts.

Pretty much the same like accounts. This is what the documentation has
to say about the payee command directive:
The payee directive supports two optional sub-directives, if they
immediately follow the payee directive and—if it is on a successive
line—begins with whitespace:
[…]
The alias sub-directive provides a regex which, if it matches a parsed
payee, the declared payee name is substituted:
[…]
The uuid sub-directive specifies that a transaction with exactly the
uuid given should have the declared payee name substituted
– http://ledger-cli.org/3.0/doc/ledger3.html#Command-Directives

 2. Does the account definition allow wildcards?

No, I don't think that's possible, but I could be mistaken.

 I would like a set of specified sub-accounts for each project account.
 Do I have to define them for each project account separately?

I think yes.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New tests not being run

2014-12-25 Thread Alexis
Hi,
I found a better solution to doing acprep gitclean in order to add new tests.
CMake provides the functionality to rebuild its cache, with the Ninja
generator for example you run: % ninja rebuild_cache

This will rebuild the cache and the next test run will include the new test.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting rid of the blue color in report output

2014-12-23 Thread Alexis
Hi,
here's a working example I already posted in #ledger and post hereby
to the mailing list for the sake of completeness.

Note that there is only *one* argument to the --balance-format option
and that argument is surrounded by single quotes.

% ledger bal --balance-format '%(justify(scrub(display_total), 20, -1, true, 
color))   %(!options.flat ? depth_spacer : ) 
%-(ansify_if(partial_account(options.flat), green if %color))\n%/ %$1\n%/ 
\n'


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: osx python binding (PyThreadState_Get error)

2014-12-21 Thread Alexis
Hello zt on Sat, Dec 20, 2014 at 06:23:27PM CET, you wrote:
 Just got into using ledger and I love it.

That's great!

 1 .I have been able to compile the source code through the acmake command 
 fine after enabling python, but it cannot find the python module when I do 
 python import. 

Did you pass the --python option to the acprep command?

 2. I install brew install --with-python ledger and I get the following:
 [local] python
 [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
 Type help, copyright, credits or license for more information.
  import ledger
 Fatal Python error: PyThreadState_Get: no current thread
 [1]87853 abort  python

I take care of the Homebrew Ledger formula and have never seen that
error, can you provide me the output of: % brew --prefix please

What happens when you run: % brew test ledger --with-python ?

Also please try: % ledger python
this will put you in an interactive python session, what happens
when you import ledger in there?

I've learned most of my Ledger Python by reading
$(brew --prefix ledger)/share/ledger/demo.py
it's very worthwhile studying it!

There's one difference from my system I notice,
while I get the same output as you when I run: % gcc -v

When running Python it prints the following for me:
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type help, copyright, credits or license for more information.

Instead of the LLVM 5.0 (clang-500.2.79) which you see, I see
LLVM 6.0 (clang-600.0.39).


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to make faster posts on ledger

2014-12-20 Thread Alexis H
Hi Kevin,
for starters have a look at the xact Ledger command
http://ledger-cli.org/3.0/doc/ledger3.html#xact

Since I have no knowledge about the Ledger Emacs integration, I can only
point to the documentation
http://ledger-cli.org/3.0/doc/ledger3.html#Emacs-org-Mode


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: uninstalling ledger

2014-12-18 Thread Alexis
Hi,
good to know and quite helpful, thanks!


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where is .ledgerrc stored on OSX / Yosemite

2014-12-16 Thread Alexis
Hi Kevin,
you need to use in your .ledgerrc :-

--input-date-format %d-%m-%Y


--date-format %d-%m-%Y is only used for the ledger output,
for example in register reports.


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access timelog checkin datetime from python other entries

2014-12-07 Thread Alexis
Heureka,
I've been able to access a timelog's post checkin and checkout time
from python! I'm uncertain whether my way of doing it is actually
a proper solution, yet it may help in locating the cause for the
TypeError reported earlier where there is not Python class for
the boost::posix_time::ptime registered.

Feel free to have a lookน and give suggestions directed towards
a proper bugfix.


Cheers,
Alexis

น https://github.com/afh/ledger/tree/wip/py_checkin

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access timelog checkin datetime from python other entries

2014-12-06 Thread Alexis
Hi John,
according to % TZ=Etc/GMT+6 date it's around 5:30 AM for you now
and I shall hope you are sound asleep.

Below is a list of several python related issues in ledger (in order of
importance for me) that I would like to address sooner than later.
I've included the name of my topic branch (https://github.com/afh/ledger),
which contains some changes and testfiles in parenthesis.

Unfortunately due to my lack of familiarity with C++ and Boost::Python
the effectiveness of my debugging and programming efforts is rather limited.
So any help in fixing the issues or aiding me in addressing those is
greatly appreciated.

I will join #ledger whenever I have some time spare to see if you or
anyone else wanting to work on the issues is available.


Cheers,
Alexis

Python use post.checkin (wip/py_checkin)
  • Resolve following issue to allow access to checkin/out datetime from python:
% ./ledger python test/baseline/python-checkin.py
Traceback (most recent call last):
  File test/baseline/python-checkin.py, line 8, in module
end   = post.checkout
TypeError: No Python class registered for C++ class 
boost::optionalboost::posix_time::ptime
libc++abi.dylib: terminating with uncaught exception of type int
[1]78317 abort  ./ledger python test/baseline/python-checkin.py

Python close_journal_files() » UnitTests:  (wip/py_unit, wip/py_tests)
  • Resolve the issue when calling ledger.session.close_journal_files()
% rm test/python/*.py[co]; python -B test/python/UnitTests.py
[1]79484 segmentation fault  python -B test/python/UnitTests.py
Chaning test/python/UnitTests.py:tearDown() to just pass avoids the sigsegv

Python read multiple journal files: (wip/py_read_journals)
  • Resolve issue with multiple calls to ledger.read_journal()
% ./ledger python test/baseline/python-readjournal.py
Traceback (most recent call last):
  File test/baseline/python-readjournal.py, line 4, in module
journal_b = ledger.read_journal(test/input/drewr3.dat)
RuntimeError: Assertion failed in src/session.cc, line 192:std::size_t 
ledger::session_t::read_data(const string ): xact_count == 
journal-xacts.size()
libc++abi.dylib: terminating with uncaught exception of type int
[1]79448 abort  ./ledger python test/baseline/python-readjournal.py

Python balance reports:
  journal.collect(query) and journal.collect_accounts('query')
  is commented in python/demo.py
  if query() is the equivalent for register
  I'd like to have collect() as the equivalent for balance

Period bug: this month
  % ledger reg -p 'this month'
  may result in different xacts than
  % ledger reg -p $(date +'%b')
  Related to different ahndling of Y2014 and apply year 2014 directives?
  Need ctest case to reproduce

Python UnitTests:
  • What was the intended use of test/PyUnitTests.py
  • run test/python/UnitTests when running ctest

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [BUG] Crash when using --trace option

2014-12-04 Thread Alexis
Hello John Wiegley on Thu, Dec 04, 2014 at 02:44:26AM CET, you wrote:
 I think it's --debug='*memory*' maybe?

Ah yes --debug memory in combination with --verify gives me
those TRACE_[CD]TOR messages, now I just need to make sense of it...

Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access timelog checkin datetime from python other entries

2014-12-03 Thread Alexis
Hi John,
thanks for you reply.

 I converter needs to be registered to Boost::Python for that type.  You can
 see how this is being done from for other types in the source code.

From what I understand a converter for the datetime_t type (which is a
typedef for boost:posix_time:ptime) is being registered to Boost:Python
in export_times() found at src/py_times.cc:233.

Is my understanding wrong?

If yes, where in the source code can I find a particularly good example
for another type being registered.

I have to admit I'm rather having a hard time getting acquainted
with C++ and Boost :|


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [BUG] Crash when using --trace option

2014-12-03 Thread Alexis

 I'm not sure what's causing the segmentation fault, but there are no trace
 messages above level 9,

The documentation lists 11, see doc/ledger3.texi:9276
  --trace INT
Enable tracing. The INT specifies the level of trace desired:

  LOG_OFF 0
  LOG_CRIT  1
  LOG_FATAL 2
  LOG_ASSERT  3
  LOG_ERROR 4
  LOG_VERIFY  5
  LOG_WARN  6
  LOG_INFO  7
  LOG_EXCEPT  8
  LOG_DEBUG 9
  LOG_TRACE 10
  LOG_ALL 11

 so I'm not sure what type of information you'd be looking for.

I wanted to understand how parsing of timelog entries is done
and more specifically how the checkin of a post is initialized,
and whether it is converted to a value_t at some point.

 The whole tracing mechanism was pretty much subsumed by the advanced --debug
 class mechanism which got added later.  That one is regular expression based,
 so that I can target exactly which debug messages I'm interested in seeing.

I see, does the --trace option still serve any purpose that isn't handled by
the --debug option?

So which --debug option would I need to specify in order to see those
TRACE_CTOR and TRACE_DTOR messages?


Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access timelog checkin datetime from python other entries

2014-12-03 Thread Alexis
Hello John Wiegley on Wed, Dec 03, 2014 at 10:08:14PM CET, you wrote:
 I'd be willing to take a look at it with you on IRC sometime, perhaps this
 weekend.

I would appreciate that a lot! I'm on CET, which timezone do you reside in?

Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[BUG] Crash when using --trace option

2014-12-01 Thread Alexis
Hi all,
I've build a debug version of ledger HEAD (4ee5329) and it crashes
when I try to use it with a value greater than 9 for its --trace option.

Steps to reproduce:
  * Run ledger with the --trace option, e.g.:
  % ./ledger -f test/input/sample.dat reg --trace 10

Expected result:
  Ledger shows detailed debugging log messages

Actual result:
  Ledger crashes with the following error message:
  libc++abi.dylib: terminating with uncaught exception of type
  std::logic_error: Argument to --trace must be an integer

Note that using smaller values than 10 work, even though it
seems to have no effect on the trace level as suggested by the manpage.

% for trace in {1..9}; do ./ledger -f test/input/sample.dat test--trace 
${trace} 2/tmp/ledger_trace_${trace}.txt /dev/null; done

Any helpful hints what needs to be changed?


Cheers,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Access timelog checkin datetime from python other entries

2014-12-01 Thread Alexis
Hi all,
I'd like to access the checkin and checkout time for a post from python.

Looking at src/post.cc there is a checkin variable available,
unfortunately this is not exposed to python in src/py_post.cc.

I've added 
.add_property(checkin, post_t::checkin)

to src/py_post.cc, which allows be to access checkin from python,
but this results the following error:

TypeError: No Python class registered for C++ class 
boost::optionalboost::posix_time::ptime

src/py_times.cc registers (optional and non-optional versions) of
datetime_t with python, and datetime_t is a typedef for
boost::posix_time::ptime in src/times.h, so certainly it all looks good.

Here's my little python test script:

import ledger
journal = ledger.read_journal('test/baseline/opt-time-report.test')
posts = journal.query('')
for post in posts:
  print(post.checkin)

Is there another way to access the timelog checkin and checkout
times from python?

If no, what changes are needed in order to fix the TypeError mentioned
above?


Thanks in advance,
Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Standardise ledger file extension

2014-12-01 Thread Alexis
Hello Craig Earls on Mon, Dec 01, 2014 at 07:24:49PM CET, you wrote:
 We can put a recommendation in the docs. But I don't want anything more
 than a suggestion.

I would think that having all sample files and the documentation use
the recommendation would make a much better recommendation.

I'd be afraid that the recommendation would be overlooked in the
extensive documentation.

Alexis

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >