Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cuts a 3.1 release #64

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8, 3.9, '3.10']

steps:
- uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.4

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rposborne, thank you for the shoutout!

I was using this file on my branch because I use pyenv. This file need not be checked in.

8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
black = "==19.10b0"
black = "==22.3.0"
flake8 = "*"
importlib_metadata = {version = "*", markers = "python_version < '3.8'"}
pytest = "*"
pytz = "*"
requests = "<3.0"
typing-extensions = "*"

[packages]
jellyfish = "==0.7.2"

jellyfish = "==0.9.0"

[pipenv]
allow_prereleases = true
allow_prereleases = true
281 changes: 131 additions & 150 deletions Pipfile.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ commits to the repo. To run these tests yourself: ::
Changelog
---------

4.0.0
~~~~~

* upgrade to jellyfish 0.9.0
* adds Python 3.10 support


3.0.0
~~~~~

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="us",
version="3.0.0",
version="4.0.0",
author="Jeremy Carbaugh",
author_email="[email protected]",
url="https://github.com/unitedstates/python-us",
Expand All @@ -13,12 +13,13 @@
license="BSD",
packages=find_packages(),
include_package_data=True,
install_requires=["jellyfish==0.7.2"],
install_requires=["jellyfish==0.9.0"],
entry_points={"console_scripts": ["states = us.cli.states:main"]},
platforms=["any"],
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)
28 changes: 14 additions & 14 deletions us/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def __str__(self) -> str:
return self.name

def shapefile_urls(self) -> Optional[Dict[str, str]]:
""" Shapefiles are available directly from the US Census Bureau:
https://www.census.gov/cgi-bin/geo/shapefiles/index.php
"""Shapefiles are available directly from the US Census Bureau:
https://www.census.gov/cgi-bin/geo/shapefiles/index.php
"""

fips = self.fips
Expand All @@ -66,22 +66,22 @@ def shapefile_urls(self) -> Optional[Dict[str, str]]:


def lookup(val, field: Optional[str] = None, use_cache: bool = True) -> Optional[State]:
""" Semi-fuzzy state lookup. This method will make a best effort
attempt at finding the state based on the lookup value provided.
"""Semi-fuzzy state lookup. This method will make a best effort
attempt at finding the state based on the lookup value provided.

* two digits will search for FIPS code
* two letters will search for state abbreviation
* anything else will try to match the metaphone of state names
* two digits will search for FIPS code
* two letters will search for state abbreviation
* anything else will try to match the metaphone of state names

Metaphone is used to allow for incorrect, but phonetically accurate,
spelling of state names.
Metaphone is used to allow for incorrect, but phonetically accurate,
spelling of state names.

Exact matches can be done on any attribute on State objects by passing
the `field` argument. This skips the fuzzy-ish matching and does an
exact, case-sensitive comparison against the specified field.
Exact matches can be done on any attribute on State objects by passing
the `field` argument. This skips the fuzzy-ish matching and does an
exact, case-sensitive comparison against the specified field.

This method caches non-None results, but can the cache can be bypassed
with the `use_cache=False` argument.
This method caches non-None results, but can the cache can be bypassed
with the `use_cache=False` argument.
"""

matched_state = None
Expand Down