From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: csv2ledger Date: Mon, 20 May 2024 07:02:14 +0000 Message-ID: <87seydm0eh.fsf@posteo.net> References: <86frug1ppt.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17862"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Joost Kremers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 20 09:03:53 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s8x3p-0004PR-3f for ged-emacs-devel@m.gmane-mx.org; Mon, 20 May 2024 09:03:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8x3A-0006gA-Rf; Mon, 20 May 2024 03:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8x2M-0006Nw-5l for emacs-devel@gnu.org; Mon, 20 May 2024 03:02:22 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8x2I-0002OU-Ny for emacs-devel@gnu.org; Mon, 20 May 2024 03:02:21 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 593C5240101 for ; Mon, 20 May 2024 09:02:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1716188536; bh=dPlQhu0lruXKaX3sZd3AmukMLH3qNb21nN9rU12h59Q=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=W/ZxOhUmfWeCuAKzh8v2ExGgF//KitgvHT+/6BhqZcb8aL0p8wbWqUjWi9/EuIQY7 L4NGGUxE3Pgsi4itZDqhzjnzSnTgaYahOEhKGckf7127LabBRgR4iuVpLJUYZgjVwq 24egnMhHeh+M1FtR2U5IEc6w1cHHOJvmxIf4Wno8GulKqdIjrQng2eSGJqRSDDGV7W XTVUi220OVKL/nSzPVd1E6qn5W2vUcM3lFoJMFziKA5u+cTnvprOwo67umcp6tpWF7 6gxXA+O82Dnii3hD8iKXPzSDAMQQ3SqNFgMJOfDiB5uGYzfVZs7ywjHdHMpyMlbtGY imiJav6H78deQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VjT5g4Rqvz6tw8; Mon, 20 May 2024 09:02:15 +0200 (CEST) In-Reply-To: <86frug1ppt.fsf@fastmail.fm> (Joost Kremers's message of "Fri, 17 May 2024 16:24:14 +0200") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319397 Archived-At: Joost Kremers writes: > Hi, > > I would like to offer a new package I wrote for inclusion to Non-GNU ELPA: > > https://codeberg.org/joostkremers/csv2ledger I don't have the time for a proper review of the package for now, but that shouldn't block adding the package. I'll try to come back to you later with a few comments (e.g. getting rid of the dash dependency). > `csv2ledger` does what it says: it converts CSV files to Ledger[1] entries. Most > banks offer the option to download transactions as a CSV file. With > `csv2ledger`, these can be converted to entries suitable for Ledger. > > There are already many solutions to do this conversion, not the least Ledger > itself, which provides a `convert` command. None of these are Emacs-based, > however, and none that I know of offer the customisability that I needed myself. Can you elaborate on what you mean by "Emacs-based"? Not everything one does in Emacs has to be written in Emacs Lisp, I think it is quite fine to invoke an external program as a kind of Unix filter and C-u M-| it on some region. > `csv2ledger` is extremely customisable: with a little Elisp scripting, it is > able to handle just about anything a bank could come up with in a CSV file. > Also, the user can customise the Ledger entry in any way they see fit.[2] At the > same time, though, I tried to keep the basic configuration simple and useful > enough that it can be used without any Elisp scripting. > > I'm proposing this package for inclusion into Non-GNU ELPA, not GNU ELPA, > because it depends on a package that's only available on MELPA, `parse-csv`.[3] (If > that is a problem, please let me know. I'm assuming it's a problem for GNU ELPA, > but not for Non-GNU ELPA.)[4] That is a blocker for both repositories. All packages in NonGNU and GNU ELPA should be installable OOTB, without having to configure third-party repositories (especially if their website needs javascript to display even the most basic information...). A quick peak at the package reveals it to be more or less a single function. Can you check of the csv-mode on ELPA provides anything you need? It seems like something that could be replicated in that package. > TIA, > > Joost > > > > Footnotes: > [1] https://ledger-cli.org/ > > [2] In fact, it is so customisable that you could use it to convert CSV files to > any format you like. JSON, YAML, whatever you fancy. Even XML if you're so > inclined... :D > > [3] https://melpa.org/#/parse-csv > > [4] If anyone has suggestions on how to get rid of that dependency, I'm all > ears. `parse-csv` looks like a real parser, not the kind of regex-kludge > that I would come up with... I've looked at `csv-mode`, which is on GNU > ELPA (and which is also a dependency), but I don't think it can be used > (easily) to parse CSV data. -- Philip Kaludercic on peregrine