Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug report
description: Something does not work as documented
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for reporting a problem. Please never include your Equasis password, your
credentials file, or pages saved with `--save-html` that still contain your name.
- type: input
id: version
attributes:
label: equasis-cli version
description: Output of `equasis --version`
placeholder: equasis 3.0.0
validations:
required: true
- type: input
id: environment
attributes:
label: Operating system and Python version
placeholder: macOS 15, Python 3.13
validations:
required: true
- type: dropdown
id: mode
attributes:
label: Mode
options:
- Command line
- Interactive shell
- Python API
validations:
required: true
- type: textarea
id: command
attributes:
label: Command
description: The exact command you ran
render: shell
validations:
required: true
- type: textarea
id: expected
attributes:
label: What you expected
validations:
required: true
- type: textarea
id: actual
attributes:
label: What happened
description: Include the output and exit code. Re-running with `--debug` often helps.
render: text
validations:
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Security vulnerability
url: https://github.com/rhinonix/equasis-cli/security/advisories/new
about: Report security issues privately.
- name: Commercial licensing
url: https://github.com/rhinonix/equasis-cli/blob/main/LICENSING.md
about: Using equasis-cli commercially.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/equasis_changed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Equasis page changed
description: Exit code 6, "could not read the Equasis page", or data that is missing or in the wrong fields
labels: [bug]
body:
- type: markdown
attributes:
value: |
Equasis sometimes changes its website, which can break parsing. A copy of the page
makes this quick to fix.

1. Re-run the failing command with `--save-html pages --refresh`.
2. Open the saved page for the failing request in a text editor and replace your
name in the "Welcome" section with `Test User`.
3. Attach the edited page below.
- type: input
id: version
attributes:
label: equasis-cli version
description: Output of `equasis --version`
validations:
required: true
- type: textarea
id: command
attributes:
label: Command and output
render: text
validations:
required: true
- type: textarea
id: page
attributes:
label: Saved page (with your name removed)
description: Drag the HTML file here, or describe what looks different on equasis.org.
validations:
required: false
- type: checkboxes
id: privacy
attributes:
label: Privacy
options:
- label: I removed my name from any attached page
required: true
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Feature request
description: Suggest an improvement
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: What are you trying to do?
description: Describe the research or workflow problem, not only the solution.
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
- type: textarea
id: alternatives
attributes:
label: Alternatives you have considered
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Summary

<!-- What does this change and why? Link related issues, for example "Fixes #123". -->

## Checklist

- [ ] Tests added or updated (parser changes include a fixture made with `tests/tools/make_fixture.py`)
- [ ] `ruff check .`, `ruff format --check .`, `mypy`, and `pytest` pass
- [ ] Documentation updated for user-visible changes
- [ ] Entry added under "Unreleased" in `CHANGELOG.md`
- [ ] No credentials or personal information in code, fixtures, or logs
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release

