Skip to main content

Mendeley CLI

Project description

mendeley-cli

CLI for Mendeley

Install

pip install mendeley-cli

Docker image is also available.

docker image pull makisyu/mendeley

How to get Mendeley API token

To create, update, and delete resources in your Mendeley library via Mendeley API, OAUTH2 flow is required. We have to register and mark this mendeley-cli as a trusted application in your Mendeley (Elsevier) account by yourself.

1. Register mendeley-cli as a trusted app

https://dev.mendeley.com/myapps.html

Register a new app (if not exists)

Example

All fields are required.

  • Application name: MendeleyCLI
  • Description: MendeleyCLI
  • RegirectURL: http://localhost:8888
    • Port number is a variable; >1024 is recommended.
  • Generate secret, and save it securely.
  • Submit

You got Client ID, Client Secret and Redirect URL.

2. Generate OAUTH2 token

In a terminal, with setting the parameters by environment variables, get token by mendeley get token:

MENDELEY_CLIENT_ID=<...> MENDELEY_CLIENT_SECRET=<...> MENDELEY_REDIRECT_URI=<...> mendeley get token

Automatically web browser opens and shows the login page, and please login.

Then, the following messages show:

Login succeeded. You can close this window or tab.
Please follow messages in the terminal to save your token.

Also, the following messages show in the terminal:

Login succeeded.
Please set an environment variable MENDELEY_OAUTH2_TOKEN_BASE64, or add it to a config file:

MENDELEY_OAUTH2_TOKEN_BASE64=<...>

Now, all parameters to run mendeley_cli is retrieved.

3. Configure mendeley_cli

Save them to configuration file:

MENDELEY_CLIENT_ID=<...>
MENDELEY_REDIRECT_URI=<...>
MENDELEY_CLIENT_SECRET=<...>
MENDELEY_OAUTH2_TOKEN_BASE64=<...>

The configuration file must be ~/.mendeley_cli/config or <pwd>/.mendeley_cli/config. Alternatively, they can be specified by environment variables directly.

4. All set!

Run

mendeley get documents

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mendeley-cli-0.3.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

mendeley_cli-0.3.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file mendeley-cli-0.3.0.tar.gz.

File metadata

  • Download URL: mendeley-cli-0.3.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for mendeley-cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a63ebffb298476a7cb5a0b5bc49ed0b052ee62b1548e4cbe2951cc71e92ec61a
MD5 dfa8fad72c6adc749737039bf5c2ada1
BLAKE2b-256 bcdda2833def210ecdafce1957d0328b187743b45a1fdd275b91fd1f4b5950d1

See more details on using hashes here.

File details

Details for the file mendeley_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mendeley_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for mendeley_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25b99fcf90abca6fd3ebc094378aa4118473ed9ed36de4eabbc408e95cb54242
MD5 784e63dec5733a2a8ef4f785d8772366
BLAKE2b-256 b54f706d81b52d94404c2fe91bad50016bde1cdaa1dea8c5feb0337dfe05be66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page