Extract transactions from Mpesa Statement pdfs. Extract to sql_tables, ets tables, csv, json. Synthesis for preset metadata.
To perform an export, make sure a couple of dependecies are installed.
pdftotext- installed withpip install pdftotexterlang- make sure erlang is installedsudo apt-get install esl-erlangelixir- installed with withsudo apt-get install elixirVisit https://www.erlang-solutions.com/downloads/ for the latest erlang/elixir version.
To build a commandline executable.
- Fetch the dependecies
mix deps.get - Build executable
mix escript.build - A new executable named
xpesa_parsershould be available in the currect directory.
To install this executable to your system.
- copy the executable to a directory in your
$PATH - make sure the executable is executable
chmod +x xpesa_parser
To extract mpesa statements
- Download Mpesa Pdf statements, and add them to a folder.
- Run the executable issuing password and path to the folder with mpesa statements
xpesa_parser <path to folder> -p password -o <path to output folder> - The output folder will contain the extracted transactions, in json format(default) or in an SQL if specified with
--sqloption while riunning the executable.xpesa_parser --helpwill show the available options.
If available in Hex, the package can be installed
by adding statements_reader to your list of dependencies in mix.exs:
def deps do
[
{:statements_reader, "~> 0.1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/statements_reader.