Giter Site home page Giter Site logo

osya / ratequeryapi Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 70 KB

Flask-based HTTP API for Telnet

Python 80.02% HTML 19.98%
python postgresql psycopg2 sqlalchemy python3 injector pytest telnet flask-sqlalchemy webtest dependency-injection flask-script travis-ci python-decouple

ratequeryapi's Introduction

Rate Query API

Introduction

Build Status Coverage Status

This app implements a Flask-based HTTP API for working with Telnet. Telnet commands hardcoded in the view methods (in the get_vendors_for_destination() and in the get_vendor_rate())

Used technologies:

  • Testing:
    • Python & Flask
    • Telnet were injected via Flask-Injector and mocked via pytest-mock
    • Flask-WebTest also used
  • Travis CI

Installation

First, set your app's secret key as an environment variable. For example, example add the following to .bashrc or .bash_profile.

    export RATE_QUERY_API_SECRET='something-really-secret'

In your production environment, make sure the RATE_QUERY_API_ENV environment variable is set to "prod".

Then run the following commands to bootstrap your environment.

    git clone http://[email protected]/scm/rqa/alpha
    cd alpha
    pip install -r requirements/dev.txt
    python manage.py server

Usage

You can execute the following curls and get result:

curl http://149.56.132.178:5000/api/v1/GetVendorsForDestination/US%20Virgin%20Islands%20Proper
curl http://149.56.132.178:5000/api/v1/GetVendorRate/US%20Virgin%20Islands%20Proper

Shell

To open the interactive shell, run python manage.py shell

By default, you will have access to app model.

Tests

To run all tests, run

    python manage.py test

ratequeryapi's People

Contributors

osya avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.