Git Product home page Git Product logo

academic_citations's Introduction

academic_citations

UnOffical Python Crossref.org API Wrapper and CLI.


Table of Contents


QuickStart

Installation

pip install crossref

From Source

git clone https://github.com/TralahM/academic_citations
cd academic_citations

python setup.py bdist_wheel
pip install -e .


CLI Usage

$ crossref --help

$ crossref pubs --help

$ crossref journals --help

$ crossref members --help

$ crossref funders --help

$ crossref cite --help

$ crossref works --query "Machine learning" --rows 20

$ crossref work 10.5621/sciefictstud.40.2.0382

$ crossref funders --query "Machine learning" --rows 20

$ crossref funders get 100000003

$ crossref members --query "Machine learning" --rows 20

$ crossref members get 1

$ crossref journals --query "Machine learning" --rows 20

$ crossref journals get 2167-8359

crossref --help
usage: crossref [-h] [--mailto MAILTO] [--auth-token AUTH_TOKEN]
                [--api-version API_VERSION] [-o OUTFILE] [--rows ROWS]
                [--format-on]
                [--sample SAMPLE | --offset OFFSET | --cursor CURSOR]
                {pubs,works,publications,w,p,journals,journal,jnl,j,members,member,m,funders,funder,f,types,type,t,licenses,license,lc,lcs,cite,citation,citations,ref,refs,reference,references,prefix,pre,px}
                ...

options:
  -h, --help            show this help message and exit
  --mailto MAILTO       mailto address for polite users
  --auth-token AUTH_TOKEN
                        auth token for authenticated (Plus) users
  --api-version API_VERSION
                        API version to use (default=v1)
  -o OUTFILE            Json filename to also store the output
  --rows ROWS           Number of Rows to return (default=20)
  --format-on           Format json output using pygments syntax highlighting?
  --sample SAMPLE       Sample size
  --offset OFFSET       Offset
  --cursor CURSOR       Cursor parameter

commands:
  {pubs,works,publications,w,p,journals,journal,jnl,j,members,member,m,funders,funder,f,types,type,t,licenses,license,lc,lcs,cite,citation,citations,ref,refs,reference,references,prefix,pre,px}
    pubs (works, publications, w, p)
                        Interact with the Works API. Supports the following
                        parameters: - Queries: (query) and (query.field(s)) -
                        Filters: (filter=type-name:filter)(s) or dot filters
                        (filter=type-name.field-name:filter)(s) - Pagination
                        with offsets: (offset) and (rows) - Deep paging:
                        (cursor=*) initially and (cursor=next-cursor) in
                        subsequent requests - Elements: (select=field-name(s))
                        - Sort: (sort) and (order) - Facets: (facet=type-
                        name:*) - Sample: (sample) And returns a list of works
                        (journal articles, conference proceedings, books,
                        components, etc), or a single work (if you specify a
                        DOI).
    journals (journal, jnl, j)
                        Interact with the Journals API. Supports the following
                        parameters: - Queries: (query) and (query.field(s)) -
                        Pagination with offsets: (offset) and (rows) - Deep
                        paging: (cursor=*) initially and (cursor=next-cursor)
                        in subsequent requests
    members (member, m)
                        Interact with the Members API. Supports the following
                        parameters: - Queries: (query) and (query.field(s)) -
                        Pagination with offsets: (offset) and (rows) - Deep
                        paging: (cursor=*) initially and (cursor=next-cursor)
                        in subsequent requests - Filters: (filter=type-
                        name:filter)(s) or dot filters (filter=type-
                        name.field-name:filter)(s)
    funders (funder, f)
                        Interact with the Funders API. Supports the following
                        parameters: - Queries: (query) and (query.field(s)) -
                        Pagination with offsets: (offset) and (rows) - Deep
                        paging: (cursor=*) initially and (cursor=next-cursor)
                        in subsequent requests - Filters:
                        (filter=location:filter) - location = funders located
                        in given country
    types (type, t)     Interact with the Types API. Supports the following
                        parameters: - Pagination with offsets: (offset) and
                        (rows)
    licenses (license, lc, lcs)
                        Interact with the Licenses API. Supports the following
                        parameters: - Queries: (query) and (query.field(s)) -
                        Pagination with offsets: (offset) and (rows) - Deep
                        paging: (cursor=*) initially and (cursor=next-cursor)
                        in subsequent requests
    cite (citation, citations, ref, refs, reference, references)
                        Get Citation/ Reference Text of the given DOI In the
                        Specified Style (apa, mla, bibtex, etc).
    prefix (pre, px)    Interact with the Types API. Supports the following
                        parameters: - Pagination with offsets: (offset) and
                        (rows)

Author: Tralah M Brian (TralahM) <[email protected]>. Project:
<https://github.com/TralahM/academic_citations>

Use as a Library

from crossref import CrossrefAPIClient
client = CrossrefAPIClient()

works = client.get_works(
    {
        "rows": 20,
        "query": "Machine learning",
    }
)
print(works.json())

work = client.get_work("10.5621/sciefictstud.40.2.0382")
print(work.json())

funders = client.get_funders(
    {
        "rows": 20,
        "query": "Machine learning",
    }
)

print(funders.json())

funder = client.get_funder("100000003")

print(funder.json())

members = client.get_members(
    {
        "rows": 20,
        "query": "Machine learning",
    }
)

print(members.json())

member = client.get_member("1")

journals = client.get_journals(
    {
        "rows": 20,
        "query": "Machine learning",
    }
)

print(journals.json())

journal = client.get_journal("2167-8359")

print(journal.json())

types = client.get_types(
    {
        "rows": 20,
        "query": "Machine learning",
    }
)

print(types.json())

type = client.get_type("journal-article")

print(type.json())

licenses = client.get_licenses(
    {
        "rows": 20,
        "query": "Machine learning",
    }
)

print(licenses.json())

prefix = client.get_prefix("10.1038")

print(prefix.json())

citation = client.get_work_reference("10.5621/sciefictstud.40.2.0382",style="apa")
print(citation.text)

citation = client.get_work_reference("10.5621/sciefictstud.40.2.0382",style="bibtex")
print(citation.text)

citation = client.get_work_reference("10.5621/sciefictstud.40.2.0382",style="mla")
print(citation.text)

Documentation

Documentation

API Reference


Contributing


Credits

TralahTek TralahM TralahM

TralahM TralahM

Blog

TralahTek

academic_citations's People

Contributors

tralahm avatar

Stargazers

 avatar

Watchers

 avatar

academic_citations's Issues

ModuleNotFoundError: No module named 'backoff'

Describe the bug
Package seems to expect for there to be a module called "backoff"

To Reproduce
Steps to reproduce the behavior:

  1. pip install crossref
  2. crossref works --query "Machine learning" --rows 20
  3. See error:

ModuleNotFoundError: No module named 'backoff'

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.