npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zotero-categorise

v1.0.3

Published

A command-line tool to manage Zotero collections by placing items into specific collections based on their title, description, and tags.

Downloads

7

Readme

Zotero Categorise

A command-line tool to manage Zotero collections by placing items into specific collections based on their title, description, and tags.

Configuration

To create a zotero-cli.toml file, follow these steps:

  1. Open the terminal and create the zotero-cli.toml file using the nano text editor:

    mkdir -p ~/.config/zotero-cli
    nano ~/.config/zotero-cli/zotero-cli.toml
  2. Inside the zotero-cli.toml file, add the following content:

    api-key = "YOUR_ZOTERO_API_KEY"
    group-id = 123
    library-type = "group"
    indent = 4

Installation

To use this tool, you need to have Node.js installed on your system. You can install the required dependencies and run the tool with the following steps:

Clone this repository to your local machine:

git clone https://github.com/OpenDevEd/Zotero-Categorise.git
cd Zotero-Categorise
npm install

Binary

The package includes a binary zotero-categorise. You can install this with

npm build
npm link

If you do that, you can use zotero-categorise below.

Usage

Help works in the usual way

zotero-categorise
zotero-categorise -h
zotero-categorise collection -h
zotero-categorise generate -h
zotero-categorise collectionByJson -h

The collection command

You can use the collection command to place items into collections.

Here are the available options:

zotero-categorise collection -c <collection> -i <item...>

or

zotero-categorise collection -c zotero://select/groups/${Group-id}/collections/${CollectionId} -i zotero://select/Groups//${group-id}/items/${ItemId}

In this command, the option have this function:

  • -c, --collection <collection>: The id of a collection, which has sub-collections in which you want to place the items.
  • -i, --item [item...]: One or more Item Ids that you want to place in the collection.
  • --itemsfromcollection <collection>: Process items in the provided collection.
  • --itemswithtag <tag>: Process items with this tag.
  • --itemswithouttag <tag>: Process items that do not have this tag.
  • --itemsfromlibrary: Process all items in the library.

For example, if your collection structure is this:

Countries
- Sierra Leone
- Zambia
- Zimbabwe

Then by providing the collection id for 'Countries', items will be matched against Sierra Leone, Zambia, Zimbabwe, and placed in those collections.

Generating Keyword-Collection Mapping

The generate command allows you to create a JSON file that maps keywords to collections. This mapping is useful for automating the categorization process by periodically scanning your Zotero items.

zotero-categorise generate -- -c [collection1] [collection2]

Options:

  • -g, --group [group]: Specifies the Zotero group ID to work with.
  • -c, --collection [collection...]: Lists the Zotero collection IDs to include in the mapping.
  • -n, --name [name]: (Optional) Specifies the name of the JSON file that will be generated (default is 'list.json').

Categorize Items from JSON File

The collectionByJson command enables you to categorize items from a JSON file into Zotero collections.

zotero-categorise collectionByJson -- -j [json file] -i [item...]

Options:

  • -j, --json [json]: Specifies the JSON file that contains the keyword-collection mapping.
  • -i, --item [item...]: One or more Item Ids that you want to categorize into collections.
  • --itemsfromcollection <collection>: Process items in the provided collection.
  • --itemswithtag <tag>: Process items with this tag.
  • --itemswithouttag <tag>: Process items that do not have this tag.
  • --itemsfromlibrary: Process all items in the library.
  • -t, --test: Use test mode, which does not actually place items in the collection. This is useful for verification and testing.