Helpers
assign_address(entity, address)
Assign an Address entity to a given Entity. This sets address property
to the "full" property of the Address, assigns countries and sets
addressEntity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
StatementEntity
|
Any Entity that can have an address assigned to it |
required |
address
|
StatementEntity | None
|
The Address entity |
required |
Examples:
Returns: None
Source code in investigraph/helpers/addresses.py
format_address(summary=None, po_box=None, street=None, street2=None, street3=None, house=None, house_number=None, postal_code=None, city=None, county=None, state=None, state_district=None, state_code=None, country=None, country_code=None)
Given the components of a postal address, format it into a single line using some country-specific templating logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
summary
|
Optional[str]
|
A short description of the address. |
None
|
po_box
|
Optional[str]
|
The PO box/mailbox number. |
None
|
street
|
Optional[str]
|
The street or road name. |
None
|
street2
|
Optional[str]
|
The street or road name, line 2. |
None
|
street3
|
Optional[str]
|
The street or road name, line 3. |
None
|
house
|
Optional[str]
|
The descriptive name of the house. |
None
|
house_number
|
Optional[str]
|
The number of the house on the street. |
None
|
postal_code
|
Optional[str]
|
The postal code or ZIP code. |
None
|
city
|
Optional[str]
|
The city or town name. |
None
|
county
|
Optional[str]
|
The county or district name. |
None
|
state
|
Optional[str]
|
The state or province name. |
None
|
state_district
|
Optional[str]
|
The state or province district name. |
None
|
state_code
|
Optional[str]
|
The state or province code. |
None
|
country
|
Optional[str]
|
The name of the country (words, not ISO code). |
None
|
country_code
|
Optional[str]
|
A pre-normalized country code. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
A single-line string with the formatted address. |
Source code in investigraph/helpers/addresses.py
make_address(context, full=None, remarks=None, summary=None, po_box=None, street=None, street2=None, street3=None, city=None, place=None, postal_code=None, state=None, region=None, country=None, country_code=None, key=None, lang=None)
Generate an address schema object adjacent to the main entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
SourceContext
|
The runner context used for making and emitting entities. |
required |
full
|
Optional[str]
|
The full address as a single string. |
None
|
remarks
|
Optional[str]
|
Delivery remarks for the address. |
None
|
summary
|
Optional[str]
|
A short description of the address. |
None
|
po_box
|
Optional[str]
|
The PO box/mailbox number. |
None
|
street
|
Optional[str]
|
The street or road name. |
None
|
street2
|
Optional[str]
|
The street or road name, line 2. |
None
|
street3
|
Optional[str]
|
The street or road name, line 3. |
None
|
city
|
Optional[str]
|
The city or town name. |
None
|
place
|
Optional[str]
|
The name of a smaller locality (same as city). |
None
|
postal_code
|
Optional[str]
|
The postal code or ZIP code. |
None
|
state
|
Optional[str]
|
The state or province name. |
None
|
region
|
Optional[str]
|
The region or district name. |
None
|
country
|
Optional[str]
|
The country name (words, not ISO code). |
None
|
country_code
|
Optional[str]
|
A pre-normalized country code. |
None
|
key
|
Optional[str]
|
An optional key to be included in the ID of the address. |
None
|
lang
|
Optional[str]
|
The language of the address details. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[StatementEntity]
|
A new entity of type |
Source code in investigraph/helpers/addresses.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |