Skip to main content

Monarch Money API for Python

Project description

Monarch Money

Python library for accessing Monarch Money data.

Installation

From Source Code

Clone this repository from Git

git clone https://github.com/hammem/monarchmoney.git

Via pip

pip install monarchmoney

Instantiate & Login

There are two ways to use this library: interactive and non-interactive.

Interactive

If you're using this library in something like iPython or Jupyter, you can run an interactive-login which supports multi-factor authentication:

mm = MonarchMoney()
await mm.interactive_login()

This will prompt you for the email, password and, if needed, the multi-factor token.

Non-interactive

For a non-interactive session, you'll need to create an instance and login:

mm = MonarchMoney()
mm.login(email, password)

This may throw a RequireMFAException. If it does, you'll need to get a multi-factor token and call the following method:

mm.multi_factor_authenticate(email, password, multi_factor_code)

Alternatively, you can provide the MFA Secret Key. The MFA Secret Key is found when setting up the MFA in Monarch Money by going to Settings -> Security -> Enable MFA -> and copy the "Two-factor text code". Then provide it in the login() method:

await mm.login(
        email=email,
        password=password,
        save_session=False,
        use_saved_session=False,
        mfa_secret_key=mfa_secret_key,
    )

Accessing Data

As of writing this README, the following methods are supported:

  • get_accounts - all the accounts linked to Monarch Money
  • get_account_holdings - all of the securities in a brokerage or similar type of account
  • get_subscription_details - the Monarch Money account's status (e.g. paid or trial)
  • get_transactions - transaction data, defaults to returning the last 100 transactions; can also be searched by date range
  • get_transaction_categories all of the categories configured in the account
  • get_transaction_tags - all of the tags configured in the account
  • get_cashflow - cashflow data (by category, category group, merchant and a summary)
  • get_cashflow_summary - cashflow summary (income, expense, savings, savings rate)

Contributing

Any and all contributions -- code, documentation, feature requests, feedback -- are welcome!

If you plan to submit up a pull request, you can expect a timely review. There aren't any strict requirements around the environment you need to configure aside from using Black to auto-format the code. An action is configured in this repo to run against all PRs and merges and will block them from being committed.

FAQ

How do I use this API if I login to Monarch via Google?

If you currently use Google or 'Continue with Google' to access your Monarch account, you'll need to set a password to leverage this API. You can set a password on your Monarch account by going to your security settings.

Don't forget to use a password unique to your Monarch account and to enable multi-factor authentication!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monarchmoney-0.1.6.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monarchmoney-0.1.6-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file monarchmoney-0.1.6.tar.gz.

File metadata

  • Download URL: monarchmoney-0.1.6.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for monarchmoney-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c3403c89993b03e4d1623566223e143db4cf97eb4e80c1ac5a2b95945a4bd296
MD5 0bd7fcac21c391ef75c1de304f1c79ff
BLAKE2b-256 ca634f40d732c32aa248c6814a1d06f46dd6dfaea21a41681077223d229e80a9

See more details on using hashes here.

File details

Details for the file monarchmoney-0.1.6-py2.py3-none-any.whl.

File metadata

  • Download URL: monarchmoney-0.1.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for monarchmoney-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d54b0d48de9bf912336762cba6b7b81ac9b422b411c77a81b5c0e85529e9bfcc
MD5 1cf8a749774afe41573b56b96a5e6239
BLAKE2b-256 e07d7a7e43f80eb87d38bae36f5728a190b2b0b5a76c6e3ee93e1cd41e10a2bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page