FlexiblePlace
This package defines the FlexiblePlace object, which primarily does two things:
- Compare two FlexiblePlace objects and calculate a score that represents the likelihood that the two locations are the same place (
compare_places). - Combine a list of FlexiblePlace objects into a single FlexiblePlace object that represents the closest match to all of the FlexiblePlace objects provided (
combine_flexible_places).
Initialization
The FlexiblePlace object is effectively a wrapper class of a string array. This object can be instantiated by providing either a string representation of a location (e.g. 'Walla Walla, Washington, United States'), or a string array representation of a location (e.g. ['Walla Walla', 'Washington', 'United States']). The Python version of this class also has the ability to lookup and add the FamilySearch "place description" (effectively an ID associated with a singular geographical location the FamilySearch database).
from FlexiblePlace.src.FlexiblePlace import FlexiblePlace
fp1 = FlexiblePlace("Walla Walla, Washington, United States")
print(fp1) # Walla Walla, Washington, United States
fp2 = FlexiblePlace(["Walla Walla", "Washington", "United States"])
print(fp2) # Walla Walla, Washington, United States
print(fp1 == fp2) # True
online_fp = FlexiblePlace.online("Walla Walla, Washington, United States")
print(online_fp.place_description) # 396089
print(fp1.place_description) #
compare_places
This static method is used to calculate a score out of 100 that represents how likely two FlexiblePlace objects refer to the same location. Locations of differing specificity, but with otherwise agreeing information, are a 100% match.
from FlexiblePlace.src.FlexiblePlace import FlexiblePlace
compare_places = FlexiblePlace.compare_places
walla_walla = FlexiblePlace("Walla Walla, Washington, United States")
washington = FlexiblePlace("Washington, United States")
united_states = FlexiblePlace("United States")
print(compare_places(walla_walla, washington)) # 100.0
print(washington.compare(united_states)) # 100.0
combine_flexible_places
This static method is used to combine a list of FlexiblePlace objects to create a single FlexiblePlace object that represents the closest (and most specific) match of all the provided FlexiblePlace objects. The Python version of this method has the ability to lookup and add the FamilySearch "place description"
from FlexiblePlace.src.FlexiblePlace import FlexiblePlace
combine_flexible_places = FlexiblePlace.combine_flexible_places
walla_walla = FlexiblePlace("Walla Walla, Washington")
washington = FlexiblePlace("Washington, United States")
united_states = FlexiblePlace("United States")
dc = FlexiblePlace("Washington, D.C.")
combined_place = combine_flexible_places([walla_walla, washington, united_states, dc])
print(combined_place) # Walla Walla, Washington, United States
online_combined_place = combine_flexible_places_online([walla_walla, washington, united_states, dc])
print(online_combined_place.place_description) # 396089
Release files for FlexiblePlace 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flexibleplace-1.0.2.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flexibleplace-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.4 kB
Release files / flexibleplace-1.0.2.tar.gz
| Download URL | flexibleplace-1.0.2.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8278b785baf60a787ef8da77e4d76d2a7f05f4dbf35cd15d93548aa9dff1e49b
|
|
BLAKE2b-256 checksum How to use checksums |
7b6786e559e1ef229ab50e9208cacc6a64ad526f70857ba645fe6c98dc3db707
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / flexibleplace-1.0.2-py3-none-any.whl
| Download URL | flexibleplace-1.0.2-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a721529f6481542950e9c1bada006e836c7459a81f4e9bc22799a9706f12636a
|
|
BLAKE2b-256 checksum How to use checksums |
c6ee1bb52a7928e52a1c3ee2f9af1d899794ee5e6d41ebbfc227cca8778f30e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|