Skip to content

Commit

Permalink
pypi-ize everything, now you can just pip install mintapi (see README…
Browse files Browse the repository at this point in the history
…/CHANGELOG for minor tweaks in usage)
  • Loading branch information
mrooney committed Apr 28, 2014
1 parent 4252f9f commit 42e4a9a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
dist
*.pyc
*.egg-info
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1.2
---
- turn into a pypi package. now use `import mintapi` from python or the `mintapi` binary.

1.1
---
- fix login/authentication issue after Mint.com change

1.0
---
- initial release
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2013 Michael Rooney

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Requirements
===
Ensure you have Python 2 or 3 and pip (`easy_install pip`) and then:

pip install requests
pip install mintapi

Usage
===
Expand All @@ -17,14 +17,14 @@ from Python
From python, simply call `get_accounts`. We recommend using the
`keyring` library for persisting credentials.

from mint import api
accounts = api.get_accounts(email, password)
import mintapi
accounts = mintapi.get_accounts(email, password)

from anywhere
---
Run it as a sub-process from your favorite language. From the command-line, the output is JSON:

>>> python mint/api.py email password
>>> mintapi email password
[
{
"accountName": "Chase Checking",
Expand Down
19 changes: 19 additions & 0 deletions bin/mintapi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python
import getpass
import json
import sys

import mintapi

# Handle Python 3's raw_input change.
try: input = raw_input
except NameError: pass

if len(sys.argv) >= 3:
email, password = sys.argv[1:]
else:
email = input("Mint email: ")
password = getpass.getpass("Password: ")

accounts = mintapi.get_accounts(email, password)
print(json.dumps(accounts, indent=2))
1 change: 1 addition & 0 deletions mintapi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from api import get_accounts
16 changes: 0 additions & 16 deletions mint/api.py → mintapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,3 @@ def get_accounts(email, password):
response = json.loads(response)
accounts = response["response"][request_id]["response"]
return accounts

if __name__ == "__main__":
import getpass, sys

# Handle Python 3's raw_input change.
try: input = raw_input
except NameError: pass

if len(sys.argv) >= 3:
email, password = sys.argv[1:]
else:
email = input("Mint email: ")
password = getpass.getpass("Password: ")

accounts = get_accounts(email, password)
print(json.dumps(accounts, indent=2))
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# new version to pypi => python setup.py sdist upload
from setuptools import setup

setup(
name='mintapi',
description='a screen-scraping API for Mint.com',
version='1.2',
packages=['mintapi'],
scripts=['bin/mintapi'],
license='The MIT License',
author='Michael Rooney',
author_email='mrooney.mintapi@rowk.com',
url='https://github.com/mrooney/mintapi',
install_requires=['requests'],
)

0 comments on commit 42e4a9a

Please sign in to comment.