Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
|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:
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
routemembers
- /members
routeprefixes
- /prefixes
routefunders
- /funders
routejournals
- /journals
routetypes
- /types
routelicenses
- /licenses
routeregistration_agency
- get DOI minting agencyrandom_dois
- get random set of DOIscounts
- citation counts. Includes the single citation_count
method
cn
- content negotiation. Includes the methods:
content_negotiation
- get citations in a variety of formatscsl_styles
- get CSL styles, used in content_negotation
methodWorksContainer
- 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
See the headers X-Rate-Limit-Limit
and X-Rate-Limit-Interval
for current rate limits.
To get in the polite pool it's a good idea now to include a mailto
email
address. See docs for more information.
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
Initialize a client
.. code-block:: python
from habanero import Crossref
cr = Crossref()
Works route
.. code-block:: python
x = cr.works(query = "ecology") x['message'] x['message']['total-results'] x['message']['items']
cr.works(ids = '10.1371/journal.pone.0033693')
Members route
.. code-block:: python
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")
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 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
FAQs
Low Level Client for Crossref Search API
We found that habanero demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.