Address
Developer docs
A class to represent an address
Source code in src/whitepyges/address.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 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 |
|
__init__
Initialize a new Address object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
street | str | The street of the address | None |
city | str | The city of the address | None |
state | str | The state of the address | None |
zip_code | str | The zip code of the address | None |
Returns:
Type | Description |
---|---|
None | None |
Source code in src/whitepyges/address.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
__repr__
Return the string representation of the object
Returns:
Name | Type | Description |
---|---|---|
str | str | The string representation of the object |
Source code in src/whitepyges/address.py
107 108 109 110 111 112 113 114 115 |
|
__str__
Return the string representation of the object
Returns:
Name | Type | Description |
---|---|---|
str | str | The string representation of the object |
Source code in src/whitepyges/address.py
117 118 119 120 121 122 123 124 125 |
|
search
Perform a search for the address
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timeout | int | The timeout for the request. Defaults to 10. | 10 |
max_retries | int | The maximum number of retries. Defaults to 3. | 3 |
randomize_headers | bool | Randomize the headers for the request. Defaults to False. | False |
ignore_robots | bool | Ignore the robots.txt file. Defaults to False. | False |
Returns:
Type | Description |
---|---|
list[dict] | None | list[dict] | None: Possible data for the address |
Source code in src/whitepyges/address.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 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 |
|
Features
- Search for residents at a specific address
- Returns names, profile URLs, and ages (if available)
- Handles request retries and optional header randomization
Example Usage
from whitepyges import Address
address: Address = Address(street='123 Test Street', city='New York', state='NY')
info: dict = address.search()
print(info)
Example Response
[
{
"name": "Jon Doe",
"url": "https://www.whitepages.com/name/Jon-Doe/Example-WA/random_numbers",
"age": "22"
},
{
"name": "Jon Doe-2",
"url": "https://www.whitepages.com/name/Jon-Doe-2/Example-WA/random_numbers-2",
"age": null
}
]