New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

distances-calculator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distances-calculator

Calculate distances between 2 addresses, Distances Calculator is based on open street map api.

  • 0.1.3
  • PyPI
  • Socket score

Maintainers
1

Distances Calculator

This is a distance calculator between 2 addressed, it is based on openstreetmap api.

Getting start

  • install, pip install distances-calculator
  • uninstall pip uninstall distances-calculator

get distance between 2 addresses

2 parameters,

  • address 1
  • address 2
distances-calc "125 Queen St, Auckland, 0620" "127 Queen St, Auckland, 0620"

calculate the distance between a table's data

2 parameters,

  • address, the center, the original address
  • path, the absolute path of your csv file
distances_writer "125 Queen St, Auckland, 0620" "/home/Username/test.csv"

example of distance_writer

table test.csv

idaddress
01 Fontenoy Street, Mount Albert, Auckland 1025
13A Fontenoy Street, Mount Albert, Auckland 1025

after running distances_writer "125 Queen St, Auckland, 0620" "/home/Username/test.csv"

new table test.csv will be

idaddressdistance_to_139 Carrington Rd, Mount Albert, Auckland 1025
01 Fontenoy Street, Mount Albert, Auckland 10250.447789551786935
13A Fontenoy Street, Mount Albert, Auckland 10250.471488332032505
P.S.

in your csv table, there should be one column named address, and the writer can create a new column named distance_to_<address>

How to calculate distance

Based on coordinate

Earth is a sphere, so we can use simple triangle function to calculate a not accurate distance, but most of time, this direct distance is good enough.

Based on open street map api (in future)

this can be used to calculate route distance.

APIxcode

  • extract_coordinate
  • get_distance
  • write_into
  • github public repo
  • pypi distribution

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc