<commit_before># AWSPrice: AWS Pricing via a simple grammar

## Installation

You should be able to

	go get -u github.com/jbarratt/awsprice/...

and end up with an `awsprice` binary. (Which, as of now, has very limited functionality.)

## Goals

Make it quick and easy to figure out prices for AWS configurations.

This is done via a simple grammar, like

```
$ awsprice '2 * m4.xlarge + db.t2.medium(engine=mariadb) + elb(transfer=500GB)'
```

(Warning, not yet implemented.)

The goal is to have a common engine power potentially a few different interfaces:

* A command line tool `$ awsprice c3.xlarge`
* A slackbot: `@awsprice ebs(500G)`
* A single page webapp, with pretty/shareable HTML results

## Implementation

The tools are built on the AWS Price List API.

Internally, it goes through a few phases:

1. Fetching raw JSON offer data
2. Processing that data into a format optimized for lookups
3. Querying the data via the DSL/Grammar
4. Presenting the results in various ways

## Feature Set (Planned Delivery Order)

* Initial CLI framework ✔ 
	* awsprice fetch ✔
	* awsprice process (optional -o 'db file') ✔
* Simple lookup of EC2 information (only single region, no options) ✔
	* via CLI ✔
	* With wildcard matching ✔
	* initial slackbot deploy (with cached data) ✔ ([awspricebot|http://github.com/jbaratt/awspricebot])
	* 'help' ✔
* Additional EC2 demension (region)
* Basic RDS
* Basic calculator support (+, -, parenthesis grouping)
* EBS support
* ELB support (including data transfer)
* S3 support (GB)
* RDS support (region, multi-az, engine, storage dimensions)
* Cloudfront Support (transfer, price class)
* EC2 Transit support
* S3 transit support
* 'vs' operator (comparing 2 stacks with each other)
* EC2 OS


# Internal Architecture

At the top level, the parser will identify an 'Offer' token, with a set of optional k=v arguments.

	db.r3.xlarge(engine=mariadb)

There is a high level dispatch table:
	- given an identifier name
	- return the offer type

The dispatch table will then call the proper `New{}Offer` method, passing the arguments in.
It will 'mix in' any of the global arguments, as well. For example

	2 x m4.xlarge(os=Windows)  region=us-west-1

would 
<commit_msg>Spleling<commit_after># AWSPrice: AWS Pricing via a simple grammar

## Installation

You should be able to

	go get -u github.com/jbarratt/awsprice/...

and end up with an `awsprice` binary. (Which, as of now, has very limited functionality.)

## Goals

Make it quick and easy to figure out prices for AWS configurations.

This is done via a simple grammar, like

```
$ awsprice '2 * m4.xlarge + db.t2.medium(engine=mariadb) + elb(transfer=500GB)'
```

(Warning, not yet implemented.)

The goal is to have a common engine power potentially a few different interfaces:

* A command line tool `$ awsprice c3.xlarge`
* A slackbot: `@awsprice ebs(500G)`
* A single page webapp, with pretty/shareable HTML results

## Implementation

The tools are built on the AWS Price List API.

Internally, it goes through a few phases:

1. Fetching raw JSON offer data
2. Processing that data into a format optimized for lookups
3. Querying the data via the DSL/Grammar
4. Presenting the results in various ways

## Feature Set (Planned Delivery Order)

* Initial CLI framework ✔ 
	* awsprice fetch ✔
	* awsprice process (optional -o 'db file') ✔
* Simple lookup of EC2 information (only single region, no options) ✔
	* via CLI ✔
	* With wildcard matching ✔
	* initial slackbot deploy (with cached data) ✔ ([awspricebot|http://github.com/jbaratt/awspricebot])
	* 'help' ✔
* Additional EC2 dimensions (region)
* Basic RDS
* Basic calculator support (+, -, parenthesis grouping)
* EBS support
* ELB support (including data transfer)
* S3 support (GB)
* RDS support (region, multi-az, engine, storage dimensions)
* Cloudfront Support (transfer, price class)
* EC2 Transit support
* S3 transit support
* 'vs' operator (comparing 2 stacks with each other)
* EC2 OS


# Internal Architecture

At the top level, the parser will identify an 'Offer' token, with a set of optional k=v arguments.

	db.r3.xlarge(engine=mariadb)

There is a high level dispatch table:
	- given an identifier name
	- return the offer type

The dispatch table will then call the proper `New{}Offer` method, passing the arguments in.
It will 'mix in' any of the global arguments, as well. For example

	2 x m4.xlarge(os=Windows)  region=us-west-1

would 

{'fraction_non_alphanumeric': 0.08605072463768115, 'fraction_numerical': 0.011322463768115942, 'mean_word_length': 4.178194607268464, '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': '1230205', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1376, 'n_words': 614}