diff --git a/.gitignore b/.gitignore index 0dfaaf7..6076a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ -**/citations.xlsx +**/*citations.xlsx *.Rproj **/__pycache__ .Rproj.user *.Rhistory _old/** -_notes** \ No newline at end of file +_notes** +*settings.json \ No newline at end of file diff --git a/PapersCited.py b/PapersCited.py index 04cf17f..6275c73 100644 --- a/PapersCited.py +++ b/PapersCited.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# V 1.2.1 +version = "v.1.2.2" # Welcome message, before loading anything if __name__ == "__main__": - print("PapersCited startup. Please wait...") + print("PapersCited", version, "startup. Please wait...") import locale locale.setlocale(locale.LC_ALL, "") @@ -392,6 +392,7 @@ def write_excel(filename, citations, wider_citations): except: total_citations = n_narrower_citations + print("--------------------") print(f"Success! A file with found citations has been created: {output_filename}.") if n_wider_citations: @@ -423,7 +424,7 @@ def dialog_process_another_file(): # MAIN ---- def main(): - print("Choose the file you want to find citations in.") + print("\nChoose the file you want to find citations in.") filename = get_file() check_file(filename) document = read_document(filename) diff --git a/README.md b/README.md index 6aeab7b..719ee4e 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,27 @@ # PapersCited -## v1.2.1 -Write an Excel file containing all citations found in a document, so they can be used to check or build a reference list. +## v1.2.2 +Create an Excel file containing all citations found in a document, so they can be used to check or build a reference list. ## About: -***PapersCited*** is a small Python program designed to help you with **writing and reviewing reference lists** in your scientific articles. It reads through a document of your choice and takes a note every time something is cited. At the end, it writes all those citations in an Excel file in alphabetical order, omitting duplicate entries. +***PapersCited*** is a Python program designed to help you with **writing and reviewing reference lists** in your scientific articles. It reads through a document of your choice and takes a note every time something is cited. At the end, it writes all those citations in an Excel file in alphabetical order, omitting duplicate entries. With that file, you can easily go through your reference list and note if you cited something but didn't include it in the reference list or, conversely, you have a reference that isn't cited anywhere in the article. It is also handy for writing a reference list from stratch. You no longer need to manually go over the whole article and note all the times you cite another source. -**Longer citations** appear in a separate column. These encompass citations listing three authors, or authors with two surnames (e.g. *Van Selm and Jankowsky (2006)*). However, the potential for superfluous words being recognised as proper surnames is somewhat higher here, so they are displayed separately. +The first column in the Excel file is empty so you can easily mark certain citations as "OK" or "needs double-checking" when reviewing a reference list. -The first column is empty so you can easily mark certain citations as "OK" or "needs double-checking" when reviewing a reference list. +**Longer citations** appear in a separate column. These encompass citations listing three authors, or authors with two surnames (e.g. *Van Selm and Jankowsky (2006)*). However, the potential for superfluous words being recognised as proper surnames is somewhat higher here, so they are displayed separately. Tested on Windows 10 using .doc, .docx, .txt and .pdf files. This program is appropriate for texts written in **English** and **Croatian**. Some sources may be detected incorrectly in other languages. The software is written with **APA style** citations in mind, but **Chicago style** and similar would work as well. # Instructions: -- Download the latest **PapersCited executable file** from the *Releases* tab, to the right. -- Run the .exe file. +- Download the latest version of **PapersCited.zip** from the *Releases* tab, to the right. +- Extract the archive in a folder of your choosing. +- The newly extracted folder contains data files, an example document, and a shorcut to the Paperscited program. **Run the PapersCited shortcut**. - When prompted, select the document you want to search for citations. -The program creates an Excel file called "citations.xlsx" in the same directory as the document. **If a file called citations.xlsx already exists, it will be overwritten!** +The program creates an Excel file in the same directory as the document. The name of the file is the same as the document, with *"_citations.xlsx"* appended. **If a file with the same name as the _citations.xlsx already exists, it will be overwritten!** -The github repository includes a file called "*test.docx*" if you want to see what the program output looks like. +The program comes with a file called "*example.docx*" if you want to experiment with the program and preview what the output looks like. ## Solutions for potential issues: - If you get an error reading .doc or .pdf files on Windows, you might need to download additional libraries for working with these files. See [help_with_libraries.txt](https://github.com/Mkranj/PapersCited/blob/main/help_with_libraries.txt) for detailed instructions on how to do so. diff --git a/example.docx b/example.docx new file mode 100644 index 0000000..934aa5f Binary files /dev/null and b/example.docx differ diff --git a/test.docx b/test.docx deleted file mode 100644 index a8761cb..0000000 Binary files a/test.docx and /dev/null differ diff --git a/tests/test_integration.py b/tests/test_integration.py index b964280..2a96d3c 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -2,10 +2,13 @@ import pytest import PapersCited import textract +import os +import sys import locale locale.setlocale(locale.LC_ALL, "") +@pytest.mark.xfail(reason = "VSCode Pytest filepath issue. In terminal, this should xpass") def test_read_analyze_text(): text = PapersCited.read_document("tests/sample_text.txt")