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
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
This procedure assumes that you are working on a Windows machine
- Make sure that you have python installed and accessible from the command line.
- 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.
- 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
- 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.
- This should download the repository to your local machine from github.
- Navigate into the top level of the repository, it should be a folder called cperkins-csv-log.
- In this directory enter python -m venv venv.
- There will be a short delay.
- At the command line enter venv\scripts\activate
- Your prompt should now have something like (venv) at the beginning of it.
- Enter python -m pip install --upgrade pip
- Enter python -m pip install -r requirements.txt
- This will download the project's dependencies.
- Enter "python -m pip install -e ."
- The (.) second argument is important here.
- Enter python -m pytest
- Congratulations. If there were no errors you should now be ready to work on the project.
- When you're finished working in the virtual environment, enter deactivate to leave it.
- Follow the instructions above and make sure that you're still in the virtual environment.
- Your prompt will have something like (venv) at the beginning of it.
- 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
- Quite a bit of output will go scrolling past your terminal.
- 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.
- To The EXE file in the dist directory is the application.
- To see that it worked, enter the following command: dist\<program_name>.exe --help
- You should see the program's help text.