Skip to main content

Top-level package for TopoJoin.

Project description

https://img.shields.io/pypi/v/topojoin.svg https://img.shields.io/travis/SimmonsRitchie/topojoin.svg Documentation Status

A lightweight utility to left join topojson data with CSV data.

Install

pip install topojoin

Basic usage

Command line

In the command line, enter the topojoin command followed by the path to your topojson file and your CSV file.

By default topojoin will assume both files have a common field called ‘id’ that can be joined.

topojoin example.json example.csv

>> Joining example.csv to example.json...
>> CSV key 'id' will be joined with topojson key 'id'
>> Joined data saved to: joined.json

To define the join keys, use the ‘-tk’ option for the key in your topojson file and the ‘-ck’ option for the key in your CSV file:

topojoin -tk GEOID -ck fips example.json example.csv

>> Joining example.csv to example.json...
>> CSV key 'fips' will be joined with topojson key 'GEOID'
>> Joined data saved to: joined.json

Programmatic

If you prefer, you can also import and call topojson from a python script:

from topojoin.topojoin import TopoJoin

topojoin_obj = TopoJoin("./example.json", "./example.", topo_key="GEOID", csv_key="fips")
result = topojoin_obj.join()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topojoin-0.2.0.tar.gz (20.7 kB view hashes)

Uploaded Source

Built Distribution

topojoin-0.2.0-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page