From a0e1f012b0fa9ca543684d0eea5e13901f82acc9 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 1 Aug 2024 20:12:12 -0400 Subject: [PATCH] Updating docs and get_address typing --- README.md | 6 +++--- docs/atlus.html | 12 ++++++------ docs/atlus/atlus.html | 16 ++++++++-------- docs/atlus/resources.html | 4 ++-- docs/search.js | 2 +- pyproject.toml | 8 ++++---- scripts/make_docs.py | 4 ++-- src/atlus/__about__.py | 4 ++-- src/atlus/atlus.py | 4 ++-- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index e5f698c..36249c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Atlus -![GitHub License](https://img.shields.io/github/license/whubsch/atlus_py) -![GitHub last commit](https://img.shields.io/github/last-commit/whubsch/atlus_py) +![GitHub License](https://img.shields.io/github/license/whubsch/atlus) +![GitHub last commit](https://img.shields.io/github/last-commit/whubsch/atlus) ![PyPI - Version](https://img.shields.io/pypi/v/atlus) ![Pepy Total Downlods](https://img.shields.io/pepy/dt/atlus) @@ -44,7 +44,7 @@ pip install atlus ## Docs -The documentation for our package is available online at our [documentation page](https://whubsch.github.io/atlus_py/index.html). We would greatly appreciate your contributions to help improve the auto-generated docs; please submit any updates or corrections via pull requests. +The documentation for our package is available online at our [documentation page](https://whubsch.github.io/atlus/index.html). We would greatly appreciate your contributions to help improve the auto-generated docs; please submit any updates or corrections via pull requests. ## License diff --git a/docs/atlus.html b/docs/atlus.html index bda1dec..8f2d3b4 100644 --- a/docs/atlus.html +++ b/docs/atlus.html @@ -5,7 +5,7 @@ atlus API documentation - + @@ -18,7 +18,7 @@
- + @@ -145,7 +145,7 @@

def - get_address( address_string: str) -> Tuple[Dict[str, Union[str, int]], List[Optional[str]]]: + get_address(address_string: str) -> Tuple[Dict[str, str], List[Optional[str]]]: @@ -153,7 +153,7 @@

409def get_address(
 410    address_string: str,
-411) -> Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]:
+411) -> Tuple[Dict[str, str], List[Union[str, None]]]:
 412    """Process address strings.
 413
 414    ```python
@@ -173,7 +173,7 @@ 

428 address_string (str): The address string to process. 429 430 Returns: -431 Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +431 Tuple[Dict[str, str], List[Union[str, None]]]: 432 The processed address string and the removed fields. 433 """ 434 try: @@ -259,7 +259,7 @@
Arguments:
Returns:
-

Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +

Tuple[Dict[str, str], List[Union[str, None]]]: The processed address string and the removed fields.

diff --git a/docs/atlus/atlus.html b/docs/atlus/atlus.html index 484d084..841b57c 100644 --- a/docs/atlus/atlus.html +++ b/docs/atlus/atlus.html @@ -5,7 +5,7 @@ atlus.atlus API documentation - + @@ -23,7 +23,7 @@  atlus - + @@ -531,7 +531,7 @@

407 408def get_address( 409 address_string: str, -410) -> Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +410) -> Tuple[Dict[str, str], List[Union[str, None]]]: 411 """Process address strings. 412 413 ```python @@ -551,7 +551,7 @@

427 address_string (str): The address string to process. 428 429 Returns: -430 Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +430 Tuple[Dict[str, str], List[Union[str, None]]]: 431 The processed address string and the removed fields. 432 """ 433 try: @@ -1479,7 +1479,7 @@
Returns:
def - get_address( address_string: str) -> Tuple[Dict[str, Union[str, int]], List[Optional[str]]]: + get_address(address_string: str) -> Tuple[Dict[str, str], List[Optional[str]]]: @@ -1487,7 +1487,7 @@
Returns:
409def get_address(
 410    address_string: str,
-411) -> Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]:
+411) -> Tuple[Dict[str, str], List[Union[str, None]]]:
 412    """Process address strings.
 413
 414    ```python
@@ -1507,7 +1507,7 @@ 
Returns:
428 address_string (str): The address string to process. 429 430 Returns: -431 Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +431 Tuple[Dict[str, str], List[Union[str, None]]]: 432 The processed address string and the removed fields. 433 """ 434 try: @@ -1593,7 +1593,7 @@
Arguments:
Returns:
-

Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +

Tuple[Dict[str, str], List[Union[str, None]]]: The processed address string and the removed fields.

