https://github.com/vincentchov/lansweeper_flask
An extension to the Lansweeper SQL Server front end
https://github.com/vincentchov/lansweeper_flask
lansweeper ms-sql-server python records sql
Last synced: about 2 months ago
JSON representation
An extension to the Lansweeper SQL Server front end
- Host: GitHub
- URL: https://github.com/vincentchov/lansweeper_flask
- Owner: vincentchov
- Created: 2017-06-23T14:13:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T14:11:58.000Z (over 7 years ago)
- Last Synced: 2025-10-10T22:42:40.436Z (5 months ago)
- Topics: lansweeper, ms-sql-server, python, records, sql
- Language: Python
- Homepage:
- Size: 570 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lansweeper-Flask
This project uses Kenneth Reitz's [Records](https://github.com/kennethreitz/records)
library in addition to PyODBC to connect to the lansweeperdb Microsoft SQL Server database.
Records makes it easier to export results of SQL queries and make it easier to
explore the database to learn its schema. It uses ```docopt``` to handle argument parsing
so you can use it as a command-line application, or launch a Flask web interface.
## Setup from source code
1. Install [Python 3.x](https://www.python.org/downloads/) with pip.
2. Install [Microsoft ODBC Driver 11 for SQL Server](https://www.microsoft.com/en-us/download/details.aspx?id=36434)
which you may already have in Windows, but typically not in other systems.
2. If you're in Windows, open up the Data Sources program. If you're in Linux,
edit the ~/.odbc.ini file in the next step.
3. Create a DSN (Data Source Name) called ```PSI-SQL-DSN``` that connects to the ```PSI-SQL```
server, defaulting to the ```lansweeperdb``` database and use SQL authentication.
4. Update the ```server``` variable to match the name of the DSN if you chose
something other than ```PSI-SQL-DSN```.
6. Create and activate a virtual environment
7. Install dependencies: ```pip install -r requirements.txt```
8. Profit!
## How to get a report (command-line)
All you have to do is run ```lansweeper_all.py``` and enter the number for the
report type you want when asked for it. For example, if you want to see a
table for Administrative / Business Development tickets, activate your virtual
environment and then run ```python lansweeper_all.py``` at which point it will
list out the different options. Enter 0 and hit enter. The resulting table
will be placedin a .xlsx file in the Reports folder called ```admin_bus_dev.xlsx```.
## How to get a report (web-interface)
Launch the Flask web app by running ```python run.py``` and visit the application
in your web browser at ```localhost:5000```. From there you can click on the report
type you would like.