<commit_before>LEWT
====
*Lazy Enterprise for hackers Without Time*

LEWT is a command line program written in Ruby that helps you invoice, manage expenses, and report useful business information with minimal friction. It is designed to encourage lazy accounting and to get more out of it. It is also designed to be further extended from the ground up...

# Installation

Install LEWT as a GEM.

```
gem install lewt
```

# The Basics

The LEWT program is based around a loop construct I call *extract, process, render* [EPR]. Data is extracted from some sources and transformed into a general ledger format, this is then passed to the specified processor(s) which may use it to perform operations, the processors working are then finally passed onto your renderer for outputting into a useful format.

LEWT by itself is basically just an extension system, all the EPR operations are performed by extensions making LEWT highly customisable. Being an fledgling version of this software, I have shipped LEWT with some basic extension which I find useful in my day to day contracting operations. These *core extensions* as I will call them for now are...

1. Calender Time-Keeping: Extract Time sheet data from iCal and Google Calender sources and transform it into the general ledger format.
2. Simple Invoices: Process ledger data as an invoice.
3. Simple Reports: Process ledger data as a report.
4. Liquid Renderer: .liquid template rendering for your all your shizz including PDFs.
5. Simple Expenses: Manage expenses like a poon using CSVs.
6. Simple Milestones: Do milestones like a total poon using CSVs.

Put it all together and you can mash up some CLs.

```
# output an invoice for client ACME to the terminal in PLAIN text. Extract time sheet data and work expenses from the last week for this (default)
lewt -x expenses,calender -p invoice -r liquid -t ACME

# output an invoice for specified client as a html, save a pdf simultaneously.
lewt -x expenses,calender -p invoice -r liquid -t ACME --template invoice --method pdf, html --save-file acmeXX-XX-XXXX.pdf 

# mash up a bunch of extraction sources and process it as a report.
lewt -x expenses,calender,milestones -p report -r liquid --template report --method text,pdf --save-file mash_report.pdf

```
The neat thing about LEWT is that extractors must all return there data in this general ledger format, thus a universal compatibility can be maintained with any processor. Processors must also always return hashes to be used by the renderer, they share a similar compatibility albeit less autonomous.

# Extensions

Your business work flows probably differ from mine. Both of ours are likely to change over time as well - LEWT extension system is designed to support that.

Conceptually, there are 3 different kinds of extensions: **Extractors, Processors, and Renderers**. However for now they all inherit from the same ``` LEWTExtension``` base class. This class provides some convenience methods for the extensions as well as a means for them to register themselves within LEWT - specifying options such as command line flags and call handles.

It's pretty easy to create you own extension all you need to do is create a folder in your extensions directory with a *.rb* file in it with the same name as the parent directory. This directory will house all your extension code, the naming convention is used for initialization. Alternatively you can create a Ruby Gem and have it loaded at run time by specified it in your settings.yml config file.
<commit_msg>updates to example CLs in docs<commit_after>LEWT
====
*Lazy Enterprise for hackers Without Time*

LEWT is a command line program written in Ruby that helps you invoice, manage expenses, and report useful business information with minimal friction. It is designed to encourage lazy accounting and to get more out of it. It is also designed to be further extended from the ground up...

# Installation

Install LEWT as a GEM.

```
gem install lewt
```

# The Basics

The LEWT program is based around a loop construct I call *extract, process, render* [EPR]. Data is extracted from some sources and transformed into a general ledger format, this is then passed to the specified processor(s) which may use it to perform operations, the processors working are then finally passed onto your renderer for outputting into a useful format.

LEWT by itself is basically just an extension system, all the EPR operations are performed by extensions making LEWT highly customisable. Being an fledgling version of this software, I have shipped LEWT with some basic extension which I find useful in my day to day contracting operations. These *core extensions* as I will call them for now are...

1. Calender Time-Keeping: Extract Time sheet data from iCal and Google Calender sources and transform it into the general ledger format.
2. Simple Invoices: Process ledger data as an invoice.
3. Simple Reports: Process ledger data as a report.
4. Liquid Renderer: .liquid template rendering for your all your shizz including PDFs.
5. Simple Expenses: Manage expenses like a poon using CSVs.
6. Simple Milestones: Do milestones like a total poon using CSVs.

Put it all together and you can mash up some CLs.

```
# output an invoice for client ACME to the terminal in PLAIN text. Extract time sheet data and work expenses from the last week for this (default)
lewt -x expenses,calender -p invoice -o liquid -t ACME


# output an invoice for specified client as a html, save a pdf simultaneously.
lewt -x expenses,calender -p invoice -o liquid -t ACME --method pdf, html --save-file acmeXX-XX-XXXX.pdf 

# mash up a bunch of extraction sources and process it as a report.
lewt -x expenses,calender,milestones -p report -o liquid --method text,pdf --save-file mash_report.pdf

```
The neat thing about LEWT is that extractors must all return there data in this general ledger format, thus a universal compatibility can be maintained with any processor. Processors must also always return hashes to be used by the renderer, they share a similar compatibility albeit less autonomous.

# Extensions

Your business work flows probably differ from mine. Both of ours are likely to change over time as well - LEWT extension system is designed to support that.

Conceptually, there are 3 different kinds of extensions: **Extractors, Processors, and Renderers**. However for now they all inherit from the same ``` LEWTExtension``` base class. This class provides some convenience methods for the extensions as well as a means for them to register themselves within LEWT - specifying options such as command line flags and call handles.

It's pretty easy to create you own extension all you need to do is create a folder in your extensions directory with a *.rb* file in it with the same name as the parent directory. This directory will house all your extension code, the naming convention is used for initialization. Alternatively you can create a Ruby Gem and have it loaded at run time by specified it in your settings.yml config file.

{'fraction_non_alphanumeric': 0.04260758414997869, 'fraction_numerical': 0.0019883539269990058, 'mean_word_length': 4.282820705176294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '276885', 'n_tokens_mistral': 1739, 'n_tokens_neox': 1659, 'n_words': 1123}