pyetrade


Namepyetrade JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/jessecooper/pyetrade
SummaryeTrade API wrappers
upload_time2024-04-19 20:50:35
maintainerNone
docs_urlNone
authorJesse Cooper
requires_pythonNone
licenseGPLv3
keywords etrade pyetrade stocks
VCS
bugtrack_url
requirements No requirements were recorded.
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/98/06/d0ea9b62f5eb4485afef59799bececa39de9601ca4348dcd3fb43f7dd0a7/pyetrade-2.1.0.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.0",
    "project_urls": {
        "Homepage": "https://github.com/jessecooper/pyetrade"
    },
    "split_keywords": [
        "etrade",
        " pyetrade",
        " stocks"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9806d0ea9b62f5eb4485afef59799bececa39de9601ca4348dcd3fb43f7dd0a7",
                "md5": "5911cdf4e8c2d58789ce8d2c55684324",
                "sha256": "eaa926e0c09e37bce3efbe28383d03ee34ce11913267f34d66c9ee92c98e115f"
            },
            "downloads": -1,
            "filename": "pyetrade-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5911cdf4e8c2d58789ce8d2c55684324",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 34569,
            "upload_time": "2024-04-19T20:50:35",
            "upload_time_iso_8601": "2024-04-19T20:50:35.007258Z",
            "url": "https://files.pythonhosted.org/packages/98/06/d0ea9b62f5eb4485afef59799bececa39de9601ca4348dcd3fb43f7dd0a7/pyetrade-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 20:50:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jessecooper",
    "github_project": "pyetrade",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "pyetrade"
}
        
Elapsed time: 0.22923s