Skip to main content

FlexiblePlace

This package defines the FlexiblePlace object, which primarily does two things:

  1. Compare two FlexiblePlace objects and calculate a score that represents the likelihood that the two locations are the same place (compare_places).
  2. 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.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FlexiblePlace 1.0.3
File Size Uploaded
flexibleplace-1.0.3.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FlexiblePlace 1.0.3
File Interpreter ABI Platform
flexibleplace-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 37.1 kB

Release files / flexibleplace-1.0.3.tar.gz

Download URL flexibleplace-1.0.3.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
546d7331e33ca02796bf1501e17449f652f154c97478651dff34e4b258da9f0d
BLAKE2b-256 checksum
How to use checksums
9fcebd6bdde7647b963c2a853d76cc9879f6aa7e50ebf4cf0ffceabce6cc2fe6
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.3-py3-none-any.whl

Download URL flexibleplace-1.0.3-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60f461503b0d8d9f5a4ff6dd5e63f492cd6a7dd0391cfde849e55d659bada4e5
BLAKE2b-256 checksum
How to use checksums
e5f1a7fab96db5d889aaa23ecbf20676ec7710fa192cd0a7f5fd162237257402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page