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

wikiscores

v1.1.5

Published

Command-line tool that extracts structured data about all of the US Supreme Court Cases since 2000

Downloads

6

Readme

wikiscores

A Command-line tool that extracts structured data about all of the US Supreme Court Cases since 2000. Developed for my brother to use to harvest some data.

Prerequisites

  • Node JS brew install node or brew install nvm then nvm install 14.15.0 (or whatever is the most recent LTS version)

Installation

Install wikiscores as a global module as follows:

npm i -g wikiscores

Simple Usage

From a Terminal run

wikiscores

This will go to the Lists_of_United_States_Supreme_Court_cases page in wikipedia and get a list of all of the 'Term Opinions'. And for Each 'Term Opinion' it grabs the 'Cases', and for each Case it grabs some statistical data.

Options

  1. By default it will write it to a file output.csv but you can specify the relative file path via the -o flag.
  2. You can rate limit it with the -r option to specify the max number of requests per second.
  3. You can limit the concurrency with the -c option to restrict the number of simultaneous requests.
  4. You can filer for a specific case name with the -f option. (replace spaces with _)
wikiscores -o some/other/output.csv -r 10 -c 2 -f Bush_v._Palm_Beach_County

See

wikiscores --help

for more info.

Development

Fork this repo and use the forked-git-flow process as outlined in the Contributing notes.

Branches

| Branch | Tests | Code Coverage | Audit | Comments | | ------ | ----- | ------------- | ----- | ---------| | develop | CircleCI | codecov | Vulnerabilities | Latest Staging Release | | master | CircleCI | codecov | Vulnerabilities | Latest Production Release |

Functional Requirements

Scrape a list of Term Opinions from a list of US Supreme Court Cases, and from each one grab a list of individual cases. For each case grab data in the form:

{
  "term": 2002, // the term year
  "title": "Some title",
  "defaultSort": "Some default sort title",
  "length": 100, // the length of the article in bytes
  "articleId": 12345, // the numeric article id
  "contentModel": "wikitext",
  "watchers": 33, // The number of watchers, or the phrase 'Fewer than 30 watchers'
  "edits": 22, //number of edits
  "recentEdits": 20, // number of recent edits
  "monthCount": 55, // number of reads in the last month
  "createdAt": '2010-12-28T19:35:00.000Z', // date created in Zulu Time format"
  "creator": "The username of the original editor",
}

Test it

  • npm test — runs the unit tests (quick, runs offline)
  • npm test:unit:cov — runs the unit tests with code coverage

Lint it

npm run lint

Contributing

Please see the contributing notes.