GithubHelp home page GithubHelp logo

nelson-gon / pycite Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 3.0 155 KB

Python Citations Generator

Home Page: https://pycite.readthedocs.io

License: MIT License

Makefile 2.23% Batchfile 2.66% Python 87.55% Shell 7.56%
academic-project phd htmlparser webscraping webscraper citations harvard research research-tool https

pycite's People

Stargazers

 avatar

Watchers

 avatar  avatar

pycite's Issues

Automated documentation and release

Description

I would like to automate the doc generation and release process.

Similar Features

This is similar to scripts/mkdocs.sh and scripts/release.sh.

Feature Details

Sufficiently described.

Proposed Implementation

Use an Actions run to automate these e.g. "on release" to run "release.sh". Should also set environmental variables i.e. PyPI username and password.

Script Generator Fails on Linux Systems

Describe the bug

When running bash scripts/mkdocs.sh, I received errors.

To Reproduce

On a Linux system while in the directory's root, run bash scripts/mkdocs.sh.

Expected behavior

I expected to have documentation build flawlessly or at least attempt to build.

Unexpected behavior
I received the following errors:

/usr/bin/python3: No module named m2r
mv: cannot stat '.github/CONTRIBUTING.rst': No such file or directory
mv: cannot stat 'README.rst': No such file or directory
mv: cannot stat 'changelog.rst': No such file or directory
Building docs for pycite
scripts/mkdocs.sh: line 23: ./make.bat: Permission denied

System Details

OS: Linux 5.8.0-55-generic #62~20.04.1-Ubuntu

Package hash: https://github.com/Nelson-Gon/pycite/tree/914367ac61bd11d2e7ed4bb84e716cc45392ea38

Use logging for verbose console messages

Description

I would like to have a log file that shows me all the messages that are produced on the console.

Similar Features

This is currently done by writing messages to the console. However, for future reference, it would be great to provide a log file that holds all these messages.

Feature Details

Sufficiently described above.

Proposed Implementation

Use the logging module. In addition, it would be great to have some sort of control over this logging process and/or disable it optionally.

Science Direct citations mix up years, volumes, and pages

Describe the bug

For papers from sciencedirect.com, sometimes year is in place of volume and volume in place of year.

To Reproduce

Run tests/workflows for https://github.com/Nelson-Gon/pycite/tree/b116046ddf7f316eff4e6a4bc5aaad899bc11cda and look at the last two citations.

Expected behavior

Expected a consistent output regardless of paper since it is the same website.

Unexpected behavior

Got differing citations based on link/paper.

System Details

Dev version: https://github.com/Nelson-Gon/pycite/tree/b116046ddf7f316eff4e6a4bc5aaad899bc11cda
Windows 10, Ubuntu 18.04

Error message when running program based on README.rst instructions

Describe the bug

When running the program per the directions in README.rst, the program errors out

To Reproduce

Go to line 162 of README.rst and do as follows:

from pycite.pycite import PyCite
my_citations = PyCite(input_file="testfiles/testlinks.txt", output_file="testfiles/citations.txt")
my_citations.cite()

my_citations.cite() will run correctly for a short time and then give the following error message when trying to cite this (https://www.sciencedirect.com/science/article/pii/S0301051117302314) article:

(Traceback (most recent call last):
File "", line 1, in
File "/home/hudsonlanier/.virtualenvs/pycite/lib/python3.9/site-packages/pycite/pycite.py", line 132, in cite
title = bs4_link.find_all("h1", {"class": "content-title"})[0].text
IndexError: list index out of range)

Expected behavior
The expectation is that this will either correctly cite the article or at least not error out the program as a result of not being able to cite the article.

Unexpected behavior

Traceback (most recent call last):
File "", line 1, in
File "/home/hudsonlanier/.virtualenvs/pycite/lib/python3.9/site-packages/pycite/pycite.py", line 132, in cite
title = bs4_link.find_all("h1", {"class": "content-title"})[0].text
IndexError: list index out of range

System Details


Support ScienceDirect as a paper source

Description

I would like to build citations for papers that come from Science Direct.

Similar Features

Similar to functions in ncbi.py and pubmed.py.

Feature Details

Same as above.

Proposed Implementation

None for now. A checklist

  • Minimal Working Citations
  • Fully working citations with authors, year, title, volume, pages, and an optional DOI.

Sort generated citations alphabetically

Description

As per Harvard citation standards, the citation list should be ordered alphabetically.

Similar Features

Related to pycite.cite() and/or the individual *_final_citation

Feature Details

Sufficiently described.

Proposed Implementation

A simple name based sort of the generated citation list?

Single Author Citations Start Author Name with an "&"

Describe the bug

In the final citation, if there is only one author, the citation begins with an &.

To Reproduce

Using latest dev version on a paper like https://www.sciencedirect.com/science/article/pii/S138824571730055X, one will get something like:

'& Hallett M (2017) Smart brain stimulation. Clinical Neurophysiology, 128(5), 839-840'

Expected behavior

Expected 'Hallett M (2017) Smart brain stimulation. Clinical Neurophysiology, 128(5), 839-840'

Unexpected behavior

Described above.

System Details

Dev version https://github.com/Nelson-Gon/pycite/tree/b116046ddf7f316eff4e6a4bc5aaad899bc11cda

Support for PubMed papers

Description

I would like to generate citations for papers obtained from PubMed.

Similar Features

Similar to PyCite.cite

Feature Details

Sufficiently described. Need to generate citations for websites like https://pubmed.ncbi.nlm.nih.gov/paperidhere

Proposed Implementation

Probably need to rethink the selectors.

Post Proposal Edits

  • Fix inconsistent year_journal_volume lengths
  • Convert the last author to & instead of ,
  • Add Page numbers where applicable.

Support JSTOR papers

Description

I would like to cite papers from JSTOR

Similar Features

Similar to NCBI and other sources.

Feature Details

Full Harvard citation as required.

Proposed Implementation

  • Access dynamically loaded elements e.g. journal volume, journal pages. Use selenium/webdriver
  • Create citation as required.
  • Fix 403s in jstor tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.