open-tax 0.0.0-stage → 0.1.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/NOTICE +39 -0
- package/README.md +60 -2
- package/dist/cli.js +941 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +777 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +287 -0
- package/dist/index.d.ts +287 -0
- package/dist/index.js +765 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -4
- package/schemas/dictionary-entry.schema.json +132 -0
- package/schemas/policy-diff.schema.json +203 -0
- package/schemas/regime.schema.json +323 -0
package/NOTICE
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Open-Tax
|
|
2
|
+
Copyright 2026 GLC Works
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0
|
|
5
|
+
(the "License"). You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
|
|
15
|
+
Attribution
|
|
16
|
+
-----------
|
|
17
|
+
Open-Tax is a project of GLC Works:
|
|
18
|
+
https://github.com/glc-works/open-tax
|
|
19
|
+
|
|
20
|
+
If you redistribute the Work or a Derivative Work, keep a copy of this
|
|
21
|
+
NOTICE with the distribution. Apache-2.0 Section 4(d) requires that
|
|
22
|
+
notices contained in a NOTICE file be included with Derivative Works.
|
|
23
|
+
|
|
24
|
+
Third-party projects
|
|
25
|
+
--------------------
|
|
26
|
+
Open-Tax does not copy source code from GOBL (https://github.com/invopop/gobl),
|
|
27
|
+
OpenFisca (https://openfisca.org/), or datasets/harmonized-system
|
|
28
|
+
(https://github.com/datasets/harmonized-system). Those projects are
|
|
29
|
+
credited as architectural inspiration in README.md and benchmarks/.
|
|
30
|
+
They remain under their own licenses. Do not remove those credits from
|
|
31
|
+
derivative documentation that still relies on the comparison.
|
|
32
|
+
|
|
33
|
+
Legal texts
|
|
34
|
+
-----------
|
|
35
|
+
Names of statutes, article numbers, rates copied from those sources, and
|
|
36
|
+
official URLs are included so maintainers can check primary materials.
|
|
37
|
+
They are identifications of law, not a republication of the official
|
|
38
|
+
texts. Tax administrations and gazette publishers retain whatever rights
|
|
39
|
+
they hold in their own publications.
|
package/README.md
CHANGED
|
@@ -1,3 +1,61 @@
|
|
|
1
|
-
#
|
|
1
|
+
# open-tax
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Reference loader and command-line tool for [Open-Tax](https://github.com/glc-works/open-tax) jurisdiction packs.
|
|
4
|
+
|
|
5
|
+
Apache-2.0. See the repository [NOTICE](https://github.com/glc-works/open-tax/blob/main/NOTICE) for the attribution redistributors keep under Section 4(d).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Requires Node.js 20 or newer.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx open-tax --help
|
|
13
|
+
pnpm dlx open-tax --help
|
|
14
|
+
npm install -g open-tax
|
|
15
|
+
pnpm add -g open-tax
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Homebrew:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
brew tap glc-works/tap
|
|
22
|
+
brew install open-tax
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`brew install glc-works/tap/open-tax` is the same command. The tap formula is maintained from [`packaging/homebrew`](https://github.com/glc-works/open-tax/blob/main/packaging/homebrew/README.md).
|
|
26
|
+
|
|
27
|
+
Use the library from another project with `npm install open-tax` or `pnpm add open-tax`.
|
|
28
|
+
|
|
29
|
+
## Command line
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
open-tax --help
|
|
33
|
+
open-tax --version
|
|
34
|
+
open-tax validate
|
|
35
|
+
open-tax validate packs/id
|
|
36
|
+
open-tax validate packs/id/regime.json
|
|
37
|
+
open-tax resolve packs/id/regime.json --date 2025-06-01 [--semantic <code>] [--tax <id>] [--treatment <id>]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`validate` checks a checkout that contains `schemas/` and `packs/`, one pack folder, or a `regime.json` file. With no path, it searches upward from the current directory.
|
|
41
|
+
|
|
42
|
+
`resolve` prints the JSON array returned by `resolveTaxAtDate`. `base_formula` and `value` are copied as published. The command does not evaluate the formula.
|
|
43
|
+
|
|
44
|
+
`--version` reads `version` from this package's `package.json`.
|
|
45
|
+
|
|
46
|
+
## Library
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { validatePack, resolveTaxAtDate, diffPolicyChanges, getSchemas } from "open-tax";
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `validatePack(regime)` checks JSON Schema draft 2020-12 and pack integrity (citations, successor links, non-overlapping dates).
|
|
53
|
+
- `resolveTaxAtDate(regime, { date, treatmentId, semanticCode, taxId })` returns the versions in force on that inclusive date. It returns `base_formula` and any stated `value` as written. It does not evaluate the formula.
|
|
54
|
+
- `diffPolicyChanges(diffs, filter)` filters maintainer-authored policy diffs. `diffPolicyChanges(before, after)` reports structural edits between two regimes and does not invent a legal citation.
|
|
55
|
+
- `getSchemas()` returns the regime, policy-diff, and dictionary schemas. After `npm run build`, the same files are importable as `open-tax/schemas/regime.schema.json` and its siblings.
|
|
56
|
+
|
|
57
|
+
Build with `npm run build` from this package or from the repository root. The `open-tax` bin is `dist/cli.js` and starts with `#!/usr/bin/env node`.
|
|
58
|
+
|
|
59
|
+
A dataset pull request does not publish this package. A tag `vX.Y.Z` matching `version` in `package.json` runs the repository release workflow, which publishes to npm when `NPM_TOKEN` is configured.
|
|
60
|
+
|
|
61
|
+
Pack authoring, country maintainer steps, and the Indonesia starter live in the repository, not in this README.
|