Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.
/ csv-log-merge Public archive

A command-line utility for combining CSV files with a given header.

License

Notifications You must be signed in to change notification settings

TecKnow/csv-log-merge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csv-log-merge

This is an archive This project remains here for demonstration and educational purposes.

This is a command line utility for combining CSV files with a parituclar header. It supports recursive searches. Default behavior is specified in a per-user configuration file and can be overriden with command line options.

This project is a useful demonstration of the following Python tools and packages:

  • Python package management using venv and requirements.txt
  • Standalone executables using pyinstaller
  • Command line argument parsing using argparse
  • User-editable configuration files using configparser
  • Modern Python file system operations using pathlib

Setting up for development

Technologies used

To set this project up localy for development work you will need some familiarity with the following tools:

  • git and github
  • python virtual environments with venv
  • requirements.txt files and pip

Procedure

This procedure assumes that you are working on a Windows machine

  1. Make sure that you have python installed and accessible from the command line.
  2. Make sure that you have git installed and accessible from the command line. You may need to type python3 or just python. This procedure will just say python.
  3. On the upper right corner of the project's github page linked above there should be a button labeled Clone. Press it and copy the URL provided. We'll call that the REPO_PATH
  4. In a terminal on your local machine with git installed, navigate to the directory where you would like the project to live. Enter git clone REPO_PATH.
  5. This should download the repository to your local machine from github.
  6. Navigate into the top level of the repository, it should be a folder called cperkins-csv-log.
  7. In this directory enter python -m venv venv.
  8. There will be a short delay.
  9. At the command line enter venv\scripts\activate
  10. Your prompt should now have something like (venv) at the beginning of it.
  11. Enter python -m pip install --upgrade pip
  12. Enter python -m pip install -r requirements.txt
  13. This will download the project's dependencies.
  14. Enter "python -m pip install -e ."
    1. The (.) second argument is important here.
  15. Enter python -m pytest
  16. Congratulations. If there were no errors you should now be ready to work on the project.
  17. When you're finished working in the virtual environment, enter deactivate to leave it.

Building the user application

  1. Follow the instructions above and make sure that you're still in the virtual environment.
  2. Your prompt will have something like (venv) at the beginning of it.
  3. Enter the following command, where program name is the name you would like the executable to have: pyinstaller --onefile --name <program_name> src\csvlog\command_line.py
  4. Quite a bit of output will go scrolling past your terminal.
  5. If the process is sucessful, you will see something like the following:
2517 INFO: Appending archive to EXE D:\Users\teckn\PycharmProjects\cperkins\cperkins-csv-log\dist\program_name.exe
2530 INFO: Building EXE from EXE-00.toc completed successfully.
  1. To The EXE file in the dist directory is the application.
  2. To see that it worked, enter the following command: dist\<program_name>.exe --help
  3. You should see the program's help text.

About

A command-line utility for combining CSV files with a given header.

Resources

License

Stars

Watchers

Forks

Languages