scholarly


Namescholarly JSON
Version 1.7.11 PyPI version JSON
download
home_pagehttps://github.com/scholarly-python-package/scholarly
SummarySimple access to Google Scholar authors and citations
upload_time2023-01-16 22:01:00
maintainer
docs_urlNone
authorSteven A. Cholewiak, Panos Ipeirotis, Victor Silva, Arun Kannawadi
requires_python
licenseUnlicense
keywords google scholar academics citations
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Python package](https://github.com/scholarly-python-package/scholarly/workflows/Python%20package/badge.svg?branch=main)](https://github.com/scholarly-python-package/scholarly/actions?query=branch%3Amain)
[![codecov](https://codecov.io/gh/scholarly-python-package/scholarly/branch/main/graph/badge.svg?token=0svtI9yVSQ)](https://codecov.io/gh/scholarly-python-package/scholarly)
[![Documentation Status](https://readthedocs.org/projects/scholarly/badge/?version=latest)](https://scholarly.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/27442991.svg)](https://zenodo.org/badge/latestdoi/27442991)

# scholarly

scholarly is a module that allows you to retrieve author and publication information from [Google Scholar](https://scholar.google.com) in a friendly, Pythonic way without having to solve CAPTCHAs.

## Installation

[![Anaconda-Server Badge](https://anaconda.org/conda-forge/scholarly/badges/version.svg)](https://anaconda.org/conda-forge/scholarly)
[![PyPI version](https://badge.fury.io/py/scholarly.svg)](https://badge.fury.io/py/scholarly)

`scholarly` can be installed either with `conda` or with `pip`.
To install using `conda`, simply run
```bash
conda install -c conda-forge scholarly
```

Alternatively, use `pip` to install the latest release from pypi:

```bash
pip3 install scholarly
```

or `pip` to install from github:

```bash
pip3 install -U git+https://github.com/scholarly-python-package/scholarly.git
```

We are constantly developing new features.
Please update your local package regularly.
`scholarly` follows [Semantic Versioning](https://semver.org/).
This means your code that uses an earlier version of `scholarly` is guaranteed to work with newer versions.

### Optional dependencies

- **Tor**:

    `scholarly` comes with a handful of APIs to set up proxies to circumvent anti-bot measures.
    Tor methods are deprecated since v1.5 and are not actively tested or supported.
    If you wish to use Tor, install `scholarly` using the `tor` tag as
    ```bash
    pip3 install scholarly[tor]
    ```
    If you use `zsh` (which is now the default in latest macOS), you should type this as
    ```zsh
    pip3 install scholarly'[tor]'
    ```
    **Note:** Tor option is unavailable with conda installation.

## Tests

To check if your installation is succesful, run the tests by executing the `test_module.py` file as:

```bash
python3 test_module
```

or

```bash
python3 -m unittest -v test_module.py
```
## Documentation

Check the [documentation](https://scholarly.readthedocs.io/en/latest/?badge=latest) for a [complete API reference](https://scholarly.readthedocs.io/en/stable/scholarly.html) and a [quickstart guide](https://scholarly.readthedocs.io/en/stable/quickstart.html).

### Examples

```python
from scholarly import scholarly

# Retrieve the author's data, fill-in, and print
# Get an iterator for the author results
search_query = scholarly.search_author('Steven A Cholewiak')
# Retrieve the first result from the iterator
first_author_result = next(search_query)
scholarly.pprint(first_author_result)

# Retrieve all the details for the author
author = scholarly.fill(first_author_result )
scholarly.pprint(author)

# Take a closer look at the first publication
first_publication = author['publications'][0]
first_publication_filled = scholarly.fill(first_publication)
scholarly.pprint(first_publication_filled)

# Print the titles of the author's publications
publication_titles = [pub['bib']['title'] for pub in author['publications']]
print(publication_titles)

# Which papers cited that publication?
citations = [citation['bib']['title'] for citation in scholarly.citedby(first_publication_filled)]
print(citations)
```

**IMPORTANT**: Making certain types of queries, such as `scholarly.citedby` or `scholarly.search_pubs`, will lead to Google Scholar blocking your requests and may eventually block your IP address.
You must use proxy services to avoid this situation.
See the ["Using proxies" section](https://scholarly.readthedocs.io/en/stable/quickstart.html#using-proxies) in the documentation for more details. Here's a short example:

```python
from scholarly import ProxyGenerator

# Set up a ProxyGenerator object to use free proxies
# This needs to be done only once per session
pg = ProxyGenerator()
pg.FreeProxies()
scholarly.use_proxy(pg)

# Now search Google Scholar from behind a proxy
search_query = scholarly.search_pubs('Perception of physical stability and center of mass of 3D objects')
scholarly.pprint(next(search_query))
```

`scholarly` also has APIs that work with several premium (paid) proxy services.
`scholarly` is smart enough to know which queries need proxies and which do not.
It is therefore recommended to always set up a proxy in the beginning of your application.

#### Disclaimer

The developers use `ScraperAPI` to run the tests in Github Actions.
The developers of `scholarly` are not affiliated with any of the proxy services and do not profit from them. If your favorite service is not supported, please submit an issue or even better, follow it up with a pull request.

## Contributing

We welcome contributions from you.
Please create an issue, fork this repository and submit a pull request.
Read the [contributing document](.github/CONTRIBUTING.md) for more information.

## Acknowledging `scholarly`

If you have used this codebase in a scientific publication, please cite this software as following:

```bibtex
@software{cholewiak2021scholarly,
  author  = {Cholewiak, Steven A. and Ipeirotis, Panos and Silva, Victor and Kannawadi, Arun},
  title   = {{SCHOLARLY: Simple access to Google Scholar authors and citation using Python}},
  year    = {2021},
  doi     = {10.5281/zenodo.5764801},
  license = {Unlicense},
  url = {https://github.com/scholarly-python-package/scholarly},
  version = {1.5.1}
}
```

## License

The original code that this project was forked from was released by [Luciano Bello](https://github.com/lbello/chalmers-web) under a [WTFPL](http://www.wtfpl.net/) license. In keeping with this mentality, all code is released under the [Unlicense](http://unlicense.org/).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/scholarly-python-package/scholarly",
    "name": "scholarly",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Google Scholar,academics,citations",
    "author": "Steven A. Cholewiak, Panos Ipeirotis, Victor Silva, Arun Kannawadi",
    "author_email": "steven@cholewiak.com, panos@stern.nyu.edu, vsilva@ualberta.ca, arunkannawadi@astro.princeton.edu",
    "download_url": "https://files.pythonhosted.org/packages/62/2d/38f22adc8abc1166d2c039e477bd8d7782fe32a72f5c80aed94b23348ac1/scholarly-1.7.11.tar.gz",
    "platform": null,
    "description": "[![Python package](https://github.com/scholarly-python-package/scholarly/workflows/Python%20package/badge.svg?branch=main)](https://github.com/scholarly-python-package/scholarly/actions?query=branch%3Amain)\n[![codecov](https://codecov.io/gh/scholarly-python-package/scholarly/branch/main/graph/badge.svg?token=0svtI9yVSQ)](https://codecov.io/gh/scholarly-python-package/scholarly)\n[![Documentation Status](https://readthedocs.org/projects/scholarly/badge/?version=latest)](https://scholarly.readthedocs.io/en/latest/?badge=latest)\n[![DOI](https://zenodo.org/badge/27442991.svg)](https://zenodo.org/badge/latestdoi/27442991)\n\n# scholarly\n\nscholarly is a module that allows you to retrieve author and publication information from [Google Scholar](https://scholar.google.com) in a friendly, Pythonic way without having to solve CAPTCHAs.\n\n## Installation\n\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/scholarly/badges/version.svg)](https://anaconda.org/conda-forge/scholarly)\n[![PyPI version](https://badge.fury.io/py/scholarly.svg)](https://badge.fury.io/py/scholarly)\n\n`scholarly` can be installed either with `conda` or with `pip`.\nTo install using `conda`, simply run\n```bash\nconda install -c conda-forge scholarly\n```\n\nAlternatively, use `pip` to install the latest release from pypi:\n\n```bash\npip3 install scholarly\n```\n\nor `pip` to install from github:\n\n```bash\npip3 install -U git+https://github.com/scholarly-python-package/scholarly.git\n```\n\nWe are constantly developing new features.\nPlease update your local package regularly.\n`scholarly` follows [Semantic Versioning](https://semver.org/).\nThis means your code that uses an earlier version of `scholarly` is guaranteed to work with newer versions.\n\n### Optional dependencies\n\n- **Tor**:\n\n    `scholarly` comes with a handful of APIs to set up proxies to circumvent anti-bot measures.\n    Tor methods are deprecated since v1.5 and are not actively tested or supported.\n    If you wish to use Tor, install `scholarly` using the `tor` tag as\n    ```bash\n    pip3 install scholarly[tor]\n    ```\n    If you use `zsh` (which is now the default in latest macOS), you should type this as\n    ```zsh\n    pip3 install scholarly'[tor]'\n    ```\n    **Note:** Tor option is unavailable with conda installation.\n\n## Tests\n\nTo check if your installation is succesful, run the tests by executing the `test_module.py` file as:\n\n```bash\npython3 test_module\n```\n\nor\n\n```bash\npython3 -m unittest -v test_module.py\n```\n## Documentation\n\nCheck the [documentation](https://scholarly.readthedocs.io/en/latest/?badge=latest) for a [complete API reference](https://scholarly.readthedocs.io/en/stable/scholarly.html) and a [quickstart guide](https://scholarly.readthedocs.io/en/stable/quickstart.html).\n\n### Examples\n\n```python\nfrom scholarly import scholarly\n\n# Retrieve the author's data, fill-in, and print\n# Get an iterator for the author results\nsearch_query = scholarly.search_author('Steven A Cholewiak')\n# Retrieve the first result from the iterator\nfirst_author_result = next(search_query)\nscholarly.pprint(first_author_result)\n\n# Retrieve all the details for the author\nauthor = scholarly.fill(first_author_result )\nscholarly.pprint(author)\n\n# Take a closer look at the first publication\nfirst_publication = author['publications'][0]\nfirst_publication_filled = scholarly.fill(first_publication)\nscholarly.pprint(first_publication_filled)\n\n# Print the titles of the author's publications\npublication_titles = [pub['bib']['title'] for pub in author['publications']]\nprint(publication_titles)\n\n# Which papers cited that publication?\ncitations = [citation['bib']['title'] for citation in scholarly.citedby(first_publication_filled)]\nprint(citations)\n```\n\n**IMPORTANT**: Making certain types of queries, such as `scholarly.citedby` or `scholarly.search_pubs`, will lead to Google Scholar blocking your requests and may eventually block your IP address.\nYou must use proxy services to avoid this situation.\nSee the [\"Using proxies\" section](https://scholarly.readthedocs.io/en/stable/quickstart.html#using-proxies) in the documentation for more details. Here's a short example:\n\n```python\nfrom scholarly import ProxyGenerator\n\n# Set up a ProxyGenerator object to use free proxies\n# This needs to be done only once per session\npg = ProxyGenerator()\npg.FreeProxies()\nscholarly.use_proxy(pg)\n\n# Now search Google Scholar from behind a proxy\nsearch_query = scholarly.search_pubs('Perception of physical stability and center of mass of 3D objects')\nscholarly.pprint(next(search_query))\n```\n\n`scholarly` also has APIs that work with several premium (paid) proxy services.\n`scholarly` is smart enough to know which queries need proxies and which do not.\nIt is therefore recommended to always set up a proxy in the beginning of your application.\n\n#### Disclaimer\n\nThe developers use `ScraperAPI` to run the tests in Github Actions.\nThe developers of `scholarly` are not affiliated with any of the proxy services and do not profit from them. If your favorite service is not supported, please submit an issue or even better, follow it up with a pull request.\n\n## Contributing\n\nWe welcome contributions from you.\nPlease create an issue, fork this repository and submit a pull request.\nRead the [contributing document](.github/CONTRIBUTING.md) for more information.\n\n## Acknowledging `scholarly`\n\nIf you have used this codebase in a scientific publication, please cite this software as following:\n\n```bibtex\n@software{cholewiak2021scholarly,\n  author  = {Cholewiak, Steven A. and Ipeirotis, Panos and Silva, Victor and Kannawadi, Arun},\n  title   = {{SCHOLARLY: Simple access to Google Scholar authors and citation using Python}},\n  year    = {2021},\n  doi     = {10.5281/zenodo.5764801},\n  license = {Unlicense},\n  url = {https://github.com/scholarly-python-package/scholarly},\n  version = {1.5.1}\n}\n```\n\n## License\n\nThe original code that this project was forked from was released by [Luciano Bello](https://github.com/lbello/chalmers-web) under a [WTFPL](http://www.wtfpl.net/) license. In keeping with this mentality, all code is released under the [Unlicense](http://unlicense.org/).\n",
    "bugtrack_url": null,
    "license": "Unlicense",
    "summary": "Simple access to Google Scholar authors and citations",
    "version": "1.7.11",
    "split_keywords": [
        "google scholar",
        "academics",
        "citations"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6234340a9068b451b7bb03ff02243bd7aea4c1869781f41e2387c9348629edd",
                "md5": "a12b7f533a489cf8f0b8d6e204b71d8b",
                "sha256": "be404853e0d020254de32d2050c54dc201f1f36efa4a9d3f8e740d3be4361b20"
            },
            "downloads": -1,
            "filename": "scholarly-1.7.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a12b7f533a489cf8f0b8d6e204b71d8b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 39380,
            "upload_time": "2023-01-16T22:00:57",
            "upload_time_iso_8601": "2023-01-16T22:00:57.549222Z",
            "url": "https://files.pythonhosted.org/packages/b6/23/4340a9068b451b7bb03ff02243bd7aea4c1869781f41e2387c9348629edd/scholarly-1.7.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "622d38f22adc8abc1166d2c039e477bd8d7782fe32a72f5c80aed94b23348ac1",
                "md5": "f5686e5b7c070bd7b9574c50ad128e65",
                "sha256": "2c983dd44d9d9398a6f2605102ae6e5586023b41ebbaec1461917ee48eb153f0"
            },
            "downloads": -1,
            "filename": "scholarly-1.7.11.tar.gz",
            "has_sig": false,
            "md5_digest": "f5686e5b7c070bd7b9574c50ad128e65",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38819,
            "upload_time": "2023-01-16T22:01:00",
            "upload_time_iso_8601": "2023-01-16T22:01:00.087596Z",
            "url": "https://files.pythonhosted.org/packages/62/2d/38f22adc8abc1166d2c039e477bd8d7782fe32a72f5c80aed94b23348ac1/scholarly-1.7.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-16 22:01:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "scholarly-python-package",
    "github_project": "scholarly",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "scholarly"
}
        
Elapsed time: 0.03362s