Skip to main content

agrc-sweeper PyPI versionPush Events

The data cleaning service.

sweeper_sm

Available Sweepers

Addresses

Checks that addresses have minimum required parts and optionally normalizes them.

Duplicates

Checks for duplicate features.

Empties

Checks for empty geometries.

Metadata

Checks to make sure that the metadata meets the Basic SGID Metadata Requirements.

Tags

Checks to make sure that existing tags are cased appropriately. This mean that the are title-cased other than known abbreviations (e.g. UGRC, BLM) and articles (e.g. a, the, of).

This check also verifies that the data set contains a tag that matches the database name (e.g. SGID) and the schema (e.g. Cadastre).

--try-fix adds missing required tags and title-cases any existing tags.

Summary

Checks to make sure that the summary is less than 2048 characters (a limitation of AGOL) and that it is shorter than the description.

Description

Checks to make sure that the description contains a link to a data page on gis.utah.gov.

Use Limitations

Checks to make sure that the text in this section matches the official text for UGRC.

--try-fix updates the text to match the official text.

Parsing Addresses

This project contains a module that can be used as a standalone address parser, sweeper.address_parser. This allows developer to take advantage of sweepers advanced address parsing and normalization without having to run the entire sweeper process.

Usage Example

from sweeper.address_parser import Address

address = Address('123 South Main Street')
print(address)

'''
--> Parsed Address:
{'address_number': '123',
 'normalized': '123 S MAIN ST',
 'prefix_direction': 'S',
 'street_name': 'MAIN',
 'street_type': 'ST'}
'''

Available Address class properties

All properties default to None if there is no parsed value.

address_number

address_number_suffix

prefix_direction

street_name

street_direction

street_type

unit_type

unit_id If no unit_type is found, this property is prefixed with # (e.g. # 3). If unit_type is found, # is stripped from this property.

city

zip_code

po_box The PO Box if a po-box-type address was entered (e.g. po_box would be 1 for p.o. box 1).

normalized A normalized string representing the entire address that was passed into the constructor. PO Boxes are normalized in this format PO BOX <number>.

Installation (requires Pro 2.7+)

  1. clone arcgis conda environment
    • conda create -name sweeper --clone arcgispro-py3
  2. activate environment
    • activate sweeper
  3. install sweeper
    • pip install agrc-sweeper

Development

  1. clone arcgis conda environment
    • conda create -name sweeper --clone arcgispro-py3
  2. activate environment
    • activate sweeper
  3. test_metadata.py uses a SQL database that needs to be restored via src/sweeper/tests/data/Sweeper.bak to your local SQL Server.

Installing dependencies

  1. clone arcgis conda environment
    • conda create -name sweeper --clone arcgispro-py3
  2. install only required dependencies to run sweeper
    • pip install -e .
  3. install required dependencies to work on sweeper
    • pip install -e ".[develop]"
  4. install required dependencies to run sweeper tests
    • pip install -e ".[tests]"
  5. run tests: pytest

Metadata

Release files for agrc-sweeper 1.4.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 agrc-sweeper 1.4.3
File Size Uploaded
agrc-sweeper-1.4.3.tar.gz 21.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agrc-sweeper 1.4.3
File Interpreter ABI Platform
agrc_sweeper-1.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 47.5 kB

Release files / agrc-sweeper-1.4.3.tar.gz

Download URL agrc-sweeper-1.4.3.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4a4b2ed4594e85a54b572d6f777668ec1d587ec3eea056aeb9cd43bb6e7b8411
BLAKE2b-256 checksum
How to use checksums
5fae8bef5cde01d589ab89a66b86e411c611b59a885e726060b907392b091074
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / agrc_sweeper-1.4.3-py3-none-any.whl

Download URL agrc_sweeper-1.4.3-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad8ca8d7acdbb0a89af406a4df0a3d4c7e4435bdccf1c1303c986b13025a6c88
BLAKE2b-256 checksum
How to use checksums
356bc9d6272f71dd2593e422ff02cb9dab4ffed15e6600df6a9c42b0226a7870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release history Release notifications | RSS feed

2.0.0

2 release files

This release

1.4.3 This release

2 release files

1.4.1

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.0

3 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

1 release file

1.0.4

1 release file

1.0.3

2 release files

1.0.2

1 release file

1.0.1

1 release file

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