Skip to content

Commit

Permalink
v2.6.0 (#4)
Browse files Browse the repository at this point in the history
* v2.6.0

* Additional changes to utils and added US_AZ

* Fixing Travis reference

* Fixing travis

* Updating README
  • Loading branch information
Justintime50 authored Nov 26, 2020
1 parent 6954ad3 commit 32d0692
Show file tree
Hide file tree
Showing 30 changed files with 469 additions and 172 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
coverage
.nyc_output
test-data-set.json-slim.json
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ node_js:
script:
- npm i
- npx eslint index.js
- npx eslint util/*
- npx eslint utils/*.js
- npx eslint lib/data-router.js
- npx eslint test/*
- npx eslint test/*.js
- npm run coverage

after_success:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v2.6.0 (2020-11-25)

* Shifted logic around, renamed files and lists, updated documentation, consolidated all US data into a single folder
* Added Idaho to US_ID and Arizona to US_AZ
* Completely re-wrote the `create-slim-json` utility. It now requires much less manual work, accepts more configuration options, and runs much faster while being more reliable

## v2.5.0 (2020-10-21)

* Overhauled testing framework
Expand Down
74 changes: 0 additions & 74 deletions DATA.md

This file was deleted.

83 changes: 57 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,63 @@ Dummy Address Data (DAD) - Retrieve real addresses from all around the world.

</div>

DAD is the perfect companion to quickly bootstrap address data in your application. DAD provides real addresses from all over the world with a consistent data structure so you can spend less time looking up addresses and address rules and more time coding.
DAD is the perfect companion to quickly bootstrap address data in your application. DAD provides real addresses from all over the world with a consistent data structure so you can spend less time looking up addresses and address rules and more time coding. Rigorously tested with 2000+ tests, rest easy knowing your address data is uniform, present, and rock solid, all while being incredibly performant when retrieving records.

## Install

```bash
npm i dad-tool
```

## Data
## Address Data

Each dataset is built from a much larger dataset and slimmed down to bite size pieces to conserve disk space and resources when retrieving addresses. Each item on an address object will return a string.
Address objects will look like the [sample below](#sample-address-object). The data type of each field on an address object is a string.

Attempts have been made to verify addresses and ensure that street1, city, state, and zip are present on all records. Some lists may be shorter than others to avoid complexity or because of a lack of accurate data.

### Sample Data Sources
The following files can be found in the `data` directory.

| Filename | Locations | Address Count | Tag |
| -------------------------- | ------------------------- | ------------- | ------ |
| ca-addresses-slim.min.json | California - Anaheim Area | 100 | US_CA |
| nv-addresses-slim.min.json | Nevada - Lincoln Area | 100 | US_NV |
| or-addresses-slim.min.json | Oregon - Portland Area | 100 | US_OR |
| ut-addresses-slim.min.json | Utah - Provo Area | 100 | US_UT |
| wa-addresses-slim.min.json | Washington - Spokane Area | 100 | US_WA |
## Australia

### All Data Sources
| Filename | Locations | Address Count | Tag |
| --------------------------- | --------------- | ------------- | ------ |
| australia/vt-addresses.json | Victoria Area | 5 | AU_VT |

The amount of data is too extensive to list here. View all the [available data sources](DATA.md) you can retrieve addresses from.
## Canada

| Filename | Locations | Address Count | Tag |
| ------------------------ | --------------- | ------------- | ------ |
| canada/bc-addresses.json | BC Area | 5 | CA_BC |

## China

| Filename | Locations | Address Count | Tag |
| ----------------------- | ------------------------- | ------------- | ------ |
| china/bj-addresses.json | Beijing Area | 5 | CN_BJ |
| china/hk-addresses.json | Hong Kong - Wan Chai Area | 5 | CN_HK |

## Europe

| Filename | Locations | Address Count | Tag |
| ------------------------ | ----------------------------- | ------------- | ------ |
| europe/de-addresses.json | Germany - Wesel Area | 5 | EU_DE |
| europe/es-addresses.json | Spain - Countrywide | 5 | EU_ES |
| europe/uk-addresses.json | United Kingdom - England Area | 5 | EU_UK |

## United States

| Filename | Locations | Address Count | Tag |
| ------------------------------- | ------------------------- | ------------- | ------ |
| united-states/az-addresses.json | Arizona - Gilbert Area | 100 | US_AZ |
| united-states/ca-addresses.json | California - Anaheim Area | 100 | US_CA |
| united-states/id-addresses.json | Idaho - Boise Area | 100 | US_ID |
| united-states/ks-addresses.json | Kansas - Barton County | 100 | US_KS |
| united-states/nv-addresses.json | Nevada - Lincoln Area | 100 | US_NV |
| united-states/ny-addresses.json | New York - Rochester Area | 100 | US_NY |
| united-states/or-addresses.json | Oregon - Portland Area | 100 | US_OR |
| united-states/tx-addresses.json | Texas - Austin Area | 100 | US_TX |
| united-states/ut-addresses.json | Utah - Provo Area | 100 | US_UT |
| united-states/wa-addresses.json | Washington - Spokane Area | 100 | US_WA |

## Usage

Expand All @@ -60,9 +90,9 @@ console.log(address)
// console.log(address.city)
```

### Output
### Sample Address Object

Outputs an entry like the following:
A sample address object will look like the following:

```javascript
{
Expand All @@ -72,29 +102,30 @@ Outputs an entry like the following:
state: 'UT',
zip: '84057',
country: 'US'
},
}
```

## Development

### Utilities

To create the slim lists from a larger dataset, use the `create-slim-json.js` tool in the `util` folder.
When adding or editing a list, ensure the file is minimized and does not exceed 100 records.

```bash
node util/create-slim-json.js
```
# Lint a file
npx eslint index.js

### Linting
# Run tests
npm run test

```bash
npx eslint index.js
# Run test coverage
npm run coverage
```

### Tests
### Utilities

To create the slim lists from a larger dataset, use the `create-slim-json.js` tool in the `utils` folder. See the script for additional information. This tool will grab 100 random addresses (by default) from a larger JSON dataset and create a new slim file that can be added to DAD.

```bash
npm run test
DATA_SET=path/to/dataset.json STATE=UT COUNTRY=US node utils/create-slim-json.js
```

## Contributing
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 32d0692

Please sign in to comment.