Git Product home page Git Product logo

pygnucash's People

Contributors

dbrgn avatar matzeb avatar mdlavin avatar scottmtp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygnucash's Issues

Timezones

Gnucash exported the transactions using UTC time, while the Gnucash software is set to UTC+2.

Therefore transactions that occured on "2016/08/02" were exported as "2016/08/01 22:00" and interpreted as "2016/08/01".

I used this hack in gnucash.py to adjust:

import calendar

# ...

    def parse_time(time):
        dt = datetime.strptime(time, "%Y%m%d%H%M%S")                                                
        timestamp = calendar.timegm(dt.timetuple()) + 7200                                                               
        return datetime.utcfromtimestamp(timestamp)         

Maybe this could be made configurable using a CLI switch?

Does not recognize gnucash splite3 file

Ran 'gnucash2ledger.py' as:

python gnucash2ledger.py example.gnucash

It spat out:

Traceback (most recent call last):
File "gnucash2ledger.py", line 10, in <module>
data = gnucash.read_file(sys.argv[1])
File "/home/scott/bin/pygnucash/gnucash.py", line 78, in read_file
for row in c.execute('SELECT guid, namespace, mnemonic, fullname FROM commodities'):
sqlite3.DatabaseError: file is encrypted or is not a database

Python 2.7.3
Sqlite 3.7.9
Gnucash 2.6.3

gnucash 3 support (Problem with time data)

I am trying to convert gnucash file. The file was originally written in gnucash 2.6 but I recently installed gnucash 3 and edited the file, so I am not sure if that makes a difference.

I am using Python 3.6.5 and I get this error

Traceback (most recent call last):
  File "pygnucash/gnucash2ledger.py", line 34, in <module>
    data = gnucash.read_file(sys.argv[1])
  File "/Users/ksalman/pygnucash/gnucash.py", line 179, in read_file
    return read_data(conn)
  File "/Users/ksalman/pygnucash/gnucash.py", line 133, in read_data
    trans.post_date = parse_time(post_date)
  File "/Users/ksalman/pygnucash/gnucash.py", line 124, in parse_time
    return datetime.strptime(time, "%Y%m%d%H%M%S")
  File "/usr/local/opt/pyenv/versions/3.6.5/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/local/opt/pyenv/versions/3.6.5/lib/python3.6/_strptime.py", line 362, in _strptime
    (data_string, format))
ValueError: time data '2017-11-06 10:59:00' does not match format '%Y%m%d%H%M%S'

gnucash2ledger.py drops transactions with import data

I'm finding that transactions with extra import info are being silently dropped by gnucash2ledger.py.

An example of such a transaction would currently be output by Piecash's piecash_ledger.py like this...

2014/01/01 * WITHDRAWAL AT HANDYBANK MELB CTL 5 O/S 25420178 01/01/14
;OFX ext. info: |Trans type:Cash withdrawal
    Assets:Current:Westpac SAV                  -180.00 AUD ;   WITHDRAWAL AT HANDYBANK MELB CTL 5 O/S 25420178 01/01/14
    Expenses:Unspecified:AUD                     180.00 AUD

(Which is also not quite right, because it causes errors with ledger... I opened an issue for that on sdementen/piecash).

Error: 'gnucash' has no attribute 'read_file'

Hi; I'm trying to run gnucash2ledger.py in Python3, already typed import gnucash, I'm getting this error:

Traceback (most recent call last):
File "gnucash2ledger.py", line 34, in
data = gnucash.read_file(sys.argv[1])
AttributeError: module 'gnucash' has no attribute 'read_file'

how should I proceed? Help me plz

Thanks in advance.

Problem with gnucash file conversion

I compiled latest gnucash (2.6.16) from source with dbi conversion enabled. From gnucash I could save as sqlite3 but the files were saved as "myfile.gnucash" not "myfile.sqlite3". But I don't know whether it will have sqlite3 extension in the first place when saved. Anyway, I went ahead and ran the python script "gnucash2ledger.py" downloaded from "https://github.com/MatzeB/pygnucash" in the following manner:

python2.7 gnucash2ledger.py myfile.gnucash print > test.txt

The error came through is as follows:

Traceback (most recent call last):
File "gnucash2ledger.py", line 35, in
data = gnucash.read_file(sys.argv[1])
AttributeError: 'module' object has no attribute 'read_file'

I noticed in the script page that it says that it requires python 2.7 with sqlite3 module enabled. After some search I did the following to enable sqlite3:

sudo apt-get install sqlite3 libsqlite3-dev

sudo pip install pysqlite

But no luck so far.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.