MCPcopy Create free account
hub / github.com/MacHu-GWU/uszipcode-project / by_prefix

Method by_prefix

uszipcode/search.py:596–611  ·  view source on GitHub ↗

Search zipcode information by first N digits. Returns multiple results.

(self,
                  prefix,
                  zipcode_type=ZipcodeType.Standard,
                  sort_by=SimpleZipcode.zipcode.name,
                  ascending=True,
                  returns=DEFAULT_LIMIT)

Source from the content-addressed store, hash-verified

594 return self.zip_klass()
595
596 def by_prefix(self,
597 prefix,
598 zipcode_type=ZipcodeType.Standard,
599 sort_by=SimpleZipcode.zipcode.name,
600 ascending=True,
601 returns=DEFAULT_LIMIT):
602 """
603 Search zipcode information by first N digits.
604
605 Returns multiple results.
606 """
607 return self.query(
608 prefix=prefix,
609 sort_by=sort_by, zipcode_type=zipcode_type,
610 ascending=ascending, returns=returns,
611 )
612
613 def by_pattern(self,
614 pattern,

Callers 3

test_by_prefixMethod · 0.80
test_no_limitMethod · 0.80
test_edge_caseMethod · 0.80

Calls 1

queryMethod · 0.95

Tested by 3

test_by_prefixMethod · 0.64
test_no_limitMethod · 0.64
test_edge_caseMethod · 0.64