{"id":13623141,"url":"https://github.com/DamonOehlman/addressit","last_synced_at":"2025-04-15T14:32:00.140Z","repository":{"id":2654307,"uuid":"3644889","full_name":"DamonOehlman/addressit","owner":"DamonOehlman","description":"Freeform Street Address Parser","archived":false,"fork":false,"pushed_at":"2023-04-24T13:27:06.000Z","size":253,"stargazers_count":95,"open_issues_count":11,"forks_count":28,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-06T11:11:15.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npm.runkit.com/addressit","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DamonOehlman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-03-07T02:06:18.000Z","updated_at":"2025-01-30T23:15:23.000Z","dependencies_parsed_at":"2023-07-09T17:46:57.186Z","dependency_job_id":null,"html_url":"https://github.com/DamonOehlman/addressit","commit_stats":{"total_commits":98,"total_committers":13,"mean_commits":7.538461538461538,"dds":0.3571428571428571,"last_synced_commit":"abbc31ad2f01d5eb4cc06025915e7a6287819776"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Faddressit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Faddressit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Faddressit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Faddressit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DamonOehlman","download_url":"https://codeload.github.com/DamonOehlman/addressit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249088901,"owners_count":21210880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:28.631Z","updated_at":"2025-04-15T14:31:59.856Z","avatar_url":"https://github.com/DamonOehlman.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# addressit\n\nAddressIt is a freeform street address parser, that is designed to take a\npiece of text and convert that into a structured address that can be\nprocessed in different systems.\n\nThe focal point of `addressit` is on the street parsing component, rather\nthan attempting to appropriately identify various states, counties, towns,\netc, as these vary from country to country fairly dramatically. These\ndetails are instead put into a generic regions array that can be further\nparsed based on your application needs.\n\n\n[![NPM](https://nodei.co/npm/addressit.png)](https://nodei.co/npm/addressit/)\n\n[![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/dominictarr/stability#stable)\n\n## Example Usage\n\nThe following is a simple example of how address it can be used:\n\n```js\nconst addressit = require('addressit');\n\n// parse a made up address, with some slightly tricky parts\nconst address = addressit('Shop 8, 431 St Kilda Rd Melbourne');\n\n// now log that address to the console\nconsole.log(address)\n```\n\nThe `address` object would now contain the following information:\n\n```\n{ text: '8/431 ST KILDA RD MELBOURNE',\n  parts: [],\n  unit: 8,\n  country: undefined,\n  number: 431,\n  street: 'ST KILDA RD',\n  regions: [ 'MELBOURNE' ] }\n```\n\nFor more examples, see the tests.\n\n## Reference\n\n### addressit(input, opts?)\n\nRun the address parser for the given input.  Optional `opts` can be\nsupplied if you want to override the default (EN) parser.\n\n### Address\n\n#### Address#_extractStreetParts(startIndex)\n\nThis function is used to extract from the street type match\nindex *back to* the street number and possibly unit number fields.\n\nThe function will start with the street type, then also grab the previous\nfield regardless of checks.  Fields will continue to be pulled in until\nfields start satisfying numeric checks.  Once positive numeric checks are\nfiring, those will be brought in as building / unit numbers and once the\nstart of the parts array is reached or we fall back to non-numeric fields\nthen the extraction is stopped.\n\n#### Address#clean\n\nThe clean function is used to clean up an address string.  It is designed\nto remove any parts of the text that preven effective parsing of the\naddress string.\n\n#### Address#extract(fieldName, regexes)\n\nThe extract function is used to extract the specified field from the raw\nparts that have previously been split from the input text.  If successfully\nlocated then the field will be updated from the parts and that part removed\nfrom the parts list.\n\n#### Address#extractStreet\n\nThis function is used to parse the address parts and locate any parts\nthat look to be related to a street address.\n\n#### Address#finalize\n\nThe finalize function takes any remaining parts that have not been extracted\nas other information, and pushes those fields into a generic `regions` field.\n\n#### Address#split\n\nSplit the address into it's component parts, and remove any empty parts\n\n#### Address#toString\n\nConvert the address to a string representation\n\n## License(s)\n\n### MIT\n\nCopyright (c) 2023 Damon Oehlman \u003cdamon.oehlman@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDamonOehlman%2Faddressit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDamonOehlman%2Faddressit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDamonOehlman%2Faddressit/lists"}