Skip to main content

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

Metadata

Release files for pynative 0.0.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 pynative 0.0.3
File Size Uploaded
pynative-0.0.3.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynative 0.0.3
File Interpreter ABI Platform
pynative-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / pynative-0.0.3.tar.gz

Download URL pynative-0.0.3.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8891ad4cba826dc2dc8d4a498a164621bc7194bc8f84cba4a2daafd77f155206
BLAKE2b-256 checksum
How to use checksums
86d84f1a52bd20c5c20ff31a2a617ef88b080e155ad6e9e5f4d782bf3d9cffdd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pynative-0.0.3-py3-none-any.whl

Download URL pynative-0.0.3-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efdba4330d424e404e14b2341706af5142b1b0decb1457547001dede4fea5c6e
BLAKE2b-256 checksum
How to use checksums
53494ab5aeb4ce0c7916700a7776269ef083edb205c7eb211575a2914e2e7b3e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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