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

scouting-schedule-generator

v0.4.0

Published

An FRC scouting schedule generator

Downloads

20

Readme

scouting-schedule-generator

A scouting schedule generator for FIRST® Robotics Competition.

Currently, it comes with two options for importing the match schedule: The Blue Alliance API and the FRC API. Then, a scheduling algorithm will assign scouters to matches. There are two scheduling algorithms: the simple algorithm and the complex algorithm. The simple algorithm simply goes around and always picks the scouter for a team in a match of the list of scouters, rotating them out after some number of matches. The complex algorithm has more options, which you can read about below. Finally, an exporter layer exports the match schedule with scouters assigned, either to JSON, CSV, or an Excel workbook.

CLI Usage

General Options

Usage: scouting-schedule-generator [options] [command]

Options:
  -o, --output <filename>         Output to a file. If not specified, output to stdout.
  -f, --format <format>           Output format. (choices: "json", "csv", "xlsx", default: "json")
  -l, --locale <locale>           Date locale (e.g. en-US). (default: "en-US")
  -t, --timezone <timezone>       Timezone, an IATA timezone identifier. (default: "America/New_York")
  -e, --event-code <eventCode>    Use FIRST API with this event code. Make sure to set FIRST_API_KEY and FIRST_USERNAME in your environment variables.
  -T, --tba-api <eventKey>        Use The Blue Alliance API. Make sure to set TBA_API_KEY in your environment varaibles.
  -y, --year <year>               Use FIRST API with this year. Make sure to set FIRST_API_KEY and FIRST_USERNAME in your environment variables. (default: 2024)
  -L, --match-level <matchLevel>  Match level to import from FIRST API. Make sure to set FIRST_API_KEY and FIRST_USERNAME in your environment variables. (choices: "Qualification", "Playoff", "Practice", default: "Qualification")
  -s, --scouter <scouter...>      Scouter name
  -h, --help                      display help for command

Commands:
  simple [options]                Simple scheduler
  complex [options]               Complex scheduler
  help [command]                  display help for command

Simple Scheduler

Usage: scouting-schedule-generator simple [options]

Simple scheduler

Options:
  -r, --rotate-after <number>  Rotate after this many matches (default: 4)
  -h, --help                   display help for command

Complex Scheduler

Usage: scouting-schedule-generator complex [options]

Complex scheduler

Options:
  -u, --us-teams <team...>             Teams we're scouting for
  -b, --scout-before-play <matches>    The number of matches to scout before a team plays with or against a team in usTeams. (default: 2)
  -S, --soft-limit <limit>             After the soft limit is reached, scouters will be rotated out of scouting if possible. However, if more scouters are needed than have not reached the soft limit, these scouters can still be used. (default: 4)
  -h, --hard-limit <limit>             After the hard limit is reached, scouters will be rotated out of scouting if possible. Even if more scouters are needed than have not reached the hard limit, the scouters that have reached the hard limit will not be used. This can result in teams which should be scouted in a match not being scouted. (default: 8)
  -E, --end-scout <matches>            The last end-scout matches for each team will be scouted. (default: 3)
  -k, --skip-start-scout <matches>     The number of matches to skip before starting to scout start-scout matches. (default: 3)
  -a, --start-scout <matches>          The number of matches to scout after skipping skip-start-scout matches. (default: 3)
  -m, --min-scout <times>              The minimum number of times a team should be scouted. (default: 6)
  -M, --min-scouter-at-match <number>  The minimum number of scouters that should be at each match. This is useful if you want somebody to be watching each match, even if the other parameters don't cause any of the teams in it to be scouted. (default: 1)
  -U, --url-template <urlTemplate>     URL template for scouter links. Only works with xlsx format. Default is no link. See README for more information.
  --help                               display help for command

Web Usage

To include the latest version of the library on the web, insert

<script src="https://cdn.jsdelivr.net/npm/scouting-schedule-generator/dist/index.web.js" />

It's recommended that you pin a version, like so:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.web.js" />

You can then access the functions csvExporter, jsonExporter, apiImporter, tbaImporter, complexScheduler, and simpleScheduler on the object ScoutingScheduleGenerator.

Node.js Usage

Install the library using

$ npm install scouting-schedule-generator

Then, assuming your PATH is set correctly, you should be able to use the CLI as described above. To use the library, you can either (ESM)

import { csvExporter, jsonExporter, apiImporter, tbaImporter, complexScheduler, simpleScheduler } from "scouting-schedule-generator";

or (CommonJS)

const { csvExporter, jsonExporter, apiImporter, tbaImporter, complexScheduler, simpleScheduler } = require("scouting-schedule-generator");

Why?

The simple algorithm is one which is used by a lot of scouting systems. However, it is less than ideal when you don't have at least 12 scouters. Thus, I wrote the complex algorithm to scout the matches which will have the most value for planning matches as well as for alliance selection.

URL Template

If your scouting operation uses forms, and you are generating an Excel schedule, you have the option to make each scouter's name on the sheet link to the form with fields already filled out. Specify -U on the command line for this. The template will be a URL with an arbitrary amount of keys, listed as {key}. Keys can be any key in the types ScoutingMatch or ScoutingTeam (see types.ts). If you use Google Forms, check out this link. Note, however, that some things have changed since then and the <input> elements are not next to their respective form fields, rather they are at the bottom of the HTML. This means you'll have to try editing the value of the <input> element in the Inspect panel to find which form field it's associated with.