mostlyright 0.1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # mostlyright
2
2
 
3
- Convenience meta-package for the [mostlyright](https://github.com/mostlyrightmd/mostlyright-sdk) TypeScript SDK. Re-exports the surfaces of `@mostlyrightmd/core`, `@mostlyrightmd/weather`, and `@mostlyrightmd/markets` so a single `import { research } from "mostlyright"` works.
3
+ **The public data SDK for quants and AI agents.**
4
+
5
+ `mostlyright` is the convenience meta-package for the TypeScript SDK. A single `import { research } from "mostlyright"` re-exports the surfaces of `@mostlyrightmd/core`, `@mostlyrightmd/weather`, and `@mostlyrightmd/markets` — weather observations, prediction-market resolvers, and the core join. Direct calls to public APIs. No hosted backend, no API key.
6
+
7
+ Weather + prediction-markets data are live today. SEC filings (EDGAR) and Federal Reserve economic data (FRED) are next.
4
8
 
5
9
  If you only need one slice of the SDK, depend on the scoped packages directly. If you want everything in one import, this is the package.
6
10
 
@@ -11,6 +15,15 @@ pnpm add mostlyright
11
15
  # or: npm install mostlyright
12
16
  ```
13
17
 
14
- ## Docs
18
+ ## Quickstart
19
+
20
+ ```ts
21
+ import { research } from "mostlyright";
22
+
23
+ const rows = await research("KNYC", "2025-01-06", "2025-01-12");
24
+ console.log(rows[0]);
25
+ ```
26
+
27
+ ## Documentation
15
28
 
16
- See <https://mostlyright.md/docs/sdk/> for quickstart, concepts, and the full API reference.
29
+ Quickstart, concepts, and the full API reference live at <https://mostlyright.md/docs/sdk/>.
@@ -886,13 +886,7 @@ async function* stream(station, opts = {}) {
886
886
 
887
887
  // ../weather/src/forecasts/iem-mos.ts
888
888
  var IEM_MOS_URL = "https://mesonet.agron.iastate.edu/api/1/mos.json";
889
- var SUPPORTED_MODELS = /* @__PURE__ */ new Set([
890
- "nbe",
891
- "gfs",
892
- "lav",
893
- "met",
894
- "ecm"
895
- ]);
889
+ var SUPPORTED_MODELS = /* @__PURE__ */ new Set(["nbe", "gfs", "lav", "met", "ecm"]);
896
890
  var KT_TO_MS = 0.5144444;
897
891
  var NBE_CYCLE_CUTOVER = Date.UTC(2026, 5 - 1, 5, 0, 0, 0);
898
892
  function runtimeHoursFor(model, fromDt, toDt) {
@@ -935,9 +929,7 @@ function parseRow(raw, station, model, retrievedAt) {
935
929
  const issuedDt = parseDate(raw.runtime ?? raw.model_runtime);
936
930
  const validDt = parseDate(raw.ftime ?? raw.valid_time);
937
931
  if (issuedDt === null || validDt === null) return null;
938
- const forecastHour = Math.round(
939
- (validDt.getTime() - issuedDt.getTime()) / 36e5
940
- );
932
+ const forecastHour = Math.round((validDt.getTime() - issuedDt.getTime()) / 36e5);
941
933
  return {
942
934
  station,
943
935
  model: model.toUpperCase(),
@@ -960,9 +952,7 @@ function parseRow(raw, station, model, retrievedAt) {
960
952
  function parseIsoDate(iso, endOfDay) {
961
953
  const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso);
962
954
  if (match === null) {
963
- throw new Error(
964
- `iemMosForecasts: from/to dates must be ISO YYYY-MM-DD; got ${iso}`
965
- );
955
+ throw new Error(`iemMosForecasts: from/to dates must be ISO YYYY-MM-DD; got ${iso}`);
966
956
  }
967
957
  const [, y, m, d] = match;
968
958
  if (endOfDay) {
@@ -991,15 +981,13 @@ async function iemMosForecasts(station, fromDate, toDate, opts = {}) {
991
981
  if (rt < fromDt || rt > toDt) continue;
992
982
  const url = `${IEM_MOS_URL}?station=${encodeURIComponent(
993
983
  station
994
- )}&model=${encodeURIComponent(model)}&runtime=${encodeURIComponent(
984
+ )}&model=${encodeURIComponent(model.toUpperCase())}&runtime=${encodeURIComponent(
995
985
  rt.toISOString()
996
986
  )}`;
997
987
  const resp = await fetchFn(url);
998
988
  if (resp.status === 404) continue;
999
989
  if (!resp.ok) {
1000
- throw new Error(
1001
- `iemMosForecasts: HTTP ${resp.status} on ${url}`
1002
- );
990
+ throw new Error(`iemMosForecasts: HTTP ${resp.status} on ${url}`);
1003
991
  }
1004
992
  const payload = await resp.json();
1005
993
  for (const raw of payload.data ?? []) {