Coder Social home page Coder Social logo

johnnyrei / python-api-rest Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 10.29 MB

This project is a Flask application that connects to a Microsoft SQL Server database using pyodbc and retrieves data from a table. The retrieved data is then returned as a JSON response.

License: MIT License

Python 99.27% C 0.11% JavaScript 0.15% CSS 0.09% Tcl 0.35% PowerShell 0.02% Batchfile 0.02%
api api-rest flask odbc pyodbc python

python-api-rest's Introduction

🐍Python API REST

Description

This project is a Flask application that connects to a Microsoft SQL Server database using pyodbc and retrieves data from a table. The retrieved data is then returned as a JSON response.

Prerequisites

To run this project, you need to have the following prerequisites installed:

  • Python 3
  • Flask
  • pyodbc
  • ODBC Driver 17 for SQL Server

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/your-project.git
    
  2. Change to the project directory:

    cd your-project
    
  3. Install the required dependencies:

    pip install flask pyodbc
    
  4. Configure the database connection:

    • Open the app.py file in a text editor.
    • Modify the following variables with your database connection details:
      • server: The server name or IP address where your SQL Server is hosted.
      • database: The name of the database you want to connect to.
      • username: The username to authenticate with the database.
      • password: The password for the provided username.
    • Save the changes.

Usage

  1. Run the Flask application:

    python app.py
    
  2. Open a web browser and navigate to http://localhost:5000.

  3. The application will retrieve data from the specified table in the database and return it as a JSON response.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please submit a pull request.

License

This project is licensed under the MIT License.

python-api-rest's People

Contributors

johnnyrei avatar

Watchers

 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.