Skip to main content

A demo command line tool for displaying information from a comma or pipe delimited file from a fictional Company named Outdoor.sy

Project description

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
                        Path 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

outdoorsy-1.0.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

outdoorsy-1.0.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file outdoorsy-1.0.0.tar.gz.

File metadata

  • Download URL: outdoorsy-1.0.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for outdoorsy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 97871f48cc33b5694e74943ffdc4616b596ef909df2711f35f58dd20765c5572
MD5 4ce8319a9e56e12d4c9b9ddcb6d9f8e1
BLAKE2b-256 2412f42477dee4ce82f05f360c990876defcfbd7732ab77f1fac44f48af76a7b

See more details on using hashes here.

File details

Details for the file outdoorsy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: outdoorsy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for outdoorsy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f18bc6a3f2fa7c6f38312147a752f8e4ea8f88d1045c61c6038ddc544d7016b
MD5 9885aad2ee27056bdc04d0d4c860b65d
BLAKE2b-256 c13ebaf343214bfd2e6ea22afc6de5796fb3b7d54d3ad9b5f97cb38c5c74f653

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page