Skip to main content
https://raw.githubusercontent.com/caputomarcos/tsp-rest-api-server/master/logotipo-pickngo.png

tsp-rest-api-server

TSP Rest Api Server - Rest Api Server using Dijsktra’s algorithm applied to travelling salesman problem.

License

Licensed under the MIT License.

Install

Follow the steps below to get everything up and running.

pip

  1. Create project folder:

    $ mkdir tsp-rest-api-server && cd tsp-rest-api-server
  2. Create virtualenv in the normal way:

    $ virtualenv env --python=python
  3. Active your new virtualenv:

    $ source env/bin/activate
  4. Install tsp-rest-api-server:

    $ pip install tsp-rest-api-server
  5. Create setting file:

    $ tsp_rest_api_server settings
  6. Set EVE_SETTINGS:

    $ export EVE_SETTINGS=$PWD/settings.py
  7. Run tsp rest api server:

    $ tsp_rest_api_server runserver

Git

  1. Clone repository:

    $ git clone git@github.com:caputomarcos/tsp_rest_api_server.git
  2. Go to tsp_rest_api_server source folder:

    $ cd tsp-rest-api-server/
  3. Create virtualenv in the normal way:

    $ virtualenv env --python=python
  4. Active your new virtualenv:

    $ source env/bin/activate
  5. Create dev environment:

    $ make develop

Usage

  1. Create routes:

    $ curl -d "@map.json"  -H "Content-Type: application/json" -X POST http://0.0.0.0:5000/maps
    
    or
    
    $ curl -d '{ "title":"Sao Paulo", "routes":[{"origin":"A","destiny":"B","distance":10},{"origin":"B","destiny":"D","distance":15},{"origin":"A","destiny":"C","distance":20},{"origin":"C","destiny":"D","distance":30},{"origin":"B","destiny":"E","distance":50},{"origin":"D","destiny":"E","distance":30}]}' -H "Content-Type: application/json" -X POST http://0.0.0.0:5000/maps
  2. Search shortest route:

    $ curl 'http://0.0.0.0:5000/maps/shortest?map=Sao%20Paulo&origin=A&destiny=D&price=2.50&autonomy=10'
    
    {
      "data": [
        {
          "Path": "['A', 'B', 'D']"
        },
        {
          "Total KM": "25.00"
        },
        {
          "Cost": "6.25"
        }
      ]
    }

Drop all mongodb databases

# dropall.js

var dbs = db.getMongo().getDBNames()
for(var i in dbs){
    db = db.getMongo().getDB( dbs[i] );
    print( "dropping db " + db.getName() );
    db.dropDatabase();
}

usage

mongo dropall.js

refs

Metadata

Release files for tsp-rest-api-server 3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tsp-rest-api-server 3.6
File Size Uploaded Provenance Actions
tsp_rest_api_server-3.6.macosx-10.12-intel.tar.gz 9.3 kB Without provenance Details for tsp_rest_api_server-3.6.macosx-10.12-intel.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tsp-rest-api-server 3.6
File Interpreter ABI Platform Actions
tsp_rest_api_server-3.6-py2-none-any.whl Python 2 none any Details for tsp_rest_api_server-3.6-py2-none-any.whl

Total release size: 18.1 kB

Release files / tsp_rest_api_server-3.6.macosx-10.12-intel.tar.gz

Download URL tsp_rest_api_server-3.6.macosx-10.12-intel.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
53a44e2f2e3eddaab96c49cbd9445e168cc38b962f96ef44cda589cfca02277a
BLAKE2b-256 checksum
How to use checksums
fe7479b54e8706cb4fc30e61b043e7d4ed6100a4ff33328e932c9d9c600f5cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / tsp_rest_api_server-3.6-py2-none-any.whl

Download URL tsp_rest_api_server-3.6-py2-none-any.whl
Size 8.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
1e91fdee8c1c45c7285ff5a700ddcdf00b6e2f117e982d8d0ad4f5e248e074af
BLAKE2b-256 checksum
How to use checksums
52690c9941564e2510de48c5858f8c5aa4e6c631d5a7134e554fd932c0f1bcc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for tsp-rest-api-server 3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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