# Publishing uses PyPI trusted publishing (OpenID Connect), so no API tokens are stored.
# - Run manually ("Run workflow") to publish to TestPyPI for a dry run.
# - Publishing a GitHub release publishes to PyPI after approval of the "pypi" environment.
# See RELEASING.md for the one-time setup.

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Check that the tag matches the package version
if: github.event_name == 'release'
env:
TAG: ${{ github.event.release.tag_name }}
run: |
version=$(python -c "import re, pathlib; print(re.search(r'__version__ = \"(.+)\"', pathlib.Path('src/equasis_cli/_version.py').read_text()).group(1))")
if [ "v$version" != "$TAG" ]; then
echo "::error::Tag $TAG does not match package version $version"
exit 1
fi
- name: Build and check
run: |
python -m pip install build twine
python -m build
python -m twine check --strict dist/*
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist/

testpypi:
name: Publish to TestPyPI
if: github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/equasis-cli
permissions:
id-token: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
repository-url: https://test.pypi.org/legacy/

pypi:
name: Publish to PyPI
if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/equasis-cli
permissions:
id-token: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Recorded Equasis pages are test data and must stay byte-for-byte as generated.
exclude: ^tests/fixtures/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand Down
111 changes: 111 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Changelog

All notable changes to equasis-cli are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
[Semantic Versioning](https://semver.org/).

## [Unreleased]

## [3.0.0] - 2026-09-16

A rebuild focused on reliability, correct data, and scripting. Existing users should read
**Upgrading from 2.x** below.

### Fixed

- Interactive `batch` did nothing ([#16](https://github.com/rhinonix/equasis-cli/issues/16)).
- Interactive `/output file.json` and `/output file.csv` wrote table text instead of JSON
or CSV ([#17](https://github.com/rhinonix/equasis-cli/issues/17)).
- Interactive `fleet` did nothing ([#18](https://github.com/rhinonix/equasis-cli/issues/18)).
- An expired Equasis session was reported as "No vessel found". The session is now renewed
automatically.
- An inspection reported to two PSC regimes produced an extra, garbled inspection record.
- Every inspection was flagged as a detention in table output.
- Tables were read by column position, so values could land in the wrong fields.
Columns are now matched by their headers.
- Permanent HTTP errors such as 404 were retried, and `Retry-After` was ignored.
- Status messages were printed into JSON and CSV output, and every failure exited with
status 0.
- CSV output did not quote values containing commas and had no header for single vessels.
- `--output` and `--output-file` only worked before the command name.
- `--debug` had no effect, and `--continue-on-error` did nothing.
- Batch files with inline `#` comments sent the comment to Equasis as part of the IMO number.
- Interactive log messages appeared twice, and typographic quotes and parameters such as
`/company-file` were not recognized.
- Search and fleet results beyond the first page were missing.
- The Comoros flag was reported with the code `XCM` instead of `COM`.

### Added

- Indicators: name, flag, and management changes; recent inspections, detentions, and
deficiencies; grey or black listed flags; USCG targeting; class withdrawals and
suspensions; P&I insurance; and whether the MMSI matches the flag state.
- New vessel data: safety management certificates, P&I insurance, class renewal surveys,
classification history, human element deficiencies, and company roles with dates.
- Fleet data: class, detention counts, and the roles the company holds for each vessel.
- `search --imo`, `--mmsi`, and `--call-sign` for exact lookups, plus `--type`,
`--max-pages`, and `--all-pages`.
- `fleet` accepts company numbers (`--company-id`), prompts when a name is ambiguous, and
supports `--first-match`.
- JSON Lines output (`-f jsonl`), which streams batch results as they complete.
- A 24-hour page cache with `--no-cache`, `--refresh`, and `equasis cache [info|clear]`
([#2](https://github.com/rhinonix/equasis-cli/issues/2)).
- `--delay`, `--save-html`, `--quiet`, `--no-color`, `configure --test`, and `--version`.
- Documented exit codes for scripting.
- Batch input from standard input (`--imo-file -`) and IMO check-digit warnings.
- Interactive `help COMMAND`, `cache`, `/refresh`, `/pages`, and `/first`.
- A typed Python API (`EquasisClient`, models, and `compute_indicators`).
- Tests with recorded Equasis pages, continuous integration on Linux, macOS, and Windows,
and a weekly live check against equasis.org.

### Changed

- Relicensed from CC BY-NC-SA 4.0 to the PolyForm Noncommercial License 1.0.0, with an
additional permission for journalism and nonprofit research (see LICENSING.md).
- Python 3.10 or later is required.
- JSON output uses a versioned envelope (`schema_version`, `type`, `retrieved_at`), ISO 8601
dates, and integer tonnages. The layout is documented in docs/output-schema.md.
- CSV output was redesigned: one row per vessel with key facts and indicators, and batch
files use a `lookup_status` column.
- Batches continue after failures by default; use `--fail-fast` to stop.
- Credentials are written atomically with owner-only permissions. A warning is shown if
the credentials file is readable by others.
- `-f/--format` is the name of the format option (`--output` still works) and
`-o/--output-file` sets the output file.
- Progress messages, warnings, and errors are written to stderr.

### Removed

- The `.env` file references (credentials come from `configure --setup` or environment
variables) and the unused `python-dotenv` and `lxml` dependencies.
- The unused `--batch` option.
- The startup banner before command output. `--no-banner` is still accepted and has no
effect.

### Upgrading from 2.x

- Update scripts that read JSON: vessel fields are under `.vessel` (for example
`.vessel.name` instead of `.basic_info.name`), and dates are ISO 8601.
- Update scripts that read CSV to use the new column names.
- Scripts that relied on exit status 0 for failures should check for the new codes.
- The Python API changed: use `EquasisClient.get_vessel`, `search`, `search_ships`, and
`get_fleet`.

## [2.0.0] - 2025-10-01

### Added

- Full-screen interactive shell with command menus, loading indicators, and scroll mode.
- Company search and fleet retrieval by company number.

## [1.0.0] - 2025-09-27

### Added

- First stable release: vessel lookup across the Ship Info, Inspections, and Ship History
pages, vessel search, fleets, batch processing, retries, and credential management.

[Unreleased]: https://github.com/rhinonix/equasis-cli/compare/v3.0.0...HEAD
[3.0.0]: https://github.com/rhinonix/equasis-cli/compare/v2.0.0...v3.0.0
[2.0.0]: https://github.com/rhinonix/equasis-cli/compare/v1.0.0...v2.0.0
[1.0.0]: https://github.com/rhinonix/equasis-cli/releases/tag/v1.0.0
Loading