Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
About the new version of the script (Windows Executable with a GUI) instead of the command line version.
  • Loading branch information
amhanson9 committed Apr 28, 2021
1 parent 840c8e4 commit 945a0f4
Showing 1 changed file with 18 additions and 32 deletions.
50 changes: 18 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
# Purpose of this fork
This is for testing purposes for deciding if we can update it to fit a new use case, including adding a GUI for easier user experience. To test with the GUI:
# DLG API Parser

* Run dlg_json2csv_gui.py with no arguments.
* In the GUI, enter the following:
* Path to CSV with DLG URLs = sample_urls.txt
* Folder to save output = any location on your computer
* Name for the output CSV = file name of your choice. If you do not include a .csv extension, the script will add it.
* Leave encoding and mapping blank.

To see error handling with the GUI, leave any of the first three boxes blank or type "fake" into any of the boxes with "Browse" buttons.


# Original README

This program was created to be an intermediate step to pull item(s) from the [Digital Library of Georgia's](https://dlg.usg.edu) (DLG) API and compile it into a CSV file. This script is specifically used to import the CSV with the CSVImport plugin. Please take a look at the word document `DLG_Omeka_API_Pipeline.pdf` because it explains the entire pipeline. That should give you a good feel for the task this script completes. This allows you to have the data for each item but not have to store each item on your own. You will be pulling these from DLG.
This program was created to be an intermediate step to pull item(s) from the [Digital Library of Georgia's](https://dlg.usg.edu) (DLG) API and compile it into a CSV file. This script is specifically used to import the CSV with the CSVImport plugin, although it can be adapted for other purposes by changing the mapping csv. Please take a look at the word document `DLG_Omeka_API_Pipeline.pdf` because it explains the entire pipeline. That should give you a good feel for the task this script completes. This allows you to have the data for each item but not have to store each item on your own. You will be pulling these from DLG.


### A Brief Description
Expand All @@ -26,27 +13,26 @@ Omeka's plugin will not skip it when trying to read it in.*
The specifics about Omeka's CSVImport will be in `DLG_Omeka_API_Pipeline.pdf` file.

### Other Files
* DLG_Mapping.\* If you want to make any changes to the column headers in your output csv, either update this csv or create your own and use the `--mapping` argument.
* sample_urls.txt is just a sample file that will succesfully run thorugh the program. Each of the three URLs are of different cases, illustrating that it can handle any type of URL from the DLG website. (Besides https://dlg.usg.edu obviously.)
* **Command Line Instructions**: The script was originally designed to run via the command line and can still be operated that way instead of using the Windows executable for any who prefer the command line or are working in a Mac environment.

### Dependencies
python 3+:
1. pandas v 0.25.1+
2. requests 2.22.0+

The rest come preinstalled with python.
* **DLG_Mapping.csv**: Indicates the fields from the DLG JSON that should be included in the CSV and what the columns should be named. If you want to make any changes to the column headers in your output CSV, either update this CSV or create your own.


### How to Run
This program is ran from the command line, thus you will need to move the command
prompt to this folder and run the following command:
* **DLG_Mapping.xls**: Provides details about each field in the DLG JSON.


`python dlg_json2list.py --input <txt file> --output <name of output csv>`
* **DLG_Omeka_API_Pipeline**: A complete workflow using this script to export information from DLG about selected images and import it into Omeka for creating digital exhibits. The Word and PDF versions are the same information.

Lastly, the command line arguments:
* `--input`: REQUIRED. The txt file that contains the url(s) to be parsed. Please make sure that you do not put any line breaks (or new lines) inside the url. There needs to be one url per line.
* `--output`: REQUIRED. The name of the output csv you want these URL's to be added.
* `--encode`: [Default: utf-8] If you want to change the encoding of the csv.
* `--mapping`: [Default: DLG_Mapping.csv] The csv that contains the column mapping to change the column names of the csv instead of naming them what DLG names them.

To get a description, just run `python dlg_json2csv.py --help` for a similar description.
* **sample_urls.txt** is just a sample file that will successfully run through the program. Each of the three URLs are of different cases, illustrating that it can handle any type of URL from the DLG website. (Besides https://dlg.usg.edu)

### How to Run
1. Download the executable and save it to your local machine.
2. Save a copy of DLG_Mapping.csv or the mapping CSV you want to use in the same folder as the executable.
3. Double-click on the executable to start the program.
4. Enter the required information into the program.
* Path to file with DLG URLs: the text file with the URLs you wish to include in the CSV
* Folder to save output: any folder on your local machine, where the CSV and the script log are saved
* Name for the output CSV: whatever name the output CSV should have. You may include the file extension (.csv) or have the script add it.
5. Click Submit.

0 comments on commit 945a0f4

Please sign in to comment.