GithubHelp home page GithubHelp logo

rachaelcrook / outdoorsy Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 39 KB

A demo command line tool for displaying information from a comma or pipe delimited file.

License: MIT License

Python 100.00%

outdoorsy's Introduction

Outdoorsy Command-Line Tool

Introduction

A demo command line tool for displaying information from a comma or pipe delimited file.

Features

  • Use as command-line tool interactively or by passing arguments
  • Creates a local SQL Lite Database for storing files
  • Database is created from the running directory or optionally a specified flag
  • View database in a table format from the command-line
  • Sort by "Name" or "Vehicle Type" columns (from sample files)

Installation

Grab a copy of the code with pip:

pip install outdoorsy

Usage

outdoorsy can be used to extract info from a Comma or Pipe delimited file in two ways:

  • Command line/Terminal tool ran interactively outdoorsy
  • Command line/Terminal tool ran with arguments outdoorsy -h

1. Command Line/Terminal tool

outdoorsy

Run outdoorsy -h to see the help output:

outdoorsy -h

usage:

usage: outdoorsy [-h] [-f FILE] [-d {comma,pipe}] [-db DBPATH] [-v] [-s {name,vehicle_type}] [--version]

Outdoorsy Command Line tool for displaying Outdoorsy user information.

Arguments

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

options - Upload a new file.:
  -f FILE, --file FILE  Full path to file
  -d {comma,pipe}, --delimiter {comma,pipe}
                        File's delimiter
  -db DBPATH, --dbpath DBPATH
                        Directory to create database. Defaults to current directory

options - View and Sort data:
  -v, --view            View the Outdoorsy Customer Table.
  -s {name,vehicle_type}, --sort {name,vehicle_type}
                        Sort the database table by the Outdoorsy Customer's Fullname or Vehicle Type                       

Examples

Upload CSV file to database

outdoorsy -f C:\folder\file.csv -d comma

Upload Pipe delimited file to database

outdoorsy -f C:\folder\pipes.text -d pipe

Upload Pipe delimited file to database created at specified path

outdoorsy -f C:\folder\pipes.text -d pipe -db C:\database\

View data that has previously been uploaded to the database

outdoorsy -v

View data that has previously been uploaded to the database at specified path

outdoorsy -v -db C:\database\

View data sorted by Vehicle Type

outdoorsy -v -s vehicle_type

View data sorted by name

outdoorsy -v -s name

Future Enhancements

  • Update --dbpath argument to --dbdir to make it clear the user needs to specify the directory
  • Add additional tests
  • Add logic to handle duplicate database entries
  • Add the ability to sort by any column
  • Depending on customer needs, add support for different headers and file types (outside of comma or pipe delimited)
  • Convert to click library (currently using argparse)
  • Build CI/CD pipeline for releases using GitHub Actions
  • Optimize the logic for argparse and interactive menu so that it's more efficient and avoid duplicates in code
  • Move the default used for db_path from the database functions to the argparse argument. This would allow efficiency gains in argparse and when running interactively since a dbpath would always be specified

License

This program is licensed with an MIT License.

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.