diff --git a/docs/atlus/resources.html b/docs/atlus/resources.html index 2447e47..6b68d71 100644 --- a/docs/atlus/resources.html +++ b/docs/atlus/resources.html @@ -5,7 +5,7 @@ atlus.resources API documentation - + @@ -23,7 +23,7 @@  atlus - + diff --git a/docs/search.js b/docs/search.js index 04fd573..9314dec 100644 --- a/docs/search.js +++ b/docs/search.js @@ -1,6 +1,6 @@ window.pdocSearch = (function(){ /** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();oatlus is a Python package to convert raw address and phone number strings into the OSM format.\nIt's designed to be used with US and Canadian phone numbers and addresses.

\n\n
\n
>>> import atlus\n>>> atlus.abbrs("St. Francis")\n"Saint Francis"\n>>> atlus.get_address("789 Oak Dr, Smallville California, 98765")[0]\n{"addr:housenumber": "789", "addr:street": "Oak Drive", "addr:city": "Smallville", "addr:state": "CA", "addr:postcode": "98765"}\n>>> atlus.get_phone("(202) 900-9019")\n"+1 202-900-9019"\n
\n
\n"}, {"fullname": "atlus.get_address", "modulename": "atlus", "qualname": "get_address", "kind": "function", "doc": "

Process address strings.

\n\n
\n
>>> get_address("345 MAPLE RD, COUNTRYSIDE, PA 24680-0198")[0]\n{"addr:housenumber": "345", "addr:street": "Maple Road",\n"addr:city": "Countryside", "addr:state": "PA", "addr:postcode": "24680-0198"}\n>>> get_address("777 Strawberry St.")[0]\n{"addr:housenumber": "777", "addr:street": "Strawberry Street"}\n>>> address = get_address("222 NW Pineapple Ave Suite A Unit B")\n>>> address[0]\n{"addr:housenumber": "222", "addr:street": "Northwest Pineapple Avenue"}\n>>> address[1]\n["addr:unit"]\n
\n
\n\n
Arguments:
\n\n
    \n
  • address_string (str): The address string to process.
  • \n
\n\n
Returns:
\n\n
\n

Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]:\n The processed address string and the removed fields.

\n
\n", "signature": "(\taddress_string: str) -> Tuple[Dict[str, Union[str, int]], List[Optional[str]]]:", "funcdef": "def"}, {"fullname": "atlus.get_phone", "modulename": "atlus", "qualname": "get_phone", "kind": "function", "doc": "

Format phone numbers to the US and Canadian standard format of +1 XXX-XXX-XXXX.

\n\n
\n
>>> get_phone("2029009019")\n"+1 202-900-9019"\n>>> get_phone("(202) 900-9019")\n"+1 202-900-9019"\n>>> get_phone("202-900-901")\nValueError: Invalid phone number: 202-900-901\n
\n
\n\n
Arguments:
\n\n
    \n
  • phone (str): The phone number to format.
  • \n
\n\n
Returns:
\n\n
\n

str: The formatted phone number.

\n
\n\n
Raises:
\n\n
    \n
  • ValueError: If the phone number is invalid.
  • \n
\n", "signature": "(phone: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.abbrs", "modulename": "atlus", "qualname": "abbrs", "kind": "function", "doc": "

Bundle most common abbreviation expansion functions.

\n\n
\n
>>> abbrs("St. Francis")\n"Saint Francis"\n>>> abbrs("E St.")\n"E Street"\n>>> abbrs("E Sewell St")\n"East Sewell Street"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value (str): String to expand.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.get_title", "modulename": "atlus", "qualname": "get_title", "kind": "function", "doc": "

Fix ALL-CAPS string.

\n\n
\n
>>> get_title("PALM BEACH")\n"Palm Beach"\n>>> get_title("BOSTON")\n"BOSTON"\n>>> get_title("BOSTON", single_word=True)\n"Boston"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
  • single_word: Whether the string should be fixed even if it is a single word.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str, single_word: bool = False) -> str:", "funcdef": "def"}, {"fullname": "atlus.mc_replace", "modulename": "atlus", "qualname": "mc_replace", "kind": "function", "doc": "

Fix string containing improperly formatted Mc- prefix.

\n\n
\n
>>> mc_replace("Fort Mchenry")\n"Fort McHenry"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.us_replace", "modulename": "atlus", "qualname": "us_replace", "kind": "function", "doc": "

Fix string containing improperly formatted US.

\n\n
\n
>>> us_replace("U.S. Route 15")\n"US Route 15"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.ord_replace", "modulename": "atlus", "qualname": "ord_replace", "kind": "function", "doc": "

Fix string containing improperly capitalized ordinal.

\n\n
\n
>>> ord_replace("3Rd St. NW")\n"3rd St. NW"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.remove_br_unicode", "modulename": "atlus", "qualname": "remove_br_unicode", "kind": "function", "doc": "

Clean the input string before sending to parser by removing newlines and unicode.

\n\n
Arguments:
\n\n
    \n
  • old (str): String to clean.
  • \n
\n\n
Returns:
\n\n
\n

str: Cleaned string.

\n
\n", "signature": "(old: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus", "modulename": "atlus.atlus", "kind": "module", "doc": "

Functions and tools to process the raw address strings.

\n"}, {"fullname": "atlus.atlus.toss_tags", "modulename": "atlus.atlus", "qualname": "toss_tags", "kind": "variable", "doc": "

Tags from the usaddress package to remove.

\n", "default_value": "['Recipient', 'IntersectionSeparator', 'LandmarkName', 'USPSBoxGroupID', 'USPSBoxGroupType', 'USPSBoxID', 'USPSBoxType', 'OccupancyType']"}, {"fullname": "atlus.atlus.osm_mapping", "modulename": "atlus.atlus", "qualname": "osm_mapping", "kind": "variable", "doc": "

Mapping from usaddress fields to OSM tags.

\n", "default_value": "{'AddressNumber': 'addr:housenumber', 'AddressNumberPrefix': 'addr:housenumber', 'AddressNumberSuffix': 'addr:housenumber', 'StreetName': 'addr:street', 'StreetNamePreDirectional': 'addr:street', 'StreetNamePreModifier': 'addr:street', 'StreetNamePreType': 'addr:street', 'StreetNamePostDirectional': 'addr:street', 'StreetNamePostModifier': 'addr:street', 'StreetNamePostType': 'addr:street', 'OccupancyIdentifier': 'addr:unit', 'PlaceName': 'addr:city', 'StateName': 'addr:state', 'ZipCode': 'addr:postcode'}"}, {"fullname": "atlus.atlus.get_title", "modulename": "atlus.atlus", "qualname": "get_title", "kind": "function", "doc": "

Fix ALL-CAPS string.

\n\n
\n
>>> get_title("PALM BEACH")\n"Palm Beach"\n>>> get_title("BOSTON")\n"BOSTON"\n>>> get_title("BOSTON", single_word=True)\n"Boston"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
  • single_word: Whether the string should be fixed even if it is a single word.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str, single_word: bool = False) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.us_replace", "modulename": "atlus.atlus", "qualname": "us_replace", "kind": "function", "doc": "

Fix string containing improperly formatted US.

\n\n
\n
>>> us_replace("U.S. Route 15")\n"US Route 15"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.mc_replace", "modulename": "atlus.atlus", "qualname": "mc_replace", "kind": "function", "doc": "

Fix string containing improperly formatted Mc- prefix.

\n\n
\n
>>> mc_replace("Fort Mchenry")\n"Fort McHenry"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.ord_replace", "modulename": "atlus.atlus", "qualname": "ord_replace", "kind": "function", "doc": "

Fix string containing improperly capitalized ordinal.

\n\n
\n
>>> ord_replace("3Rd St. NW")\n"3rd St. NW"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.name_street_expand", "modulename": "atlus.atlus", "qualname": "name_street_expand", "kind": "function", "doc": "

Expand matched street type abbreviations.

\n\n
Arguments:
\n\n
    \n
  • match (regex.Match): Matched string.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.direct_expand", "modulename": "atlus.atlus", "qualname": "direct_expand", "kind": "function", "doc": "

Expand matched directional abbreviations.

\n\n
Arguments:
\n\n
    \n
  • match (regex.Match): Matched string.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.cap_match", "modulename": "atlus.atlus", "qualname": "cap_match", "kind": "function", "doc": "

Make matches uppercase.

\n\n
Arguments:
\n\n
    \n
  • match (regex.Match): Matched string.
  • \n
\n\n
Returns:
\n\n
\n

str: Capitalized string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.lower_match", "modulename": "atlus.atlus", "qualname": "lower_match", "kind": "function", "doc": "

Lower-case improperly cased ordinal values.

\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.grid_match", "modulename": "atlus.atlus", "qualname": "grid_match", "kind": "function", "doc": "

Clean grid addresses.

\n", "signature": "(match_str: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.abbrs", "modulename": "atlus.atlus", "qualname": "abbrs", "kind": "function", "doc": "

Bundle most common abbreviation expansion functions.

\n\n
\n
>>> abbrs("St. Francis")\n"Saint Francis"\n>>> abbrs("E St.")\n"E Street"\n>>> abbrs("E Sewell St")\n"East Sewell Street"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value (str): String to expand.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.remove_br_unicode", "modulename": "atlus.atlus", "qualname": "remove_br_unicode", "kind": "function", "doc": "

Clean the input string before sending to parser by removing newlines and unicode.

\n\n
Arguments:
\n\n
    \n
  • old (str): String to clean.
  • \n
\n\n
Returns:
\n\n
\n

str: Cleaned string.

\n
\n", "signature": "(old: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.clean_address", "modulename": "atlus.atlus", "qualname": "clean_address", "kind": "function", "doc": "

Clean the input string before sending to parser by removing newlines and unicode.

\n\n
Arguments:
\n\n
    \n
  • address_string (str): String to clean.
  • \n
\n\n
Returns:
\n\n
\n

str: Cleaned string.

\n
\n", "signature": "(address_string: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.help_join", "modulename": "atlus.atlus", "qualname": "help_join", "kind": "function", "doc": "

Help to join address fields.

\n", "signature": "(tags, keep: List[str]) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.addr_street", "modulename": "atlus.atlus", "qualname": "addr_street", "kind": "function", "doc": "

Build the street field.

\n", "signature": "(tags: Dict[str, str]) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.addr_housenumber", "modulename": "atlus.atlus", "qualname": "addr_housenumber", "kind": "function", "doc": "

Build the housenumber field.

\n", "signature": "(tags: Dict[str, str]) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.collapse_list", "modulename": "atlus.atlus", "qualname": "collapse_list", "kind": "function", "doc": "

Remove duplicates in list while keeping order.

\n\n
\n
>>> collapse_list(["foo", "bar", "foo"])\n["foo", "bar"]\n
\n
\n\n
Arguments:
\n\n
    \n
  • seq (list): The list to collapse.
  • \n
\n\n
Returns:
\n\n
\n

list: The collapsed list.

\n
\n", "signature": "(seq: list) -> list:", "funcdef": "def"}, {"fullname": "atlus.atlus.split_unit", "modulename": "atlus.atlus", "qualname": "split_unit", "kind": "function", "doc": "

Split unit from address string, if present.

\n", "signature": "(address_string: str) -> Dict[str, str]:", "funcdef": "def"}, {"fullname": "atlus.atlus.remove_prefix", "modulename": "atlus.atlus", "qualname": "remove_prefix", "kind": "function", "doc": "

Remove prefix from string for Python 3.8.

\n", "signature": "(text: str, prefix: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.get_address", "modulename": "atlus.atlus", "qualname": "get_address", "kind": "function", "doc": "

Process address strings.

\n\n
\n
>>> get_address("345 MAPLE RD, COUNTRYSIDE, PA 24680-0198")[0]\n{"addr:housenumber": "345", "addr:street": "Maple Road",\n"addr:city": "Countryside", "addr:state": "PA", "addr:postcode": "24680-0198"}\n>>> get_address("777 Strawberry St.")[0]\n{"addr:housenumber": "777", "addr:street": "Strawberry Street"}\n>>> address = get_address("222 NW Pineapple Ave Suite A Unit B")\n>>> address[0]\n{"addr:housenumber": "222", "addr:street": "Northwest Pineapple Avenue"}\n>>> address[1]\n["addr:unit"]\n
\n
\n\n
Arguments:
\n\n
    \n
  • address_string (str): The address string to process.
  • \n
\n\n
Returns:
\n\n
\n

Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]:\n The processed address string and the removed fields.

\n
\n", "signature": "(\taddress_string: str) -> Tuple[Dict[str, Union[str, int]], List[Optional[str]]]:", "funcdef": "def"}, {"fullname": "atlus.atlus.get_phone", "modulename": "atlus.atlus", "qualname": "get_phone", "kind": "function", "doc": "

Format phone numbers to the US and Canadian standard format of +1 XXX-XXX-XXXX.

\n\n
\n
>>> get_phone("2029009019")\n"+1 202-900-9019"\n>>> get_phone("(202) 900-9019")\n"+1 202-900-9019"\n>>> get_phone("202-900-901")\nValueError: Invalid phone number: 202-900-901\n
\n
\n\n
Arguments:
\n\n
    \n
  • phone (str): The phone number to format.
  • \n
\n\n
Returns:
\n\n
\n

str: The formatted phone number.

\n
\n\n
Raises:
\n\n
    \n
  • ValueError: If the phone number is invalid.
  • \n
\n", "signature": "(phone: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.resources", "modulename": "atlus.resources", "kind": "module", "doc": "

Hold info for the processing script.

\n"}, {"fullname": "atlus.resources.direction_expand", "modulename": "atlus.resources", "qualname": "direction_expand", "kind": "variable", "doc": "

Compass direction abbreviations.

\n", "default_value": "{'NE': 'Northeast', 'SE': 'Southeast', 'NW': 'Northwest', 'SW': 'Southwest', 'N': 'North', 'E': 'East', 'S': 'South', 'W': 'West'}"}, {"fullname": "atlus.resources.name_expand", "modulename": "atlus.resources", "qualname": "name_expand", "kind": "variable", "doc": "

Common name abbreviations.

\n", "default_value": "{'ARPT': 'airport', 'BLDG': 'building', 'CONF': 'conference', 'CONV': 'convention', 'CNTR': 'center', 'CTR': 'center', 'DWTN': 'downtown', 'INTL': 'international', 'FT': 'fort', 'MT': 'mount', 'MTN': 'mountain', 'SHPG': 'shopping'}"}, {"fullname": "atlus.resources.state_expand", "modulename": "atlus.resources", "qualname": "state_expand", "kind": "variable", "doc": "

Map states to abbreviations.

\n", "default_value": "{'ALABAMA': 'AL', 'ALA': 'AL', 'ALASKA': 'AK', 'ALAS': 'AK', 'ARIZONA': 'AZ', 'ARIZ': 'AZ', 'ARKANSAS': 'AR', 'ARK': 'AR', 'CALIFORNIA': 'CA', 'CALIF': 'CA', 'CAL': 'CA', 'COLORADO': 'CO', 'COLO': 'CO', 'COL': 'CO', 'CONNECTICUT': 'CT', 'CONN': 'CT', 'DELAWARE': 'DE', 'DEL': 'DE', 'DISTRICT OF COLUMBIA': 'DC', 'FLORIDA': 'FL', 'FLA': 'FL', 'FLOR': 'FL', 'GEORGIA': 'GA', 'GA': 'GA', 'HAWAII': 'HI', 'IDAHO': 'ID', 'IDA': 'ID', 'ILLINOIS': 'IL', 'ILL': 'IL', 'INDIANA': 'IN', 'IND': 'IN', 'IOWA': 'IA', 'KANSAS': 'KS', 'KANS': 'KS', 'KAN': 'KS', 'KENTUCKY': 'KY', 'KEN': 'KY', 'KENT': 'KY', 'LOUISIANA': 'LA', 'MAINE': 'ME', 'MARYLAND': 'MD', 'MASSACHUSETTS': 'MA', 'MASS': 'MA', 'MICHIGAN': 'MI', 'MICH': 'MI', 'MINNESOTA': 'MN', 'MINN': 'MN', 'MISSISSIPPI': 'MS', 'MISS': 'MS', 'MISSOURI': 'MO', 'MONTANA': 'MT', 'MONT': 'MT', 'NEBRASKA': 'NE', 'NEBR': 'NE', 'NEB': 'NE', 'NEVADA': 'NV', 'NEV': 'NV', 'NEW HAMPSHIRE': 'NH', 'NEW JERSEY': 'NJ', 'NEW MEXICO': 'NM', 'N MEX': 'NM', 'NEW M': 'NM', 'NEW YORK': 'NY', 'NORTH CAROLINA': 'NC', 'NORTH DAKOTA': 'ND', 'N DAK': 'ND', 'OHIO': 'OH', 'OKLAHOMA': 'OK', 'OKLA': 'OK', 'OREGON': 'OR', 'OREG': 'OR', 'ORE': 'OR', 'PENNSYLVANIA': 'PA', 'PENN': 'PA', 'RHODE ISLAND': 'RI', 'SOUTH CAROLINA': 'SC', 'SOUTH DAKOTA': 'SD', 'S DAK': 'SD', 'TENNESSEE': 'TN', 'TENN': 'TN', 'TEXAS': 'TX', 'TEX': 'TX', 'UTAH': 'UT', 'VERMONT': 'VT', 'VIRGINIA': 'VA', 'WASHINGTON': 'WA', 'WASH': 'WA', 'WEST VIRGINIA': 'WV', 'W VA': 'WV', 'WISCONSIN': 'WI', 'WIS': 'WI', 'WISC': 'WI', 'WYOMING': 'WY', 'WYO': 'WY', 'ONTARIO': 'ON', 'QUEBEC': 'QC', 'NOVA SCOTIA': 'NS', 'NEW BRUNSWICK': 'NB', 'MANITOBA': 'MB', 'BRITISH COLUMBIA': 'BC', 'PRINCE EDWARD ISLAND': 'PE', 'PRINCE EDWARD': 'PE', 'SASKATCHEWAN': 'SK', 'ALBERTA': 'AB', 'NEWFOUNDLAND AND LABRADOR': 'NL', 'NEWFOUNDLAND & LABRADOR': 'NL', 'NEWFOUNDLAND': 'NL', 'YUKON': 'YK', 'NUNAVUT': 'NU', 'NORTHWEST TERRITORIES': 'NT', 'NW TERRITORIES': 'NT'}"}, {"fullname": "atlus.resources.street_expand", "modulename": "atlus.resources", "qualname": "street_expand", "kind": "variable", "doc": "

Common street type abbreviations.

\n", "default_value": "{'ACC': 'ACCESS', 'ALY': 'ALLEY', 'ANX': 'ANEX', 'ARC': 'ARCADE', 'AV': 'AVENUE', 'AVE': 'AVENUE', 'BYU': 'BAYOU', 'BCH': 'BEACH', 'BND': 'BEND', 'BLF': 'BLUFF', 'BLFS': 'BLUFFS', 'BTM': 'BOTTOM', 'BLVD': 'BOULEVARD', 'BR': 'BRANCH', 'BRG': 'BRIDGE', 'BRK': 'BROOK', 'BRKS': 'BROOKS', 'BG': 'BURG', 'BGS': 'BURGS', 'BYP': 'BYPASS', 'CP': 'CAMP', 'CY': 'KEY', 'CYN': 'CANYON', 'CPE': 'CAPE', 'CTR': 'CENTER', 'CTRS': 'CENTERS', 'CIR': 'CIRCLE', 'CIRS': 'CIRCLES', 'CLF': 'CLIFF', 'CLFS': 'CLIFFS', 'CLB': 'CLUB', 'CMN': 'COMMON', 'CMNS': 'COMMONS', 'COR': 'CORNER', 'CORS': 'CORNERS', 'CRSE': 'COURSE', 'CT': 'COURT', 'CTS': 'COURTS', 'CV': 'COVE', 'CVS': 'COVES', 'CRK': 'CREEK', 'CRES': 'CRESCENT', 'CRST': 'CREST', 'CSWY': 'CAUSEWAY', 'CURV': 'CURVE', 'DL': 'DALE', 'DM': 'DAM', 'DV': 'DIVIDE', 'DR': 'DRIVE', 'DRS': 'DRIVES', 'EST': 'ESTATE', 'EXPY': 'EXPRESSWAY', 'EXPWY': 'EXPRESSWAY', 'EXT': 'EXTENSION', 'EXTS': 'EXTENSIONS', 'FGR': 'FORGE', 'FGRS': 'FORGES', 'FLS': 'FALLS', 'FLD': 'FIELD', 'FLDS': 'FIELDS', 'FLT': 'FLAT', 'FLTS': 'FLATS', 'FRD': 'FORD', 'FRDS': 'FORDS', 'FRST': 'FOREST', 'FRG': 'FORGE', 'FRGS': 'FORGES', 'FRK': 'FORK', 'FRKS': 'FORKS', 'FRY': 'FERRY', 'FRYS': 'FERRYS', 'FOR': 'FORD', 'FORS': 'FORDS', 'FT': 'FORT', 'FWY': 'FREEWAY', 'GD': 'GRADE', 'GDN': 'GARDEN', 'GDNS': 'GARDENS', 'GTWY': 'GATEWAY', 'GLN': 'GLEN', 'GLNS': 'GLENS', 'GN': 'GREEN', 'GNS': 'GREENS', 'GRN': 'GREEN', 'GRNS': 'GREENS', 'GRV': 'GROVE', 'GRVS': 'GROVES', 'HBR': 'HARBOR', 'HBRS': 'HARBORS', 'HGWY': 'HIGHWAY', 'HVN': 'HAVEN', 'HTS': 'HEIGHTS', 'HWY': 'HIGHWAY', 'HL': 'HILL', 'HLS': 'HILLS', 'HOLW': 'HOLLOW', 'INLT': 'INLET', 'IS': 'ISLAND', 'ISS': 'ISLANDS', 'JCT': 'JUNCTION', 'JCTS': 'JUNCTIONS', 'KY': 'KEY', 'KYS': 'KEYS', 'KNL': 'KNOLL', 'KNLS': 'KNOLLS', 'LK': 'LAKE', 'LKS': 'LAKES', 'LNDG': 'LANDING', 'LN': 'LANE', 'LGT': 'LIGHT', 'LGTS': 'LIGHTS', 'LF': 'LOAF', 'LCK': 'LOCK', 'LCKS': 'LOCKS', 'LDG': 'LODGE', 'LP': 'LOOP', 'MNR': 'MANOR', 'MNRS': 'MANORS', 'MDW': 'MEADOW', 'MDWS': 'MEADOWS', 'ML': 'MILL', 'MLS': 'MILLS', 'MSN': 'MISSION', 'MTWY': 'MOTORWAY', 'MT': 'MOUNT', 'MTN': 'MOUNTAIN', 'MTNS': 'MOUNTAINS', 'NCK': 'NECK', 'ORCH': 'ORCHARD', 'OPAS': 'OVERPASS', 'PKY': 'PARKWAY', 'PKWY': 'PARKWAY', 'PSGE': 'PASSAGE', 'PNE': 'PINE', 'PNES': 'PINES', 'PL': 'PLACE', 'PLN': 'PLAIN', 'PLNS': 'PLAINS', 'PLZ': 'PLAZA', 'PT': 'POINT', 'PTS': 'POINTS', 'PRT': 'PORT', 'PRTS': 'PORTS', 'PR': 'PRAIRIE', 'PVT': 'PRIVATE', 'RADL': 'RADIAL', 'RNCH': 'RANCH', 'RPD': 'RAPID', 'RPDS': 'RAPIDS', 'RST': 'REST', 'RDG': 'RIDGE', 'RDGS': 'RIDGES', 'RIV': 'RIVER', 'RD': 'ROAD', 'RDS': 'ROADS', 'RT': 'ROUTE', 'RTE': 'ROUTE', 'SHL': 'SHOAL', 'SHLS': 'SHOALS', 'SHR': 'SHORE', 'SHRS': 'SHORES', 'SKWY': 'SKYWAY', 'SPG': 'SPRING', 'SPGS': 'SPRINGS', 'SQ': 'SQUARE', 'SQS': 'SQUARES', 'STA': 'STATION', 'STRA': 'STRAVENUE', 'STRM': 'STREAM', 'STS': 'STREETS', 'SMT': 'SUMMIT', 'SRVC': 'SERVICE', 'TER': 'TERRACE', 'TRWY': 'THROUGHWAY', 'THFR': 'THOROUGHFARE', 'TRCE': 'TRACE', 'TRAK': 'TRACK', 'TRFY': 'TRAFFICWAY', 'TRL': 'TRAIL', 'TRLR': 'TRAILER', 'TUNL': 'TUNNEL', 'TPKE': 'TURNPIKE', 'UPAS': 'UNDERPASS', 'UN': 'UNION', 'UNP': 'UNDERPASS', 'UNS': 'UNIONS', 'VIA': 'VIADUCT', 'VIAS': 'VIADUCTS', 'VLY': 'VALLEY', 'VLYS': 'VALLEYS', 'VW': 'VIEW', 'VWS': 'VIEWS', 'VLG': 'VILLAGE', 'VL': 'VILLE', 'VIS': 'VISTA', 'WK': 'WALK', 'WKWY': 'WALKWAY', 'WY': 'WAY', 'WL': 'WELL', 'WLS': 'WELLS', 'XING': 'CROSSING', 'XINGS': 'CROSSINGS', 'XRD': 'CROSSROAD', 'XRDS': 'CROSSROADS', 'YU': 'BAYOU'}"}, {"fullname": "atlus.resources.saints", "modulename": "atlus.resources", "qualname": "saints", "kind": "variable", "doc": "

Most common saint names.

\n", "default_value": "['Abigail', 'Agatha', 'Agnes', 'Andrew', 'Anthony', 'Augustine', 'Bernadette', 'Brigid', 'Catherine', 'Charles', 'Christopher', 'Clare', 'Cloud', 'Dymphna', 'Elizabeth', 'Faustina', 'Felix', 'Francis', 'Gabriel,', 'George', 'Gerard', 'James', 'Joan', 'John', 'Joseph', 'Jude', 'Kateri', 'Louis', 'Lucie', 'Lucy', 'Luke', 'Maria', 'Mark', 'Martin', 'Mary', 'Maximilian', 'Michael', 'Monica', 'Padre', 'Patrick', 'Paul', 'Peter', 'Philomena', 'Raphael', 'Rita', 'Rose', 'Sebastian', 'Teresa', 'Therese', 'Thomas', 'Valentine', 'Victor', 'Vincent']"}, {"fullname": "atlus.resources.bad_zip_first_3", "modulename": "atlus.resources", "qualname": "bad_zip_first_3", "kind": "variable", "doc": "

Three-digit combinations that don't represent a zip code.

\n", "default_value": "['001', '002', '003', '004', '213', '269', '343', '345', '348', '353', '419', '428', '429', '517', '518', '519', '529', '533', '536', '552', '568', '569', '578', '579', '589', '621', '632', '642', '643', '659', '663', '682', '694', '695', '696', '697', '698', '699', '702', '709', '715', '732', '742', '817', '818', '819', '839', '848', '849', '851', '854', '858', '861', '862', '866', '867', '868', '869', '876', '886', '887', '888', '892', '896', '899', '909', '929', '987']"}, {"fullname": "atlus.resources.ABBR_JOIN", "modulename": "atlus.resources", "qualname": "ABBR_JOIN", "kind": "variable", "doc": "

\n", "default_value": "'ARPT|BLDG|CONF|CONV|CNTR|CTR|DWTN|INTL|FT|MT|MTN|SHPG|ACC|ALY|ANX|ARC|AV|AVE|BYU|BCH|BND|BLF|BLFS|BTM|BLVD|BR|BRG|BRK|BRKS|BG|BGS|BYP|CP|CY|CYN|CPE|CTRS|CIR|CIRS|CLF|CLFS|CLB|CMN|CMNS|COR|CORS|CRSE|CT|CTS|CV|CVS|CRK|CRES|CRST|CSWY|CURV|DL|DM|DV|DR|DRS|EST|EXPY|EXPWY|EXT|EXTS|FGR|FGRS|FLS|FLD|FLDS|FLT|FLTS|FRD|FRDS|FRST|FRG|FRGS|FRK|FRKS|FRY|FRYS|FOR|FORS|FWY|GD|GDN|GDNS|GTWY|GLN|GLNS|GN|GNS|GRN|GRNS|GRV|GRVS|HBR|HBRS|HGWY|HVN|HTS|HWY|HL|HLS|HOLW|INLT|IS|ISS|JCT|JCTS|KY|KYS|KNL|KNLS|LK|LKS|LNDG|LN|LGT|LGTS|LF|LCK|LCKS|LDG|LP|MNR|MNRS|MDW|MDWS|ML|MLS|MSN|MTWY|MTNS|NCK|ORCH|OPAS|PKY|PKWY|PSGE|PNE|PNES|PL|PLN|PLNS|PLZ|PT|PTS|PRT|PRTS|PR|PVT|RADL|RNCH|RPD|RPDS|RST|RDG|RDGS|RIV|RD|RDS|RT|RTE|SHL|SHLS|SHR|SHRS|SKWY|SPG|SPGS|SQ|SQS|STA|STRA|STRM|STS|SMT|SRVC|TER|TRWY|THFR|TRCE|TRAK|TRFY|TRL|TRLR|TUNL|TPKE|UPAS|UN|UNP|UNS|VIA|VIAS|VLY|VLYS|VW|VWS|VLG|VL|VIS|WK|WKWY|WY|WL|WLS|XING|XINGS|XRD|XRDS|YU'"}, {"fullname": "atlus.resources.abbr_join_comp", "modulename": "atlus.resources", "qualname": "abbr_join_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex("(\\\\b(?:ARPT|BLDG|CONF|CONV|CNTR|CTR|DWTN|INTL|FT|MT|MTN|SHPG|ACC|ALY|ANX|ARC|AV|AVE|BYU|BCH|BND|BLF|BLFS|BTM|BLVD|BR|BRG|BRK|BRKS|BG|BGS|BYP|CP|CY|CYN|CPE|CTRS|CIR|CIRS|CLF|CLFS|CLB|CMN|CMNS|COR|CORS|CRSE|CT|CTS|CV|CVS|CRK|CRES|CRST|CSWY|CURV|DL|DM|DV|DR|DRS|EST|EXPY|EXPWY|EXT|EXTS|FGR|FGRS|FLS|FLD|FLDS|FLT|FLTS|FRD|FRDS|FRST|FRG|FRGS|FRK|FRKS|FRY|FRYS|FOR|FORS|FWY|GD|GDN|GDNS|GTWY|GLN|GLNS|GN|GNS|GRN|GRNS|GRV|GRVS|HBR|HBRS|HGWY|HVN|HTS|HWY|HL|HLS|HOLW|INLT|IS|ISS|JCT|JCTS|KY|KYS|KNL|KNLS|LK|LKS|LNDG|LN|LGT|LGTS|LF|LCK|LCKS|LDG|LP|MNR|MNRS|MDW|MDWS|ML|MLS|MSN|MTWY|MTNS|NCK|ORCH|OPAS|PKY|PKWY|PSGE|PNE|PNES|PL|PLN|PLNS|PLZ|PT|PTS|PRT|PRTS|PR|PVT|RADL|RNCH|RPD|RPDS|RST|RDG|RDGS|RIV|RD|RDS|RT|RTE|SHL|SHLS|SHR|SHRS|SKWY|SPG|SPGS|SQ|SQS|STA|STRA|STRM|STS|SMT|SRVC|TER|TRWY|THFR|TRCE|TRAK|TRFY|TRL|TRLR|TUNL|TPKE|UPAS|UN|UNP|UNS|VIA|VIAS|VLY|VLYS|VW|VWS|VLG|VL|VIS|WK|WKWY|WY|WL|WLS|XING|XINGS|XRD|XRDS|YU)\\\\b\\\\.?)(?!')", flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.DIR_FILL", "modulename": "atlus.resources", "qualname": "DIR_FILL", "kind": "variable", "doc": "

\n", "default_value": "'N\\\\.?E|S\\\\.?E|N\\\\.?W|S\\\\.?W|N|E|S|W'"}, {"fullname": "atlus.resources.dir_fill_comp", "modulename": "atlus.resources", "qualname": "dir_fill_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex("(?<!(?:^(?:Avenue) |[\\\\.']))(\\\\b(?:N\\\\.?E|S\\\\.?E|N\\\\.?W|S\\\\.?W|N|E|S|W)\\\\b\\\\.?)(?!(?:\\\\.?[a-zA-Z]| (?:Street|Avenue)))", flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.sr_comp", "modulename": "atlus.resources", "qualname": "sr_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('(\\\\bS\\\\.?R\\\\b\\\\.?)(?= \\\\d+)', flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.saint_comp", "modulename": "atlus.resources", "qualname": "saint_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('^(St\\\\.?)(?= )|(\\\\bSt\\\\.?)(?= (?:Abigail|Agatha|Agnes|Andrew|Anthony|Augustine|Bernadette|Brigid|Catherine|Charles|Christopher|Clare|Cloud|Dymphna|Elizabeth|Faustina|Felix|Francis|Gabriel,|George|Gerard|James|Joan|John|Joseph|Jude|Kateri|Louis|Lucie|Lucy|Luke|Maria|Mark|Martin|Mary|Maximilian|Michael|Monica|Padre|Patrick|Paul|Peter|Philomena|Raphael|Rita|Rose|Sebastian|Teresa|Therese|Thomas|Valentine|Victor|Vincent))', flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.street_comp", "modulename": "atlus.resources", "qualname": "street_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('St\\\\.?(?= [NESW]\\\\.?[EW]?\\\\.?)|(?<=\\\\d[thndstr]{2} )St\\\\.?\\\\b|St\\\\.?$', flags=regex.V0)"}, {"fullname": "atlus.resources.post_comp", "modulename": "atlus.resources", "qualname": "post_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('(\\\\d{5})-?0{4}', flags=regex.V0)"}, {"fullname": "atlus.resources.usa_comp", "modulename": "atlus.resources", "qualname": "usa_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex(',? (?:USA?|United States(?: of America)?|Canada)\\\\b', flags=regex.V0)"}, {"fullname": "atlus.resources.paren_comp", "modulename": "atlus.resources", "qualname": "paren_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex(' ?\\\\(.*\\\\)', flags=regex.V0)"}, {"fullname": "atlus.resources.grid_comp", "modulename": "atlus.resources", "qualname": "grid_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('\\\\b([NnSs]\\\\d{2,}\\\\s*[EeWw]\\\\d{2,}|[EeWw]\\\\d{2,}\\\\s*[NnSs]\\\\d{2,})\\\\b', flags=regex.V0)"}]; + /** pdoc search index */const docs = [{"fullname": "atlus", "modulename": "atlus", "kind": "module", "doc": "

atlus is a Python package to convert raw address and phone number strings into the OSM format.\nIt's designed to be used with US and Canadian phone numbers and addresses.

\n\n
\n
>>> import atlus\n>>> atlus.abbrs("St. Francis")\n"Saint Francis"\n>>> atlus.get_address("789 Oak Dr, Smallville California, 98765")[0]\n{"addr:housenumber": "789", "addr:street": "Oak Drive", "addr:city": "Smallville", "addr:state": "CA", "addr:postcode": "98765"}\n>>> atlus.get_phone("(202) 900-9019")\n"+1 202-900-9019"\n
\n
\n"}, {"fullname": "atlus.get_address", "modulename": "atlus", "qualname": "get_address", "kind": "function", "doc": "

Process address strings.

\n\n
\n
>>> get_address("345 MAPLE RD, COUNTRYSIDE, PA 24680-0198")[0]\n{"addr:housenumber": "345", "addr:street": "Maple Road",\n"addr:city": "Countryside", "addr:state": "PA", "addr:postcode": "24680-0198"}\n>>> get_address("777 Strawberry St.")[0]\n{"addr:housenumber": "777", "addr:street": "Strawberry Street"}\n>>> address = get_address("222 NW Pineapple Ave Suite A Unit B")\n>>> address[0]\n{"addr:housenumber": "222", "addr:street": "Northwest Pineapple Avenue"}\n>>> address[1]\n["addr:unit"]\n
\n
\n\n
Arguments:
\n\n
    \n
  • address_string (str): The address string to process.
  • \n
\n\n
Returns:
\n\n
\n

Tuple[Dict[str, str], List[Union[str, None]]]:\n The processed address string and the removed fields.

\n
\n", "signature": "(address_string: str) -> Tuple[Dict[str, str], List[Optional[str]]]:", "funcdef": "def"}, {"fullname": "atlus.get_phone", "modulename": "atlus", "qualname": "get_phone", "kind": "function", "doc": "

Format phone numbers to the US and Canadian standard format of +1 XXX-XXX-XXXX.

\n\n
\n
>>> get_phone("2029009019")\n"+1 202-900-9019"\n>>> get_phone("(202) 900-9019")\n"+1 202-900-9019"\n>>> get_phone("202-900-901")\nValueError: Invalid phone number: 202-900-901\n
\n
\n\n
Arguments:
\n\n
    \n
  • phone (str): The phone number to format.
  • \n
\n\n
Returns:
\n\n
\n

str: The formatted phone number.

\n
\n\n
Raises:
\n\n
    \n
  • ValueError: If the phone number is invalid.
  • \n
\n", "signature": "(phone: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.abbrs", "modulename": "atlus", "qualname": "abbrs", "kind": "function", "doc": "

Bundle most common abbreviation expansion functions.

\n\n
\n
>>> abbrs("St. Francis")\n"Saint Francis"\n>>> abbrs("E St.")\n"E Street"\n>>> abbrs("E Sewell St")\n"East Sewell Street"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value (str): String to expand.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.get_title", "modulename": "atlus", "qualname": "get_title", "kind": "function", "doc": "

Fix ALL-CAPS string.

\n\n
\n
>>> get_title("PALM BEACH")\n"Palm Beach"\n>>> get_title("BOSTON")\n"BOSTON"\n>>> get_title("BOSTON", single_word=True)\n"Boston"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
  • single_word: Whether the string should be fixed even if it is a single word.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str, single_word: bool = False) -> str:", "funcdef": "def"}, {"fullname": "atlus.mc_replace", "modulename": "atlus", "qualname": "mc_replace", "kind": "function", "doc": "

Fix string containing improperly formatted Mc- prefix.

\n\n
\n
>>> mc_replace("Fort Mchenry")\n"Fort McHenry"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.us_replace", "modulename": "atlus", "qualname": "us_replace", "kind": "function", "doc": "

Fix string containing improperly formatted US.

\n\n
\n
>>> us_replace("U.S. Route 15")\n"US Route 15"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.ord_replace", "modulename": "atlus", "qualname": "ord_replace", "kind": "function", "doc": "

Fix string containing improperly capitalized ordinal.

\n\n
\n
>>> ord_replace("3Rd St. NW")\n"3rd St. NW"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.remove_br_unicode", "modulename": "atlus", "qualname": "remove_br_unicode", "kind": "function", "doc": "

Clean the input string before sending to parser by removing newlines and unicode.

\n\n
Arguments:
\n\n
    \n
  • old (str): String to clean.
  • \n
\n\n
Returns:
\n\n
\n

str: Cleaned string.

\n
\n", "signature": "(old: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus", "modulename": "atlus.atlus", "kind": "module", "doc": "

Functions and tools to process the raw address strings.

\n"}, {"fullname": "atlus.atlus.toss_tags", "modulename": "atlus.atlus", "qualname": "toss_tags", "kind": "variable", "doc": "

Tags from the usaddress package to remove.

\n", "default_value": "['Recipient', 'IntersectionSeparator', 'LandmarkName', 'USPSBoxGroupID', 'USPSBoxGroupType', 'USPSBoxID', 'USPSBoxType', 'OccupancyType']"}, {"fullname": "atlus.atlus.osm_mapping", "modulename": "atlus.atlus", "qualname": "osm_mapping", "kind": "variable", "doc": "

Mapping from usaddress fields to OSM tags.

\n", "default_value": "{'AddressNumber': 'addr:housenumber', 'AddressNumberPrefix': 'addr:housenumber', 'AddressNumberSuffix': 'addr:housenumber', 'StreetName': 'addr:street', 'StreetNamePreDirectional': 'addr:street', 'StreetNamePreModifier': 'addr:street', 'StreetNamePreType': 'addr:street', 'StreetNamePostDirectional': 'addr:street', 'StreetNamePostModifier': 'addr:street', 'StreetNamePostType': 'addr:street', 'OccupancyIdentifier': 'addr:unit', 'PlaceName': 'addr:city', 'StateName': 'addr:state', 'ZipCode': 'addr:postcode'}"}, {"fullname": "atlus.atlus.get_title", "modulename": "atlus.atlus", "qualname": "get_title", "kind": "function", "doc": "

Fix ALL-CAPS string.

\n\n
\n
>>> get_title("PALM BEACH")\n"Palm Beach"\n>>> get_title("BOSTON")\n"BOSTON"\n>>> get_title("BOSTON", single_word=True)\n"Boston"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
  • single_word: Whether the string should be fixed even if it is a single word.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str, single_word: bool = False) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.us_replace", "modulename": "atlus.atlus", "qualname": "us_replace", "kind": "function", "doc": "

Fix string containing improperly formatted US.

\n\n
\n
>>> us_replace("U.S. Route 15")\n"US Route 15"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.mc_replace", "modulename": "atlus.atlus", "qualname": "mc_replace", "kind": "function", "doc": "

Fix string containing improperly formatted Mc- prefix.

\n\n
\n
>>> mc_replace("Fort Mchenry")\n"Fort McHenry"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.ord_replace", "modulename": "atlus.atlus", "qualname": "ord_replace", "kind": "function", "doc": "

Fix string containing improperly capitalized ordinal.

\n\n
\n
>>> ord_replace("3Rd St. NW")\n"3rd St. NW"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.name_street_expand", "modulename": "atlus.atlus", "qualname": "name_street_expand", "kind": "function", "doc": "

Expand matched street type abbreviations.

\n\n
Arguments:
\n\n
    \n
  • match (regex.Match): Matched string.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.direct_expand", "modulename": "atlus.atlus", "qualname": "direct_expand", "kind": "function", "doc": "

Expand matched directional abbreviations.

\n\n
Arguments:
\n\n
    \n
  • match (regex.Match): Matched string.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.cap_match", "modulename": "atlus.atlus", "qualname": "cap_match", "kind": "function", "doc": "

Make matches uppercase.

\n\n
Arguments:
\n\n
    \n
  • match (regex.Match): Matched string.
  • \n
\n\n
Returns:
\n\n
\n

str: Capitalized string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.lower_match", "modulename": "atlus.atlus", "qualname": "lower_match", "kind": "function", "doc": "

Lower-case improperly cased ordinal values.

\n\n
Arguments:
\n\n
    \n
  • value: String to fix.
  • \n
\n\n
Returns:
\n\n
\n

str: Fixed string.

\n
\n", "signature": "(match: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.grid_match", "modulename": "atlus.atlus", "qualname": "grid_match", "kind": "function", "doc": "

Clean grid addresses.

\n", "signature": "(match_str: _regex.Match) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.abbrs", "modulename": "atlus.atlus", "qualname": "abbrs", "kind": "function", "doc": "

Bundle most common abbreviation expansion functions.

\n\n
\n
>>> abbrs("St. Francis")\n"Saint Francis"\n>>> abbrs("E St.")\n"E Street"\n>>> abbrs("E Sewell St")\n"East Sewell Street"\n
\n
\n\n
Arguments:
\n\n
    \n
  • value (str): String to expand.
  • \n
\n\n
Returns:
\n\n
\n

str: Expanded string.

\n
\n", "signature": "(value: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.remove_br_unicode", "modulename": "atlus.atlus", "qualname": "remove_br_unicode", "kind": "function", "doc": "

Clean the input string before sending to parser by removing newlines and unicode.

\n\n
Arguments:
\n\n
    \n
  • old (str): String to clean.
  • \n
\n\n
Returns:
\n\n
\n

str: Cleaned string.

\n
\n", "signature": "(old: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.clean_address", "modulename": "atlus.atlus", "qualname": "clean_address", "kind": "function", "doc": "

Clean the input string before sending to parser by removing newlines and unicode.

\n\n
Arguments:
\n\n
    \n
  • address_string (str): String to clean.
  • \n
\n\n
Returns:
\n\n
\n

str: Cleaned string.

\n
\n", "signature": "(address_string: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.help_join", "modulename": "atlus.atlus", "qualname": "help_join", "kind": "function", "doc": "

Help to join address fields.

\n", "signature": "(tags, keep: List[str]) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.addr_street", "modulename": "atlus.atlus", "qualname": "addr_street", "kind": "function", "doc": "

Build the street field.

\n", "signature": "(tags: Dict[str, str]) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.addr_housenumber", "modulename": "atlus.atlus", "qualname": "addr_housenumber", "kind": "function", "doc": "

Build the housenumber field.

\n", "signature": "(tags: Dict[str, str]) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.collapse_list", "modulename": "atlus.atlus", "qualname": "collapse_list", "kind": "function", "doc": "

Remove duplicates in list while keeping order.

\n\n
\n
>>> collapse_list(["foo", "bar", "foo"])\n["foo", "bar"]\n
\n
\n\n
Arguments:
\n\n
    \n
  • seq (list): The list to collapse.
  • \n
\n\n
Returns:
\n\n
\n

list: The collapsed list.

\n
\n", "signature": "(seq: list) -> list:", "funcdef": "def"}, {"fullname": "atlus.atlus.split_unit", "modulename": "atlus.atlus", "qualname": "split_unit", "kind": "function", "doc": "

Split unit from address string, if present.

\n", "signature": "(address_string: str) -> Dict[str, str]:", "funcdef": "def"}, {"fullname": "atlus.atlus.remove_prefix", "modulename": "atlus.atlus", "qualname": "remove_prefix", "kind": "function", "doc": "

Remove prefix from string for Python 3.8.

\n", "signature": "(text: str, prefix: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.atlus.get_address", "modulename": "atlus.atlus", "qualname": "get_address", "kind": "function", "doc": "

Process address strings.

\n\n
\n
>>> get_address("345 MAPLE RD, COUNTRYSIDE, PA 24680-0198")[0]\n{"addr:housenumber": "345", "addr:street": "Maple Road",\n"addr:city": "Countryside", "addr:state": "PA", "addr:postcode": "24680-0198"}\n>>> get_address("777 Strawberry St.")[0]\n{"addr:housenumber": "777", "addr:street": "Strawberry Street"}\n>>> address = get_address("222 NW Pineapple Ave Suite A Unit B")\n>>> address[0]\n{"addr:housenumber": "222", "addr:street": "Northwest Pineapple Avenue"}\n>>> address[1]\n["addr:unit"]\n
\n
\n\n
Arguments:
\n\n
    \n
  • address_string (str): The address string to process.
  • \n
\n\n
Returns:
\n\n
\n

Tuple[Dict[str, str], List[Union[str, None]]]:\n The processed address string and the removed fields.

\n
\n", "signature": "(address_string: str) -> Tuple[Dict[str, str], List[Optional[str]]]:", "funcdef": "def"}, {"fullname": "atlus.atlus.get_phone", "modulename": "atlus.atlus", "qualname": "get_phone", "kind": "function", "doc": "

Format phone numbers to the US and Canadian standard format of +1 XXX-XXX-XXXX.

\n\n
\n
>>> get_phone("2029009019")\n"+1 202-900-9019"\n>>> get_phone("(202) 900-9019")\n"+1 202-900-9019"\n>>> get_phone("202-900-901")\nValueError: Invalid phone number: 202-900-901\n
\n
\n\n
Arguments:
\n\n
    \n
  • phone (str): The phone number to format.
  • \n
\n\n
Returns:
\n\n
\n

str: The formatted phone number.

\n
\n\n
Raises:
\n\n
    \n
  • ValueError: If the phone number is invalid.
  • \n
\n", "signature": "(phone: str) -> str:", "funcdef": "def"}, {"fullname": "atlus.resources", "modulename": "atlus.resources", "kind": "module", "doc": "

Hold info for the processing script.

\n"}, {"fullname": "atlus.resources.direction_expand", "modulename": "atlus.resources", "qualname": "direction_expand", "kind": "variable", "doc": "

Compass direction abbreviations.

\n", "default_value": "{'NE': 'Northeast', 'SE': 'Southeast', 'NW': 'Northwest', 'SW': 'Southwest', 'N': 'North', 'E': 'East', 'S': 'South', 'W': 'West'}"}, {"fullname": "atlus.resources.name_expand", "modulename": "atlus.resources", "qualname": "name_expand", "kind": "variable", "doc": "

Common name abbreviations.

\n", "default_value": "{'ARPT': 'airport', 'BLDG': 'building', 'CONF': 'conference', 'CONV': 'convention', 'CNTR': 'center', 'CTR': 'center', 'DWTN': 'downtown', 'INTL': 'international', 'FT': 'fort', 'MT': 'mount', 'MTN': 'mountain', 'SHPG': 'shopping'}"}, {"fullname": "atlus.resources.state_expand", "modulename": "atlus.resources", "qualname": "state_expand", "kind": "variable", "doc": "

Map states to abbreviations.

\n", "default_value": "{'ALABAMA': 'AL', 'ALA': 'AL', 'ALASKA': 'AK', 'ALAS': 'AK', 'ARIZONA': 'AZ', 'ARIZ': 'AZ', 'ARKANSAS': 'AR', 'ARK': 'AR', 'CALIFORNIA': 'CA', 'CALIF': 'CA', 'CAL': 'CA', 'COLORADO': 'CO', 'COLO': 'CO', 'COL': 'CO', 'CONNECTICUT': 'CT', 'CONN': 'CT', 'DELAWARE': 'DE', 'DEL': 'DE', 'DISTRICT OF COLUMBIA': 'DC', 'FLORIDA': 'FL', 'FLA': 'FL', 'FLOR': 'FL', 'GEORGIA': 'GA', 'GA': 'GA', 'HAWAII': 'HI', 'IDAHO': 'ID', 'IDA': 'ID', 'ILLINOIS': 'IL', 'ILL': 'IL', 'INDIANA': 'IN', 'IND': 'IN', 'IOWA': 'IA', 'KANSAS': 'KS', 'KANS': 'KS', 'KAN': 'KS', 'KENTUCKY': 'KY', 'KEN': 'KY', 'KENT': 'KY', 'LOUISIANA': 'LA', 'MAINE': 'ME', 'MARYLAND': 'MD', 'MASSACHUSETTS': 'MA', 'MASS': 'MA', 'MICHIGAN': 'MI', 'MICH': 'MI', 'MINNESOTA': 'MN', 'MINN': 'MN', 'MISSISSIPPI': 'MS', 'MISS': 'MS', 'MISSOURI': 'MO', 'MONTANA': 'MT', 'MONT': 'MT', 'NEBRASKA': 'NE', 'NEBR': 'NE', 'NEB': 'NE', 'NEVADA': 'NV', 'NEV': 'NV', 'NEW HAMPSHIRE': 'NH', 'NEW JERSEY': 'NJ', 'NEW MEXICO': 'NM', 'N MEX': 'NM', 'NEW M': 'NM', 'NEW YORK': 'NY', 'NORTH CAROLINA': 'NC', 'NORTH DAKOTA': 'ND', 'N DAK': 'ND', 'OHIO': 'OH', 'OKLAHOMA': 'OK', 'OKLA': 'OK', 'OREGON': 'OR', 'OREG': 'OR', 'ORE': 'OR', 'PENNSYLVANIA': 'PA', 'PENN': 'PA', 'RHODE ISLAND': 'RI', 'SOUTH CAROLINA': 'SC', 'SOUTH DAKOTA': 'SD', 'S DAK': 'SD', 'TENNESSEE': 'TN', 'TENN': 'TN', 'TEXAS': 'TX', 'TEX': 'TX', 'UTAH': 'UT', 'VERMONT': 'VT', 'VIRGINIA': 'VA', 'WASHINGTON': 'WA', 'WASH': 'WA', 'WEST VIRGINIA': 'WV', 'W VA': 'WV', 'WISCONSIN': 'WI', 'WIS': 'WI', 'WISC': 'WI', 'WYOMING': 'WY', 'WYO': 'WY', 'ONTARIO': 'ON', 'QUEBEC': 'QC', 'NOVA SCOTIA': 'NS', 'NEW BRUNSWICK': 'NB', 'MANITOBA': 'MB', 'BRITISH COLUMBIA': 'BC', 'PRINCE EDWARD ISLAND': 'PE', 'PRINCE EDWARD': 'PE', 'SASKATCHEWAN': 'SK', 'ALBERTA': 'AB', 'NEWFOUNDLAND AND LABRADOR': 'NL', 'NEWFOUNDLAND & LABRADOR': 'NL', 'NEWFOUNDLAND': 'NL', 'YUKON': 'YK', 'NUNAVUT': 'NU', 'NORTHWEST TERRITORIES': 'NT', 'NW TERRITORIES': 'NT'}"}, {"fullname": "atlus.resources.street_expand", "modulename": "atlus.resources", "qualname": "street_expand", "kind": "variable", "doc": "

Common street type abbreviations.

\n", "default_value": "{'ACC': 'ACCESS', 'ALY': 'ALLEY', 'ANX': 'ANEX', 'ARC': 'ARCADE', 'AV': 'AVENUE', 'AVE': 'AVENUE', 'BYU': 'BAYOU', 'BCH': 'BEACH', 'BND': 'BEND', 'BLF': 'BLUFF', 'BLFS': 'BLUFFS', 'BTM': 'BOTTOM', 'BLVD': 'BOULEVARD', 'BR': 'BRANCH', 'BRG': 'BRIDGE', 'BRK': 'BROOK', 'BRKS': 'BROOKS', 'BG': 'BURG', 'BGS': 'BURGS', 'BYP': 'BYPASS', 'CP': 'CAMP', 'CY': 'KEY', 'CYN': 'CANYON', 'CPE': 'CAPE', 'CTR': 'CENTER', 'CTRS': 'CENTERS', 'CIR': 'CIRCLE', 'CIRS': 'CIRCLES', 'CLF': 'CLIFF', 'CLFS': 'CLIFFS', 'CLB': 'CLUB', 'CMN': 'COMMON', 'CMNS': 'COMMONS', 'COR': 'CORNER', 'CORS': 'CORNERS', 'CRSE': 'COURSE', 'CT': 'COURT', 'CTS': 'COURTS', 'CV': 'COVE', 'CVS': 'COVES', 'CRK': 'CREEK', 'CRES': 'CRESCENT', 'CRST': 'CREST', 'CSWY': 'CAUSEWAY', 'CURV': 'CURVE', 'DL': 'DALE', 'DM': 'DAM', 'DV': 'DIVIDE', 'DR': 'DRIVE', 'DRS': 'DRIVES', 'EST': 'ESTATE', 'EXPY': 'EXPRESSWAY', 'EXPWY': 'EXPRESSWAY', 'EXT': 'EXTENSION', 'EXTS': 'EXTENSIONS', 'FGR': 'FORGE', 'FGRS': 'FORGES', 'FLS': 'FALLS', 'FLD': 'FIELD', 'FLDS': 'FIELDS', 'FLT': 'FLAT', 'FLTS': 'FLATS', 'FRD': 'FORD', 'FRDS': 'FORDS', 'FRST': 'FOREST', 'FRG': 'FORGE', 'FRGS': 'FORGES', 'FRK': 'FORK', 'FRKS': 'FORKS', 'FRY': 'FERRY', 'FRYS': 'FERRYS', 'FOR': 'FORD', 'FORS': 'FORDS', 'FT': 'FORT', 'FWY': 'FREEWAY', 'GD': 'GRADE', 'GDN': 'GARDEN', 'GDNS': 'GARDENS', 'GTWY': 'GATEWAY', 'GLN': 'GLEN', 'GLNS': 'GLENS', 'GN': 'GREEN', 'GNS': 'GREENS', 'GRN': 'GREEN', 'GRNS': 'GREENS', 'GRV': 'GROVE', 'GRVS': 'GROVES', 'HBR': 'HARBOR', 'HBRS': 'HARBORS', 'HGWY': 'HIGHWAY', 'HVN': 'HAVEN', 'HTS': 'HEIGHTS', 'HWY': 'HIGHWAY', 'HL': 'HILL', 'HLS': 'HILLS', 'HOLW': 'HOLLOW', 'INLT': 'INLET', 'IS': 'ISLAND', 'ISS': 'ISLANDS', 'JCT': 'JUNCTION', 'JCTS': 'JUNCTIONS', 'KY': 'KEY', 'KYS': 'KEYS', 'KNL': 'KNOLL', 'KNLS': 'KNOLLS', 'LK': 'LAKE', 'LKS': 'LAKES', 'LNDG': 'LANDING', 'LN': 'LANE', 'LGT': 'LIGHT', 'LGTS': 'LIGHTS', 'LF': 'LOAF', 'LCK': 'LOCK', 'LCKS': 'LOCKS', 'LDG': 'LODGE', 'LP': 'LOOP', 'MNR': 'MANOR', 'MNRS': 'MANORS', 'MDW': 'MEADOW', 'MDWS': 'MEADOWS', 'ML': 'MILL', 'MLS': 'MILLS', 'MSN': 'MISSION', 'MTWY': 'MOTORWAY', 'MT': 'MOUNT', 'MTN': 'MOUNTAIN', 'MTNS': 'MOUNTAINS', 'NCK': 'NECK', 'ORCH': 'ORCHARD', 'OPAS': 'OVERPASS', 'PKY': 'PARKWAY', 'PKWY': 'PARKWAY', 'PSGE': 'PASSAGE', 'PNE': 'PINE', 'PNES': 'PINES', 'PL': 'PLACE', 'PLN': 'PLAIN', 'PLNS': 'PLAINS', 'PLZ': 'PLAZA', 'PT': 'POINT', 'PTS': 'POINTS', 'PRT': 'PORT', 'PRTS': 'PORTS', 'PR': 'PRAIRIE', 'PVT': 'PRIVATE', 'RADL': 'RADIAL', 'RNCH': 'RANCH', 'RPD': 'RAPID', 'RPDS': 'RAPIDS', 'RST': 'REST', 'RDG': 'RIDGE', 'RDGS': 'RIDGES', 'RIV': 'RIVER', 'RD': 'ROAD', 'RDS': 'ROADS', 'RT': 'ROUTE', 'RTE': 'ROUTE', 'SHL': 'SHOAL', 'SHLS': 'SHOALS', 'SHR': 'SHORE', 'SHRS': 'SHORES', 'SKWY': 'SKYWAY', 'SPG': 'SPRING', 'SPGS': 'SPRINGS', 'SQ': 'SQUARE', 'SQS': 'SQUARES', 'STA': 'STATION', 'STRA': 'STRAVENUE', 'STRM': 'STREAM', 'STS': 'STREETS', 'SMT': 'SUMMIT', 'SRVC': 'SERVICE', 'TER': 'TERRACE', 'TRWY': 'THROUGHWAY', 'THFR': 'THOROUGHFARE', 'TRCE': 'TRACE', 'TRAK': 'TRACK', 'TRFY': 'TRAFFICWAY', 'TRL': 'TRAIL', 'TRLR': 'TRAILER', 'TUNL': 'TUNNEL', 'TPKE': 'TURNPIKE', 'UPAS': 'UNDERPASS', 'UN': 'UNION', 'UNP': 'UNDERPASS', 'UNS': 'UNIONS', 'VIA': 'VIADUCT', 'VIAS': 'VIADUCTS', 'VLY': 'VALLEY', 'VLYS': 'VALLEYS', 'VW': 'VIEW', 'VWS': 'VIEWS', 'VLG': 'VILLAGE', 'VL': 'VILLE', 'VIS': 'VISTA', 'WK': 'WALK', 'WKWY': 'WALKWAY', 'WY': 'WAY', 'WL': 'WELL', 'WLS': 'WELLS', 'XING': 'CROSSING', 'XINGS': 'CROSSINGS', 'XRD': 'CROSSROAD', 'XRDS': 'CROSSROADS', 'YU': 'BAYOU'}"}, {"fullname": "atlus.resources.saints", "modulename": "atlus.resources", "qualname": "saints", "kind": "variable", "doc": "

Most common saint names.

\n", "default_value": "['Abigail', 'Agatha', 'Agnes', 'Andrew', 'Anthony', 'Augustine', 'Bernadette', 'Brigid', 'Catherine', 'Charles', 'Christopher', 'Clare', 'Cloud', 'Dymphna', 'Elizabeth', 'Faustina', 'Felix', 'Francis', 'Gabriel,', 'George', 'Gerard', 'James', 'Joan', 'John', 'Joseph', 'Jude', 'Kateri', 'Louis', 'Lucie', 'Lucy', 'Luke', 'Maria', 'Mark', 'Martin', 'Mary', 'Maximilian', 'Michael', 'Monica', 'Padre', 'Patrick', 'Paul', 'Peter', 'Philomena', 'Raphael', 'Rita', 'Rose', 'Sebastian', 'Teresa', 'Therese', 'Thomas', 'Valentine', 'Victor', 'Vincent']"}, {"fullname": "atlus.resources.bad_zip_first_3", "modulename": "atlus.resources", "qualname": "bad_zip_first_3", "kind": "variable", "doc": "

Three-digit combinations that don't represent a zip code.

\n", "default_value": "['001', '002', '003', '004', '213', '269', '343', '345', '348', '353', '419', '428', '429', '517', '518', '519', '529', '533', '536', '552', '568', '569', '578', '579', '589', '621', '632', '642', '643', '659', '663', '682', '694', '695', '696', '697', '698', '699', '702', '709', '715', '732', '742', '817', '818', '819', '839', '848', '849', '851', '854', '858', '861', '862', '866', '867', '868', '869', '876', '886', '887', '888', '892', '896', '899', '909', '929', '987']"}, {"fullname": "atlus.resources.ABBR_JOIN", "modulename": "atlus.resources", "qualname": "ABBR_JOIN", "kind": "variable", "doc": "

\n", "default_value": "'ARPT|BLDG|CONF|CONV|CNTR|CTR|DWTN|INTL|FT|MT|MTN|SHPG|ACC|ALY|ANX|ARC|AV|AVE|BYU|BCH|BND|BLF|BLFS|BTM|BLVD|BR|BRG|BRK|BRKS|BG|BGS|BYP|CP|CY|CYN|CPE|CTRS|CIR|CIRS|CLF|CLFS|CLB|CMN|CMNS|COR|CORS|CRSE|CT|CTS|CV|CVS|CRK|CRES|CRST|CSWY|CURV|DL|DM|DV|DR|DRS|EST|EXPY|EXPWY|EXT|EXTS|FGR|FGRS|FLS|FLD|FLDS|FLT|FLTS|FRD|FRDS|FRST|FRG|FRGS|FRK|FRKS|FRY|FRYS|FOR|FORS|FWY|GD|GDN|GDNS|GTWY|GLN|GLNS|GN|GNS|GRN|GRNS|GRV|GRVS|HBR|HBRS|HGWY|HVN|HTS|HWY|HL|HLS|HOLW|INLT|IS|ISS|JCT|JCTS|KY|KYS|KNL|KNLS|LK|LKS|LNDG|LN|LGT|LGTS|LF|LCK|LCKS|LDG|LP|MNR|MNRS|MDW|MDWS|ML|MLS|MSN|MTWY|MTNS|NCK|ORCH|OPAS|PKY|PKWY|PSGE|PNE|PNES|PL|PLN|PLNS|PLZ|PT|PTS|PRT|PRTS|PR|PVT|RADL|RNCH|RPD|RPDS|RST|RDG|RDGS|RIV|RD|RDS|RT|RTE|SHL|SHLS|SHR|SHRS|SKWY|SPG|SPGS|SQ|SQS|STA|STRA|STRM|STS|SMT|SRVC|TER|TRWY|THFR|TRCE|TRAK|TRFY|TRL|TRLR|TUNL|TPKE|UPAS|UN|UNP|UNS|VIA|VIAS|VLY|VLYS|VW|VWS|VLG|VL|VIS|WK|WKWY|WY|WL|WLS|XING|XINGS|XRD|XRDS|YU'"}, {"fullname": "atlus.resources.abbr_join_comp", "modulename": "atlus.resources", "qualname": "abbr_join_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex("(\\\\b(?:ARPT|BLDG|CONF|CONV|CNTR|CTR|DWTN|INTL|FT|MT|MTN|SHPG|ACC|ALY|ANX|ARC|AV|AVE|BYU|BCH|BND|BLF|BLFS|BTM|BLVD|BR|BRG|BRK|BRKS|BG|BGS|BYP|CP|CY|CYN|CPE|CTRS|CIR|CIRS|CLF|CLFS|CLB|CMN|CMNS|COR|CORS|CRSE|CT|CTS|CV|CVS|CRK|CRES|CRST|CSWY|CURV|DL|DM|DV|DR|DRS|EST|EXPY|EXPWY|EXT|EXTS|FGR|FGRS|FLS|FLD|FLDS|FLT|FLTS|FRD|FRDS|FRST|FRG|FRGS|FRK|FRKS|FRY|FRYS|FOR|FORS|FWY|GD|GDN|GDNS|GTWY|GLN|GLNS|GN|GNS|GRN|GRNS|GRV|GRVS|HBR|HBRS|HGWY|HVN|HTS|HWY|HL|HLS|HOLW|INLT|IS|ISS|JCT|JCTS|KY|KYS|KNL|KNLS|LK|LKS|LNDG|LN|LGT|LGTS|LF|LCK|LCKS|LDG|LP|MNR|MNRS|MDW|MDWS|ML|MLS|MSN|MTWY|MTNS|NCK|ORCH|OPAS|PKY|PKWY|PSGE|PNE|PNES|PL|PLN|PLNS|PLZ|PT|PTS|PRT|PRTS|PR|PVT|RADL|RNCH|RPD|RPDS|RST|RDG|RDGS|RIV|RD|RDS|RT|RTE|SHL|SHLS|SHR|SHRS|SKWY|SPG|SPGS|SQ|SQS|STA|STRA|STRM|STS|SMT|SRVC|TER|TRWY|THFR|TRCE|TRAK|TRFY|TRL|TRLR|TUNL|TPKE|UPAS|UN|UNP|UNS|VIA|VIAS|VLY|VLYS|VW|VWS|VLG|VL|VIS|WK|WKWY|WY|WL|WLS|XING|XINGS|XRD|XRDS|YU)\\\\b\\\\.?)(?!')", flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.DIR_FILL", "modulename": "atlus.resources", "qualname": "DIR_FILL", "kind": "variable", "doc": "

\n", "default_value": "'N\\\\.?E|S\\\\.?E|N\\\\.?W|S\\\\.?W|N|E|S|W'"}, {"fullname": "atlus.resources.dir_fill_comp", "modulename": "atlus.resources", "qualname": "dir_fill_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex("(?<!(?:^(?:Avenue) |[\\\\.']))(\\\\b(?:N\\\\.?E|S\\\\.?E|N\\\\.?W|S\\\\.?W|N|E|S|W)\\\\b\\\\.?)(?!(?:\\\\.?[a-zA-Z]| (?:Street|Avenue)))", flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.sr_comp", "modulename": "atlus.resources", "qualname": "sr_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('(\\\\bS\\\\.?R\\\\b\\\\.?)(?= \\\\d+)', flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.saint_comp", "modulename": "atlus.resources", "qualname": "saint_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('^(St\\\\.?)(?= )|(\\\\bSt\\\\.?)(?= (?:Abigail|Agatha|Agnes|Andrew|Anthony|Augustine|Bernadette|Brigid|Catherine|Charles|Christopher|Clare|Cloud|Dymphna|Elizabeth|Faustina|Felix|Francis|Gabriel,|George|Gerard|James|Joan|John|Joseph|Jude|Kateri|Louis|Lucie|Lucy|Luke|Maria|Mark|Martin|Mary|Maximilian|Michael|Monica|Padre|Patrick|Paul|Peter|Philomena|Raphael|Rita|Rose|Sebastian|Teresa|Therese|Thomas|Valentine|Victor|Vincent))', flags=regex.I | regex.V0)"}, {"fullname": "atlus.resources.street_comp", "modulename": "atlus.resources", "qualname": "street_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('St\\\\.?(?= [NESW]\\\\.?[EW]?\\\\.?)|(?<=\\\\d[thndstr]{2} )St\\\\.?\\\\b|St\\\\.?$', flags=regex.V0)"}, {"fullname": "atlus.resources.post_comp", "modulename": "atlus.resources", "qualname": "post_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('(\\\\d{5})-?0{4}', flags=regex.V0)"}, {"fullname": "atlus.resources.usa_comp", "modulename": "atlus.resources", "qualname": "usa_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex(',? (?:USA?|United States(?: of America)?|Canada)\\\\b', flags=regex.V0)"}, {"fullname": "atlus.resources.paren_comp", "modulename": "atlus.resources", "qualname": "paren_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex(' ?\\\\(.*\\\\)', flags=regex.V0)"}, {"fullname": "atlus.resources.grid_comp", "modulename": "atlus.resources", "qualname": "grid_comp", "kind": "variable", "doc": "

\n", "default_value": "regex.Regex('\\\\b([NnSs]\\\\d{2,}\\\\s*[EeWw]\\\\d{2,}|[EeWw]\\\\d{2,}\\\\s*[NnSs]\\\\d{2,})\\\\b', flags=regex.V0)"}]; // mirrored in build-search-index.js (part 1) // Also split on html tags. this is a cheap heuristic, but good enough. diff --git a/pyproject.toml b/pyproject.toml index da55718..8bc7122 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,9 +28,9 @@ classifiers = [ dependencies = ["usaddress", "regex"] [project.urls] -Documentation = "https://whubsch.github.io/atlus_py/index.html" -Issues = "https://github.com/whubsch/atlus_py/issues" -Source = "https://github.com/whubsch/atlus_py" +Documentation = "https://whubsch.github.io/atlus/index.html" +Issues = "https://github.com/whubsch/atlus/issues" +Source = "https://github.com/whubsch/atlus" [tool.hatch.version] path = "src/atlus/__about__.py" @@ -47,7 +47,7 @@ parallel = true omit = ["src/atlus/__about__.py"] [tool.coverage.paths] -atlus_py = ["src/atlus", "*/atlus_py/src/atlus"] +atlus = ["src/atlus", "*/atlus/src/atlus"] tests = ["tests", "*/atlus/tests"] [tool.coverage.report] diff --git a/scripts/make_docs.py b/scripts/make_docs.py index 6b5b194..f3bde30 100644 --- a/scripts/make_docs.py +++ b/scripts/make_docs.py @@ -10,7 +10,7 @@ pdoc.render.configure( docformat="google", footer_text="atlus", - favicon="https://whubsch.github.io/atlus_py/atlus_fav.svg", - logo="https://whubsch.github.io/atlus_py/logo_black.png", + favicon="https://whubsch.github.io/atlus/atlus_fav.svg", + logo="https://whubsch.github.io/atlus/logo_black.png", ) pdoc.pdoc("src/atlus", output_directory=here.parent / "docs") diff --git a/src/atlus/__about__.py b/src/atlus/__about__.py index d1233d3..cc9f9b4 100644 --- a/src/atlus/__about__.py +++ b/src/atlus/__about__.py @@ -1,3 +1,3 @@ -"""Top-level package for atlus_py.""" +"""Top-level package for atlus.""" -__version__ = "0.2.2" +__version__ = "0.2.3" diff --git a/src/atlus/atlus.py b/src/atlus/atlus.py index 171168e..5e6f8a8 100644 --- a/src/atlus/atlus.py +++ b/src/atlus/atlus.py @@ -407,7 +407,7 @@ def remove_prefix(text: str, prefix: str) -> str: def get_address( address_string: str, -) -> Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: +) -> Tuple[Dict[str, str], List[Union[str, None]]]: """Process address strings. ```python @@ -427,7 +427,7 @@ def get_address( address_string (str): The address string to process. Returns: - Tuple[Dict[str, Union[str, int]], List[Union[str, None]]]: + Tuple[Dict[str, str], List[Union[str, None]]]: The processed address string and the removed fields. """ try: