@ausecon/core 0.0.0-stage → 0.0.0
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/LICENSE +23 -0
- package/README.md +48 -2
- package/dist/index.d.ts +28 -0
- package/dist/index.js +20 -0
- package/package.json +30 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jack McPherson
|
|
4
|
+
Copyright (c) 2018 Zoe Meers and Matt Cowgill (readabs)
|
|
5
|
+
Copyright (c) 2020 Matt Cowgill (readrba)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@ausecon/core`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@ausecon/core` is a TypeScript library that reads Australian economic data
|
|
4
|
+
from the Australian Bureau of Statistics (ABS) and the Reserve Bank of
|
|
5
|
+
Australia (RBA). It ports the `readabs` and `readrba` R packages and uses
|
|
6
|
+
[Effect](https://effect.website).
|
|
7
|
+
|
|
8
|
+
The library uses no Node, Bun, or Deno APIs. It runs on Node 22.18 or later,
|
|
9
|
+
Bun, and Deno.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Status
|
|
14
|
+
|
|
15
|
+
The library is in development. No release exists.
|
|
16
|
+
|
|
17
|
+
The first release reads ABS time series by catalogue number and table number,
|
|
18
|
+
or by series ID. The package now exports these schemas and errors:
|
|
19
|
+
|
|
20
|
+
- `CatalogueNumber`, such as `6202.0` or `6291.0.55.001`
|
|
21
|
+
- `SeriesId`, such as `A84423050A`
|
|
22
|
+
- `TableNumber`, such as `1`, `5a`, or `X28`
|
|
23
|
+
- `SeriesNotFound`, the error when the Time Series Directory has no record of
|
|
24
|
+
a series
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { CatalogueNumber } from "@ausecon/core";
|
|
28
|
+
import { Schema } from "effect";
|
|
29
|
+
|
|
30
|
+
Schema.is(CatalogueNumber)("6202.0"); // true
|
|
31
|
+
Schema.is(CatalogueNumber)("6202"); // false
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```shell
|
|
37
|
+
npm install @ausecon/core effect
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Links
|
|
41
|
+
|
|
42
|
+
- [Command-line tool](https://www.npmjs.com/package/ausecon)
|
|
43
|
+
- [Source and glossary](https://github.com/jackemcpherson/ausecon)
|
|
44
|
+
- [`readabs` R package](https://github.com/MattCowgill/readabs)
|
|
45
|
+
- [`readrba` R package](https://github.com/MattCowgill/readrba)
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT. The license keeps the copyright notices of `readabs` and `readrba`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* An ABS catalogue number, such as `6202.0` or `6291.0.55.001`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CatalogueNumber: Schema.brand<Schema.String, "CatalogueNumber">;
|
|
6
|
+
/** A decoded ABS catalogue number. */
|
|
7
|
+
export type CatalogueNumber = typeof CatalogueNumber.Type;
|
|
8
|
+
/**
|
|
9
|
+
* An ABS series ID, such as `A84423050A`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SeriesId: Schema.brand<Schema.String, "SeriesId">;
|
|
12
|
+
/** A decoded ABS series ID. */
|
|
13
|
+
export type SeriesId = typeof SeriesId.Type;
|
|
14
|
+
/**
|
|
15
|
+
* The number in the ABS title of a table, such as `1`, `5a`, `X28`, or
|
|
16
|
+
* `021_MTH`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TableNumber: Schema.brand<Schema.String, "TableNumber">;
|
|
19
|
+
/** A decoded ABS table number. */
|
|
20
|
+
export type TableNumber = typeof TableNumber.Type;
|
|
21
|
+
declare const SeriesNotFound_base: Schema.Class<SeriesNotFound, Schema.TaggedStruct<"SeriesNotFound", {
|
|
22
|
+
readonly seriesIds: Schema.$Array<Schema.brand<Schema.String, "SeriesId">>;
|
|
23
|
+
}>, import("effect/Cause").YieldableError>;
|
|
24
|
+
/**
|
|
25
|
+
* The Time Series Directory has no record of one or more requested series.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SeriesNotFound extends SeriesNotFound_base {}
|
|
28
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* An ABS catalogue number, such as `6202.0` or `6291.0.55.001`.
|
|
5
|
+
*/
|
|
6
|
+
const CatalogueNumber = Schema.String.pipe(Schema.check(Schema.isPattern(/^\d{4}\.\d(?:\.\d{2}\.\d{3})?$/)), Schema.brand("CatalogueNumber"));
|
|
7
|
+
/**
|
|
8
|
+
* An ABS series ID, such as `A84423050A`.
|
|
9
|
+
*/
|
|
10
|
+
const SeriesId = Schema.String.pipe(Schema.check(Schema.isPattern(/^[A-Z]\d+[A-Z]$/)), Schema.brand("SeriesId"));
|
|
11
|
+
/**
|
|
12
|
+
* The number in the ABS title of a table, such as `1`, `5a`, `X28`, or
|
|
13
|
+
* `021_MTH`.
|
|
14
|
+
*/
|
|
15
|
+
const TableNumber = Schema.String.pipe(Schema.check(Schema.isPattern(/^[A-Z]?\d+[A-Za-z]?(?:_[A-Za-z0-9]+)?$/)), Schema.brand("TableNumber"));
|
|
16
|
+
/**
|
|
17
|
+
* The Time Series Directory has no record of one or more requested series.
|
|
18
|
+
*/
|
|
19
|
+
var SeriesNotFound = class extends Schema.TaggedError()("SeriesNotFound", { seriesIds: Schema.Array(SeriesId) }) {};
|
|
20
|
+
export { CatalogueNumber, SeriesId, SeriesNotFound, TableNumber };
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ausecon/core",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Read Australian economic data from the ABS and RBA.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jackemcpherson/ausecon.git",
|
|
9
|
+
"directory": "packages/core"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "vp pack"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"effect": "4.0.6",
|
|
27
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22.18.0"
|
|
31
|
+
}
|
|
32
|
+
}
|