Membership Map Issue#10#706
Open
darrellajenkins wants to merge 2 commits intoBlackPythonDevs:pycon-us-sprints-2025from
Open
Membership Map Issue#10#706darrellajenkins wants to merge 2 commits intoBlackPythonDevs:pycon-us-sprints-2025from
darrellajenkins wants to merge 2 commits intoBlackPythonDevs:pycon-us-sprints-2025from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link 🔗:
Issue: #10
Type of Change
Description 📋
What: Provide an overview of the issue this PR addresses. Explain the context and background information.
Why: Describe why the changes are being made. Highlight key updates, new features, or bug fixes.
How: Explain how these changes will affect the project or end-users.
Checklist ✅
pre-commit run --allAdditional Notes & Screenshots
Source data json file from:
https://github.com/bsrweb/geo-json-countries-mapbox/blob/master/countries/all-countries.json
See below starter code to create a membership map.
import json
with open("iso.json", "r") as file:
data = json.load(file)
def test_json():
for feature in data["features"]:
print(f"Type: {feature['type']}, A3: {feature['properties']['A3']}")
print(f"Geometry Type: {feature['geometry']['type']}")
print(f"Coordinates: {feature['geometry']['coordinates']}")
print("-" * 40)
ISO = { "US":"USA",
"UNITED KINGDOM":"GBR",
"CANADA":"CAN",
"KENYA":"KEN",
"NIGERIA":"NGA",
}
def test_bpd_countries():
for b in bpd_countries:
print(b)
def coord_finder(code):
for coord in data["features"]:
if coord["properties"]["A3"] == code:
return coord["geometry"]["coordinates"]
bpd_countries = [
{ "country_name":"US",
"country_code": ISO["US"],
"events":["PyTexas","PyOhio"],
"members":8,
"coord": coord_finder(ISO["US"])},
test_json()
test_bpd_countries()