Skip to main content

Simple CLI for Native-Land API

Project description

pynative: Simple CLI for native-land.ca API

PyPI - License PyPI - Downloads PyPI CI pynative

Table of contents

Installation

This assumes that you have native python & pip installed in your system, you can test this by going to the terminal (or windows command prompt) and trying

python and then pip list

pynative only support Python v3.4 or higher

To install pynative: Simple CLI for Native Land API you can install using two methods.

pip install pynative

or you can also try

git clone https://github.com/samapriya/pynative.git
cd pynative
python setup.py install

For Linux use sudo or try pip install pynative --user.

I recommend installation within a virtual environment. Find more information on creating virtual environments here.

Getting started

As usual, to print help:

pynative -h
usage: pynative [-h] {fetch,location,place} ...

Simple CLI for Native Land API

positional arguments:
  {fetch,location,place}
    fetch               Download most updated map and type as GeoJSON file
    location            Search using lat long pair location for data and
                        download as GeoJSON file
    place               Search using a place name or address and download as
                        GeoJSON file

optional arguments:
  -h, --help            show this help message and exit

To obtain help for specific functionality, simply call it with help switch, e.g.: pynative location -h. If you didn't install pynative, then you can run it just by going to pynative directory and running python pynative.py [arguments go here]

pynative Simple CLI for Native Land API

The tool is designed to interact with the Native-Land API. All of these APIs are open and function without authentication.

Native Land Disclaimer

This map does not represent or intend to represent official or legal boundaries of any Indigenous nations. To learn about definitive boundaries, contact the nations in question. Also, this map is not perfect -- it is a work in progress with tons of contributions from the community. Please send us fixes if you find errors. If you would like to read more about the ideas behind Native Land or where we are going, check out the blog. You can also see the roadmap. Also something to keep in mind

  • Native Land is not meant to be vetted at the level of an academic resource
  • Native Land is aimed at settlers to engage them with Indigenous history in a fun, interactive, and subtle way The datasets are always in flux and the latest datasets can be downloaded using their API

Suggested Citation

(dataset) Native Land Territories map. (2021). Native Land CA. https://native-land.ca/. Accessed 2021-09-24.

pynative fetch

This allows you to fetch the latest version of territories, language and treaties layers. It tries to fetch this from the dynamic data link and if that fails uses the maps endpoints to fetch this. It requires the map type and the full path to a GeoJSON file where the output will be exported

usage: pynative fetch [-h] --mtype MTYPE --path PATH

optional arguments:
  -h, --help     show this help message and exit

Required named arguments.:
  --mtype MTYPE  Map type territories|languages|treaties
  --path PATH    Full path to map.geojson

Example usage:

pynative fetch --mtype territories --path "full path to file.geojson"

pynative location

This is a more custom fetch for the dataset which allows you to fetch a subset of the overall maps based on the lat long location. The tool requires a comma seperate latitude,longitude and full path to a GeoJSON file.

pynative location -h
usage: pynative location [-h] --ll ... --mtype MTYPE --path PATH

optional arguments:
  -h, --help     show this help message and exit

Required named arguments.:
  --ll ...       Comma seperated latitude,longitude
  --mtype MTYPE  Map type territories|languages|treaties
  --path PATH    Full path to map.geojson

Example usage:

pynative location --mtype languages --path "full path to map.geojson" --ll 40.6938609,-89.5891008

pynative place

This is an extension of the location tool , it can convert an address into a lat long pair and thallows you to fetch a subset of the overall maps based on the lat long location based on whether or not datasets are available for that location. The tool requires an address and makes use of the Open Street map API to get the lat long pair and full path to a GeoJSON file.

pynative place -h
usage: pynative place [-h] --addr ADDR --mtype MTYPE --path PATH

optional arguments:
  -h, --help     show this help message and exit

Required named arguments.:
  --addr ADDR    Comma seperate place name or address
  --mtype MTYPE  Map type territories|languages|treaties
  --path PATH    Full path to map.geojson

Example usage

pynative place --addr "Raleigh,NC" --mtype territories --path "Full path to file.geojson"

changelog

v0.0.3

  • added improvements overall to all tools
  • general improvements

v0.0.2

  • added improvements overall to all tools
  • added place tool search for location using address
  • extended functionality to fetch and convert to GeoJSON object
  • general improvements

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

pynative-0.0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

pynative-0.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pynative-0.0.3.tar.gz.

File metadata

  • Download URL: pynative-0.0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/47.1.0 requests-toolbelt/0.8.0 tqdm/4.33.0 CPython/3.7.9

File hashes

Hashes for pynative-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8891ad4cba826dc2dc8d4a498a164621bc7194bc8f84cba4a2daafd77f155206
MD5 bfb56f1de09042e61002083d4d4dd44b
BLAKE2b-256 86d84f1a52bd20c5c20ff31a2a617ef88b080e155ad6e9e5f4d782bf3d9cffdd

See more details on using hashes here.

File details

Details for the file pynative-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pynative-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/47.1.0 requests-toolbelt/0.8.0 tqdm/4.33.0 CPython/3.7.9

File hashes

Hashes for pynative-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 efdba4330d424e404e14b2341706af5142b1b0decb1457547001dede4fea5c6e
MD5 af786fed1d1ae884c61ca1a73574af84
BLAKE2b-256 53494ab5aeb4ce0c7916700a7776269ef083edb205c7eb211575a2914e2e7b3e

See more details on using hashes here.

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