Skip to main content

MoneyWiz-API

Static Badge PyPI

Buy Me A Coffee

A Python API to access MoneyWiz Sqlite database.

Table of Contents

Get Started

pip install moneywiz-api
from moneywiz_api import MoneywizApi

moneywizApi = MoneywizApi("<path_to_your_sqlite_file>")

(
    accessor,
    account_manager,
    payee_manager,
    category_manager,
    transaction_manager,
    investment_holding_manager,
) = (
    moneywizApi.accessor,
    moneywizApi.account_manager,
    moneywizApi.payee_manager,
    moneywizApi.category_manager,
    moneywizApi.transaction_manager,
    moneywizApi.investment_holding_manager,
)

record = accessor.get_record(record_id)
print(record)

It also offers a interactive shell moneywiz-cli.

Transaction investment symbols

DepositTransaction, RefundTransaction, and WithdrawTransaction expose an investment_symbol field. The default schema reads it from ZINVESTMENTSYMBOL. The value is a string, or None when the database value is null. The field is also included in the output of record.as_dict().

Schema profiles

MoneywizApi resolves the default SchemaProfile from the database path when it is constructed, then validates the profile before loading records. You do not need to pass a profile to MoneywizApi:

from moneywiz_api import MoneywizApi

api = MoneywizApi("<path_to_your_sqlite_file>")

# Rows that fail conversion or validation do not stop the load.
for failure in api.failed_records:
    print(failure.model_type, failure.raw, failure.error)
    # failure.record is the converted record, if conversion succeeded.

# Raise on the first record conversion or validation error instead.
strict_api = MoneywizApi("<path_to_your_sqlite_file>", strict=True)

For explicit loading, use MoneyWiz. Each call returns a new LoadResult:

from moneywiz_api import MoneyWiz, RecordLoadError

database = MoneyWiz("<path_to_your_sqlite_file>")
result = database.load(on_error="collect")
accounts = result.accounts.records()
failures = result.failed_records

try:
    database.load(on_error="raise")
except RecordLoadError as error:
    print(error.failure.raw, error.failure.error)

A SchemaProfile maps each Record field to one or more database column names and optional converters. Field specifications are available from moneywiz_api.schema.schema_fields, including schema_field, datetime_field, decimal_field, nullable_decimal_field, and is_one_field. Definitions for base classes are inherited by their subclasses. Calling profile.validate() checks that every public dataclass field on loaded Record subclasses has a definition; fields whose names start with _ are ignored.

To create a customized profile, start with DEFAULT_SCHEMA_PROFILE and replace the field mapping you need:

from moneywiz_api import DEFAULT_SCHEMA_PROFILE, SchemaProfile
from moneywiz_api.model.tag import Tag
from moneywiz_api.schema.schema_fields import schema_field

column_map = {
    **DEFAULT_SCHEMA_PROFILE.column_map,
    Tag: {
        **DEFAULT_SCHEMA_PROFILE.column_map[Tag.__name__],
        "name": schema_field("CUSTOM_TAG_NAME", "ZNAME6"),
    },
}
profile = SchemaProfile(column_map)
profile.validate()

SchemaProfileResolver(db_path, baseline=None).resolve() enriches a profile with database-specific tag-join table details. When no baseline is provided, it uses DEFAULT_SCHEMA_PROFILE. The resolved profile can be passed to MoneywizApi or the lower-level DatabaseAccessor:

db_path = "<path_to_your_sqlite_file>"
resolved_profile = SchemaProfileResolver(db_path, profile).resolve()
api = MoneywizApi(db_path, schema_profile=resolved_profile)

SchemaProfile.create_record(row, ModelClass) resolves all public fields from a raw row, reports field-resolution failures together, and creates the model instance. Record classes receive mapped field values and do not depend on SchemaProfile.

Tests

Run unit tests without a database:

uv run pytest tests/unit

Integration tests are opt-in and never read a CLI default database path. Point MONEYWIZ_TEST_DB_PATH at a disposable MoneyWiz SQLite test database:

MONEYWIZ_TEST_DB_PATH=/absolute/path/to/test.sqlite uv run pytest tests

Contribution

This project is in very early stage, all contributions are welcomed!

Metadata

Release files for moneywiz-api 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moneywiz-api 1.4.0
File Size Uploaded Provenance Actions
moneywiz_api-1.4.0.tar.gz 22.4 kB With provenance Details for moneywiz_api-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for moneywiz-api 1.4.0
File Interpreter ABI Platform Actions
moneywiz_api-1.4.0-py3-none-any.whl Python 3 none any Details for moneywiz_api-1.4.0-py3-none-any.whl

Total release size: 51.1 kB

Release files / moneywiz_api-1.4.0.tar.gz

Download URL moneywiz_api-1.4.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
38d5bb8b171acc321550bae0f67255f327b29161a5091b68013dcd3e8374d54d
BLAKE2b-256 checksum
How to use checksums
a59735bfb6a972ac232bfc87539aa4db0503fbf2e8702e1ff0b7139a1c95975a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / moneywiz_api-1.4.0-py3-none-any.whl

Download URL moneywiz_api-1.4.0-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d70bc65985a8bfe7c085d8b31937b3e1c429abdc4fee251da197979dd6b8522
BLAKE2b-256 checksum
How to use checksums
bb51ec803ee7514c28b5456a72484ed546107294c2fc360c549a458ab5747ad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for moneywiz-api 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for moneywiz_api-1.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page