How ayerdines/meroshare-scripts works
Purpose and Execution Model
This is a Python CLI for bulk MeroShare IPO workflows: list open ordinary-share issues, inspect per-account application status, submit IPO applications, and generate allotment reports. The sole executable entry point is main.py; shared constants are in constants.py.
CLI Orchestration
main.py parses shell flags and selects one of three primary modes:
• Default: discover open IPOs and show whether configured users have applied.
• --apply: submit a selected company share ID and quantity.
• --report: generate allotment-status reports.
The optional --user flag constrains all modes to one account rather than the full account set.
Paths: main.py, constants.py
Account Input Boundary
Credentials/account metadata are loaded from a local CSV file, expected to be created as accounts.csv using the documented schema in accounts.csv.example. This is the operational boundary for bulk actions: each selected account is processed independently, enabling all-account execution and user filtering.
Paths: accounts.csv.example, main.py
IPO Discovery and Status Checking
The default flow queries MeroShare issue data, filters to currently open ordinary IPO shares, then checks application state for each selected account. It exposes the company share ID needed by the apply flow and distinguishes applied versus unapplied status.
Paths: main.py, constants.py
Bulk Application Stage
Application mode requires --company-share-id; --number-of-shares defaults to 10. The workflow iterates selected accounts, checks whether each account has already applied for the requested issue, skips duplicates, and submits only missing applications. This pre-check is the key idempotency guard for repeated bulk runs.
Paths: main.py
Allotment Reporting Stage
Report mode retrieves IPO allotment outcomes for one account or all configured accounts. It is separate from application submission and is controlled by --report, allowing post-issue result collection without changing application state.
Paths: main.py
Runtime and External Dependencies
The repository targets Python 3 and is intended for direct local execution (python3 main.py). It integrates with MeroShare’s remote service for issue discovery, application-status checks, application submission, and allotment lookup. Local account credentials are sensitive operational input and should remain outside version control; .gitignore supports that boundary.
Paths: main.py, .gitignore, .tool-versions
Main entry points: main.py CLI entry point · constants.py Shared constants · accounts.csv.example Account CSV schema · .gitignore Credential exclusion
Components 15
CLI runtime
- Shell user
- CLI entry point · Parses flags, selects accounts, and orchestrates workflows.
main.py - Shared constants
constants.py - Account CSV schema · Documents the required local account input format.
accounts.csv.example - Local accounts CSV · Credentials and account metadata for bulk processing.
- Credential exclusion · Keeps local account input outside version control.
.gitignore - CLI results · Shows issues, application state, and allotment reports.
Workflow modes
- Discovery and status mode · Lists open ordinary IPOs and per-account application state.
main.py - Bulk application mode · Applies the requested share quantity to eligible accounts.
main.py - Already-applied guard · Skips accounts that already applied for the selected issue.
main.py - Allotment report mode · Retrieves post-issue outcomes without submitting applications.
main.py
MeroShare service
- Issue discovery · Supplies IPO issue data.
- Application status · Returns account application state by issue.
- IPO submission
- Allotment lookup
Connections 19
- Shell user → CLI entry point: python3 main.py + flags
- Shared constants → CLI entry point: shared values
- Account CSV schema → Local accounts CSV: documents schema
- Local accounts CSV → CLI entry point: selected accounts
- Credential exclusion → Local accounts CSV: protects local file
- CLI entry point → Discovery and status mode: default
- CLI entry point → Bulk application mode: --apply
- CLI entry point → Allotment report mode: --report
- Discovery and status mode → Issue discovery: query issues
- Discovery and status mode → Application status: check each account
- Issue discovery → Discovery and status mode: open ordinary shares
- Application status → Discovery and status mode: applied/unapplied
- Bulk application mode → Already-applied guard: per account and issue
- Already-applied guard → Application status: check existing application
- Already-applied guard → IPO submission: submit only if missing
- Allotment report mode → Allotment lookup: retrieve outcomes
- Discovery and status mode → CLI results: issues and statuses
- Bulk application mode → CLI results: submission results
- Allotment report mode → CLI results: allotment report