Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version info to v1.2.2 #22

Merged
merged 14 commits into from
Jan 15, 2023
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
**/citations.xlsx
**/*citations.xlsx
*.Rproj
**/__pycache__
.Rproj.user
*.Rhistory

_old/**
_notes**
_notes**
*settings.json
7 changes: 4 additions & 3 deletions PapersCited.py
Original file line number Diff line number Diff line change
@@ -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, "")
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Binary file added example.docx
Binary file not shown.
Binary file removed test.docx
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down