pyetrade


Namepyetrade JSON
Version 2.1.1 PyPI version JSON
download
home_pagehttps://github.com/jessecooper/pyetrade
SummaryeTrade API wrappers
upload_time2024-11-06 13:48:21
maintainerNone
docs_urlNone
authorJesse Cooper
requires_pythonNone
licenseGPLv3
keywords etrade pyetrade stocks
VCS
bugtrack_url
requirements certifi charset-normalizer idna jxmlease oauthlib python-dateutil requests-oauthlib requests six urllib3 xmltodict
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyetrade (Python E-Trade API Wrapper)

[![PyPI](https://img.shields.io/pypi/v/pyetrade.svg)](https://pypi.python.org/pypi/pyetrade)
[![PyPI](https://img.shields.io/pypi/l/pyetrade.svg)]()
[![PyPI](https://img.shields.io/pypi/pyversions/pyetrade.svg)](https://pypi.python.org/pypi/pyetrade)
[![Build Status](https://github.com/jessecooper/pyetrade/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jessecooper/pyetrade/actions/workflows/build.yml/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/jessecooper/pyetrade/branch/master/graph/badge.svg)](https://codecov.io/gh/jessecooper/pyetrade)

## Completed

* Authorization API (OAuth)
  * get_request_token
  * get_access_token
  * renew_access_token
  * revoke_access_token


* Alerts API
  * list_alerts
  * list_alert_details
  * delete_alert


* Accounts API
  * list_accounts
  * get_account_balance
  * get_account_portfolio
  * get_portfolio_position_lot
  * list_transactions
  * list_transaction_details


* Order API
  * list_orders
  * list_order_details
  * find_option_orders
  * preview_equity_order
  * change_preview_equity_order
  * place_equity_order
  * place_changed_equity_order
  * place_option_order
  * place_changed_option_order
  * cancel_order


* Market API
  * look_up_product
  * get_quote
  * get_option_chains
  * get_option_expire_date

## Install

```bash
pip install pyetrade
```
OR
```bash
git clone https://github.com/jessecooper/pyetrade.git
cd pyetrade
sudo make init
sudo make install
```

## Example Usage

To create the OAuth tokens:

```python
import pyetrade

consumer_key = "<CONSUMER_KEY>"
consumer_secret = "<SECRET_KEY>"

oauth = pyetrade.ETradeOAuth(consumer_key, consumer_secret)
print(oauth.get_request_token())  # Use the printed URL

verifier_code = input("Enter verification code: ")
tokens = oauth.get_access_token(verifier_code)

print(tokens)
```

And then on the example code:

```python
import pyetrade

consumer_key = "<CONSUMER_KEY>"
consumer_secret = "<SECRET_KEY>"
tokens = {'oauth_token': '<TOKEN FROM THE SCRIPT ABOVE>',
          'oauth_token_secret': '<TOKEN FROM THE SCRIPT ABOVE>'}

accounts = pyetrade.ETradeAccounts(
    consumer_key,
    consumer_secret,
    tokens['oauth_token'],
    tokens['oauth_token_secret']
)

print(accounts.list_accounts())
```

## Documentation

[PyEtrade Documentation](https://pyetrade.readthedocs.io/en/latest/)

## Contribute to pyetrade

[ETrade API Docs](https://apisb.etrade.com/docs/api/account/api-account-v1.html)

### Development Setup:

* Fork pyetrade
* Setup development environment

```bash
make init
make devel
```
OR
```bash
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install -e .
pre-commit install --hook-type pre-commit --hook-type pre-push --install-hooks -t post-checkout -t post-merge
```

* Lint (Run analysis - pre-commit-config)

```bash
make analysis
```

* Test (Coverage >= 90%)

```bash
make test
```

* Push Changes
  * Push changes to a branch on your forked repo


* Create pull request
  * Open a pull request on pyetrade and put your fork as the source of your changes

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jessecooper/pyetrade",
    "name": "pyetrade",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "etrade, pyetrade, stocks",
    "author": "Jesse Cooper",
    "author_email": "jesse_cooper@codeholics.com",
    "download_url": "https://files.pythonhosted.org/packages/ec/cc/d7e99f3c5baf4d987e08b41153b0df63661c528d8b0fd0164168fce08127/pyetrade-2.1.1.tar.gz",
    "platform": "any",
    "description": "# pyetrade (Python E-Trade API Wrapper)\r\n\r\n[![PyPI](https://img.shields.io/pypi/v/pyetrade.svg)](https://pypi.python.org/pypi/pyetrade)\r\n[![PyPI](https://img.shields.io/pypi/l/pyetrade.svg)]()\r\n[![PyPI](https://img.shields.io/pypi/pyversions/pyetrade.svg)](https://pypi.python.org/pypi/pyetrade)\r\n[![Build Status](https://github.com/jessecooper/pyetrade/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jessecooper/pyetrade/actions/workflows/build.yml/badge.svg?branch=master)\r\n[![codecov](https://codecov.io/gh/jessecooper/pyetrade/branch/master/graph/badge.svg)](https://codecov.io/gh/jessecooper/pyetrade)\r\n\r\n## Completed\r\n\r\n* Authorization API (OAuth)\r\n  * get_request_token\r\n  * get_access_token\r\n  * renew_access_token\r\n  * revoke_access_token\r\n\r\n\r\n* Alerts API\r\n  * list_alerts\r\n  * list_alert_details\r\n  * delete_alert\r\n\r\n\r\n* Accounts API\r\n  * list_accounts\r\n  * get_account_balance\r\n  * get_account_portfolio\r\n  * get_portfolio_position_lot\r\n  * list_transactions\r\n  * list_transaction_details\r\n\r\n\r\n* Order API\r\n  * list_orders\r\n  * list_order_details\r\n  * find_option_orders\r\n  * preview_equity_order\r\n  * change_preview_equity_order\r\n  * place_equity_order\r\n  * place_changed_equity_order\r\n  * place_option_order\r\n  * place_changed_option_order\r\n  * cancel_order\r\n\r\n\r\n* Market API\r\n  * look_up_product\r\n  * get_quote\r\n  * get_option_chains\r\n  * get_option_expire_date\r\n\r\n## Install\r\n\r\n```bash\r\npip install pyetrade\r\n```\r\nOR\r\n```bash\r\ngit clone https://github.com/jessecooper/pyetrade.git\r\ncd pyetrade\r\nsudo make init\r\nsudo make install\r\n```\r\n\r\n## Example Usage\r\n\r\nTo create the OAuth tokens:\r\n\r\n```python\r\nimport pyetrade\r\n\r\nconsumer_key = \"<CONSUMER_KEY>\"\r\nconsumer_secret = \"<SECRET_KEY>\"\r\n\r\noauth = pyetrade.ETradeOAuth(consumer_key, consumer_secret)\r\nprint(oauth.get_request_token())  # Use the printed URL\r\n\r\nverifier_code = input(\"Enter verification code: \")\r\ntokens = oauth.get_access_token(verifier_code)\r\n\r\nprint(tokens)\r\n```\r\n\r\nAnd then on the example code:\r\n\r\n```python\r\nimport pyetrade\r\n\r\nconsumer_key = \"<CONSUMER_KEY>\"\r\nconsumer_secret = \"<SECRET_KEY>\"\r\ntokens = {'oauth_token': '<TOKEN FROM THE SCRIPT ABOVE>',\r\n          'oauth_token_secret': '<TOKEN FROM THE SCRIPT ABOVE>'}\r\n\r\naccounts = pyetrade.ETradeAccounts(\r\n    consumer_key,\r\n    consumer_secret,\r\n    tokens['oauth_token'],\r\n    tokens['oauth_token_secret']\r\n)\r\n\r\nprint(accounts.list_accounts())\r\n```\r\n\r\n## Documentation\r\n\r\n[PyEtrade Documentation](https://pyetrade.readthedocs.io/en/latest/)\r\n\r\n## Contribute to pyetrade\r\n\r\n[ETrade API Docs](https://apisb.etrade.com/docs/api/account/api-account-v1.html)\r\n\r\n### Development Setup:\r\n\r\n* Fork pyetrade\r\n* Setup development environment\r\n\r\n```bash\r\nmake init\r\nmake devel\r\n```\r\nOR\r\n```bash\r\npip install -r requirements.txt\r\npip install -r requirements_dev.txt\r\npip install -e .\r\npre-commit install --hook-type pre-commit --hook-type pre-push --install-hooks -t post-checkout -t post-merge\r\n```\r\n\r\n* Lint (Run analysis - pre-commit-config)\r\n\r\n```bash\r\nmake analysis\r\n```\r\n\r\n* Test (Coverage >= 90%)\r\n\r\n```bash\r\nmake test\r\n```\r\n\r\n* Push Changes\r\n  * Push changes to a branch on your forked repo\r\n\r\n\r\n* Create pull request\r\n  * Open a pull request on pyetrade and put your fork as the source of your changes\r\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "eTrade API wrappers",
    "version": "2.1.1",
    "project_urls": {
        "Homepage": "https://github.com/jessecooper/pyetrade"
    },
    "split_keywords": [
        "etrade",
        " pyetrade",
        " stocks"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ecccd7e99f3c5baf4d987e08b41153b0df63661c528d8b0fd0164168fce08127",
                "md5": "5acc995f488d56d6525f5bd082f1c777",
                "sha256": "b231e92c0e1909facc1545e286bb735066bd06c3829384e7da636e42ac8d5959"
            },
            "downloads": -1,
            "filename": "pyetrade-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5acc995f488d56d6525f5bd082f1c777",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 34578,
            "upload_time": "2024-11-06T13:48:21",
            "upload_time_iso_8601": "2024-11-06T13:48:21.535349Z",
            "url": "https://files.pythonhosted.org/packages/ec/cc/d7e99f3c5baf4d987e08b41153b0df63661c528d8b0fd0164168fce08127/pyetrade-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-06 13:48:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jessecooper",
    "github_project": "pyetrade",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.8.30"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "jxmlease",
            "specs": [
                [
                    "==",
                    "1.0.3"
                ]
            ]
        },
        {
            "name": "oauthlib",
            "specs": [
                [
                    "==",
                    "3.2.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "requests-oauthlib",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.19"
                ]
            ]
        },
        {
            "name": "xmltodict",
            "specs": [
                [
                    "==",
                    "0.13.0"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "pyetrade"
}
        
Elapsed time: 0.48076s