Skip to content

Commit 4e156b7

Browse files
committed
add readme
1 parent 6dc3f39 commit 4e156b7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ docker pull ghcr.io/le0pard/postal_server:latest
1010

1111
## Usage
1212

13+
### Expand address
14+
1315
To expand address strings into normalized forms suitable for geocoder queries, use the `/expand` endpoint with the `address` query parameter. For example, to expand the address "Quatre-vingt-douze Ave des Ave des Champs-Élysées":
1416

1517
```bash
@@ -24,6 +26,42 @@ GET /expand?address=Quatre-vingt-douze%20Ave%20des%20Ave%20des%20Champs-Élysée
2426

2527
This will provide the expanded and normalized addresses ready for geocoding queries.
2628

29+
Support additional parameters:
30+
31+
- `languages`: An array of language codes (e.g., ["en", "fr"]) to help with expansion
32+
- `address_components`: A bitmask of address components to expand
33+
- `latin_ascii`: Transliterate to Latin ASCII (true/false)
34+
- `transliterate`: Transliterate to the script of the first language (true/false)
35+
- `strip_accents`: Strip accents from the address (true/false)
36+
- `decompose`: Decompose diacritics and other characters (true/false)
37+
- `lowercase`: Convert the address to lowercase (true/false)
38+
- `trim_string`: Trim leading and trailing whitespace (true/false)
39+
- `replace_word_hyphens`: Replace hyphens in words with spaces (true/false)
40+
- `delete_word_hyphens`: Delete hyphens in words (true/false)
41+
- `replace_numeric_hyphens`: Replace hyphens in numbers with spaces (true/false)
42+
- `delete_numeric_hyphens`: Delete hyphens in numbers (true/false)
43+
- `split_alpha_from_numeric`: Split alphabetic and numeric parts of the address (true/false)
44+
- `delete_final_periods`: Deletes final periods (true/false)
45+
- `delete_acronym_periods`: Deletes periods in acronyms (e.g., "U.S.A." -> "USA") (true/false)
46+
- `drop_english_possessives`: Drops "'s" from the end of tokens (e.g., "St. James's" -> "St. James") (true/false)
47+
- `delete_apostrophes`: Deletes apostrophes (true/false)
48+
- `expand_numex`: Expands numeric expressions (e.g., "Twenty-third" -> "23rd") (true/false)
49+
- `roman_numerals`: Converts Roman numerals to integers (e.g., "II" -> "2") (true/false)
50+
51+
You also can select which parts of the address to expand. If not provided, a default set of components is used
52+
53+
- `address_name`: The name of a venue, organization, or building
54+
- `address_house_number`: The house or building number
55+
- `address_street`: The street name
56+
- `address_po_box`: Post office box numbers
57+
- `address_unit`: An apartment, suite, or office number
58+
- `address_level`: A floor or level number
59+
- `address_entrance`: An entrance identifier, like "Lobby A"
60+
- `address_staircase`: A staircase identifier
61+
- `address_postal_code`: The postal code
62+
63+
### Parse address
64+
2765
To parse addresses into components, use the `/parse` endpoint with the `address` query parameter. For example, to parse the address "781 Franklin Ave Crown Heights Brooklyn NY 11216 USA":
2866

2967
```bash
@@ -61,8 +99,15 @@ GET /parse?address=781%20Franklin%20Ave%20Crown%20Heights%20Brooklyn%20NY%201121
6199
]
62100
```
63101

102+
Support additional parameters:
103+
104+
- `language`: The language of the address (e.g., "en")
105+
- `country`: The country of the address (e.g., "us")
106+
64107
This will break down the address into its [individual components](https://github.com/openvenues/libpostal?tab=readme-ov-file#parser-labels).
65108

109+
### Healthcheck
110+
66111
Endpoint `/health` can be use to check webserver healthcheck (like in k8s env):
67112

68113
```bash

0 commit comments

Comments
 (0)