Name | habanero JSON |
Version |
2.2.0
JSON |
| download |
home_page | None |
Summary | Low Level Client for Crossref Search API |
upload_time | 2025-02-04 23:24:36 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | Copyright (C) 2024 Scott Chamberlain
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
habanero
========
|pypi| |docs| |ghactions| |coverage| |ruff| |uv|
This is a low level client for working with Crossref's search API. It's been named to be more generic, as other organizations are/will adopt Crossref's search API, making it possible to interact with all from one client.
`Crossref API docs <https://api.crossref.org/swagger-ui/index.html>`__
Other Crossref API clients:
- Ruby: `serrano`, `<https://github.com/sckott/serrano>`__
Crossref's API issue tracker: https://crossref.atlassian.net/jira/software/c/projects/CR/issues/
`habanero` includes three modules you can import as needed (or
import all):
`Crossref` - Crossref search API. The `Crossref` module includes methods matching Crossref API routes, and a few convenience methods for getting DOI agency and random DOIs:
- `works` - `/works` route
- `members` - `/members` route
- `prefixes` - `/prefixes` route
- `funders` - `/funders` route
- `journals` - `/journals` route
- `types` - `/types` route
- `licenses` - `/licenses` route
- `registration_agency` - get DOI minting agency
- `random_dois` - get random set of DOIs
`counts` - citation counts. Includes the single `citation_count` method
`cn` - content negotiation. Includes the methods:
- `content_negotiation` - get citations in a variety of formats
- `csl_styles` - get CSL styles, used in `content_negotation` method
`WorksContainer` - A class for handling Crossref works. Pass output of works from methods on the `Crossref` class to more easily extract specific fields of works.
Note about searching:
You are using the Crossref search API described at https://api.crossref.org/swagger-ui/index.html. When you search with query terms, on Crossref servers they are not searching full text, or even abstracts of articles, but only what is available in the data that is returned to you. That is, they search article titles, authors, etc. For some discussion on this, see https://gitlab.com/crossref/issues/-/issues/101
Rate limits
-----------
See the headers `X-Rate-Limit-Limit` and `X-Rate-Limit-Interval` for current rate limits.
The Polite Pool
---------------
To get in the polite pool it's a good idea now to include a `mailto` email
address. See docs for more information.
Installation
============
Stable version
.. code-block:: console
pip (or pip3) install habanero
If you would like to fix bibtex format citations using content negotiation you'll have to install the optional dependency bibtexparser >= 2.0.0b7 (done for you with optional `[bibtex]`)
.. code-block:: console
pip (or pip3) install habanero[bibtex]
Dev version
.. code-block:: console
pip install git+https://github.com/sckott/habanero.git#egg=habanero
Or build it yourself locally
.. code-block:: console
git clone https://github.com/sckott/habanero.git
cd habanero
make install
Usage
=====
Initialize a client
.. code-block:: python
from habanero import Crossref
cr = Crossref()
Works route
.. code-block:: python
# query
x = cr.works(query = "ecology")
x['message']
x['message']['total-results']
x['message']['items']
# fetch data by DOI
cr.works(ids = '10.1371/journal.pone.0033693')
Members route
.. code-block:: python
# ids here is the Crossref Member ID; 98 = Hindawi
cr.members(ids = 98, works = True)
Citation counts
.. code-block:: python
from habanero import counts
counts.citation_count(doi = "10.1016/j.fbr.2012.01.001")
Content negotiation - get citations in many formats
.. code-block:: python
from habanero import cn
cn.content_negotiation(ids = '10.1126/science.169.3946.635')
cn.content_negotiation(ids = '10.1126/science.169.3946.635', format = "citeproc-json")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "rdf-xml")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "text")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "text", style = "apa")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "bibentry")
Meta
====
* Please note that this project is released with a `Contributor Code of Conduct <https://github.com/sckott/habanero/blob/main/CODE_OF_CONDUCT.md>`__. By participating in this project you agree to abide by its terms.
* License: MIT; see `LICENSE file <https://github.com/sckott/habanero/blob/main/LICENSE>`__
.. |pypi| image:: https://badge.fury.io/py/habanero.svg
:target: https://badge.fury.io/py/habanero
:alt: pypi
.. |docs| image:: https://readthedocs.org/projects/habanero/badge/?version=latest
:target: http://habanero.rtfd.org/
:alt: Docs
.. |ghactions| image:: https://github.com/sckott/habanero/actions/workflows/python.yml/badge.svg?branch=main
:target: https://github.com/sckott/habanero/actions/workflows/python.yml
:alt: ghactions
.. |coverage| image:: https://codecov.io/gh/sckott/habanero/branch/main/graph/badge.svg?token=6RrgNAuQmR
:target: https://codecov.io/gh/sckott/habanero
:alt: coverage
.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff
.. |uv| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json
:target: https://github.com/astral-sh/uv
:alt: uv
Raw data
{
"_id": null,
"home_page": null,
"name": "habanero",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Scott Chamberlain <myrmecocystus@gmail.com>",
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/c6/7a/c015a6b009aa1c15732300ad2f255a728f90c33f1f57fd5545e852b2eb2f/habanero-2.2.0.tar.gz",
"platform": null,
"description": "habanero\n========\n\n|pypi| |docs| |ghactions| |coverage| |ruff| |uv|\n\nThis is a low level client for working with Crossref's search API. It's been named to be more generic, as other organizations are/will adopt Crossref's search API, making it possible to interact with all from one client.\n\n`Crossref API docs <https://api.crossref.org/swagger-ui/index.html>`__\n\nOther Crossref API clients:\n\n- Ruby: `serrano`, `<https://github.com/sckott/serrano>`__\n\nCrossref's API issue tracker: https://crossref.atlassian.net/jira/software/c/projects/CR/issues/\n\n`habanero` includes three modules you can import as needed (or\nimport all):\n\n`Crossref` - Crossref search API. The `Crossref` module includes methods matching Crossref API routes, and a few convenience methods for getting DOI agency and random DOIs:\n\n- `works` - `/works` route\n- `members` - `/members` route\n- `prefixes` - `/prefixes` route\n- `funders` - `/funders` route\n- `journals` - `/journals` route\n- `types` - `/types` route\n- `licenses` - `/licenses` route\n- `registration_agency` - get DOI minting agency\n- `random_dois` - get random set of DOIs\n\n`counts` - citation counts. Includes the single `citation_count` method\n\n`cn` - content negotiation. Includes the methods:\n\n- `content_negotiation` - get citations in a variety of formats\n- `csl_styles` - get CSL styles, used in `content_negotation` method\n\n`WorksContainer` - A class for handling Crossref works. Pass output of works from methods on the `Crossref` class to more easily extract specific fields of works. \n\nNote about searching:\n\nYou are using the Crossref search API described at https://api.crossref.org/swagger-ui/index.html. When you search with query terms, on Crossref servers they are not searching full text, or even abstracts of articles, but only what is available in the data that is returned to you. That is, they search article titles, authors, etc. For some discussion on this, see https://gitlab.com/crossref/issues/-/issues/101\n\nRate limits\n-----------\n\nSee the headers `X-Rate-Limit-Limit` and `X-Rate-Limit-Interval` for current rate limits.\n\nThe Polite Pool\n---------------\n\nTo get in the polite pool it's a good idea now to include a `mailto` email\naddress. See docs for more information.\n\n\nInstallation\n============\n\nStable version\n\n.. code-block:: console\n\n pip (or pip3) install habanero\n\n\nIf you would like to fix bibtex format citations using content negotiation you'll have to install the optional dependency bibtexparser >= 2.0.0b7 (done for you with optional `[bibtex]`)\n\n.. code-block:: console\n\n pip (or pip3) install habanero[bibtex]\n\n\nDev version\n\n.. code-block:: console\n\n pip install git+https://github.com/sckott/habanero.git#egg=habanero\n\n\nOr build it yourself locally\n\n.. code-block:: console\n\n git clone https://github.com/sckott/habanero.git\n cd habanero\n make install\n\nUsage\n=====\n\nInitialize a client\n\n.. code-block:: python\n\n from habanero import Crossref\n cr = Crossref()\n\nWorks route\n\n.. code-block:: python\n \n # query\n x = cr.works(query = \"ecology\")\n x['message']\n x['message']['total-results']\n x['message']['items']\n\n # fetch data by DOI\n cr.works(ids = '10.1371/journal.pone.0033693')\n\nMembers route\n\n.. code-block:: python\n \n # ids here is the Crossref Member ID; 98 = Hindawi\n cr.members(ids = 98, works = True)\n\nCitation counts\n\n.. code-block:: python\n\n from habanero import counts\n counts.citation_count(doi = \"10.1016/j.fbr.2012.01.001\")\n\nContent negotiation - get citations in many formats\n\n.. code-block:: python\n\n from habanero import cn\n cn.content_negotiation(ids = '10.1126/science.169.3946.635')\n cn.content_negotiation(ids = '10.1126/science.169.3946.635', format = \"citeproc-json\")\n cn.content_negotiation(ids = \"10.1126/science.169.3946.635\", format = \"rdf-xml\")\n cn.content_negotiation(ids = \"10.1126/science.169.3946.635\", format = \"text\")\n cn.content_negotiation(ids = \"10.1126/science.169.3946.635\", format = \"text\", style = \"apa\")\n cn.content_negotiation(ids = \"10.1126/science.169.3946.635\", format = \"bibentry\")\n\nMeta\n====\n\n* Please note that this project is released with a `Contributor Code of Conduct <https://github.com/sckott/habanero/blob/main/CODE_OF_CONDUCT.md>`__. By participating in this project you agree to abide by its terms.\n* License: MIT; see `LICENSE file <https://github.com/sckott/habanero/blob/main/LICENSE>`__\n\n.. |pypi| image:: https://badge.fury.io/py/habanero.svg\n :target: https://badge.fury.io/py/habanero\n :alt: pypi\n\n.. |docs| image:: https://readthedocs.org/projects/habanero/badge/?version=latest\n :target: http://habanero.rtfd.org/\n :alt: Docs\n\n.. |ghactions| image:: https://github.com/sckott/habanero/actions/workflows/python.yml/badge.svg?branch=main\n :target: https://github.com/sckott/habanero/actions/workflows/python.yml\n :alt: ghactions\n\n.. |coverage| image:: https://codecov.io/gh/sckott/habanero/branch/main/graph/badge.svg?token=6RrgNAuQmR\n :target: https://codecov.io/gh/sckott/habanero\n :alt: coverage\n\n.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n :target: https://github.com/astral-sh/ruff\n :alt: Ruff\n\n.. |uv| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json\n :target: https://github.com/astral-sh/uv\n :alt: uv\n",
"bugtrack_url": null,
"license": "Copyright (C) 2024 Scott Chamberlain\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n ",
"summary": "Low Level Client for Crossref Search API",
"version": "2.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/sckott/habanero/issues",
"Changelog": "https://github.com/sckott/habanero/blob/main/Changelog.rst",
"Documentation": "https://habanero.readthedocs.io/",
"Homepage": "https://github.com/sckott/habanero",
"Repository": "https://github.com/sckott/habanero"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e8000796cbcae4a192c63b82c3dddb1135e9e7d43199ff7ba145d0bed7d7eb2d",
"md5": "f88858c57f523a65a3595c67772c9fec",
"sha256": "d6d5524f9d78c9cd2b09ff5ee3dc7ab3bca295675a1a0bd703b6c74910c6dbd4"
},
"downloads": -1,
"filename": "habanero-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f88858c57f523a65a3595c67772c9fec",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 28419,
"upload_time": "2025-02-04T23:24:32",
"upload_time_iso_8601": "2025-02-04T23:24:32.850043Z",
"url": "https://files.pythonhosted.org/packages/e8/00/0796cbcae4a192c63b82c3dddb1135e9e7d43199ff7ba145d0bed7d7eb2d/habanero-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c67ac015a6b009aa1c15732300ad2f255a728f90c33f1f57fd5545e852b2eb2f",
"md5": "4ad978ea7106f1930cc23387d9304fd2",
"sha256": "18c5c3b59b8db1887811da6de8bd976ac4077d61a25a058f3a67044e8bcab8eb"
},
"downloads": -1,
"filename": "habanero-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "4ad978ea7106f1930cc23387d9304fd2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 1753406,
"upload_time": "2025-02-04T23:24:36",
"upload_time_iso_8601": "2025-02-04T23:24:36.780087Z",
"url": "https://files.pythonhosted.org/packages/c6/7a/c015a6b009aa1c15732300ad2f255a728f90c33f1f57fd5545e852b2eb2f/habanero-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-04 23:24:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sckott",
"github_project": "habanero",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "habanero"
}