python-trading212


Namepython-trading212 JSON
Version 2.0.3 PyPI version JSON
download
home_pagehttps://github.com/jcoelho93/python-trading212
SummaryAn unofficial client for the official Trading212 API
upload_time2024-05-05 21:03:54
maintainerNone
docs_urlNone
authorJosé Coelho
requires_python<4.0,>=3.12
licenseMIT
keywords python trading212 api client unofficial finance stocks trading
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python-trading212

![CICD Status](https://img.shields.io/github/actions/workflow/status/jcoelho93/python-trading212/ci.yml?label=cicd)
![PyPI - Downloads](https://img.shields.io/pypi/dm/python-trading212?logo=pypi&link=https%3A%2F%2Fpypi.org%2Fproject%2Fpython-trading212%2F)
![GitHub License](https://img.shields.io/github/license/jcoelho93/python-trading212)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/python-trading212)
![PyPI - Version](https://img.shields.io/pypi/v/python-trading212?logo=pypi&link=https%3A%2F%2Fpypi.org%2Fproject%2Fpython-trading212%2F)


A client for the [Trading212 API](https://t212public-api-docs.redoc.ly/)

## Installation

```bash
pip install python-trading212
```

## Usage

Set your API key in the environment variable:
```bash
export TRADING_212_KEY=<your-api-key>
```

```python
from trading212 import Trading212, Pie

trading212 = Trading212()
pie: Pie = trading212.fetch_pie(123)
positions: List[Position] = trading212.fetch_all_open_positions()

trading212.create_pie(
    Pie(
        name='My Pie',
        ...
    )
)

```

## Supported Endpoints

### Instruments Metadata

- [x] Exchange List
- [x] Instrument List

## Pies

- [x] Fetch all pies
- [x] Create Pie
- [x] Delete Pie
- [x] Fetch a Pie
- [x] Update pie

## Equity Orders

- [x] Fetch all
- [x] Place Limit order
- [x] Place Market order
- [x] Place Stop order
- [x] Place StopLimit order
- [x] Cancel by ID
- [x] Fetch by ID

## Account Data

- [x] Fetch account cash
- [x] Fetch account metadata

## Personal Portfolio

- [x] Fetch all open positions
- [x] Fetch a specific position

## Historical Items

- [x] Historical order data
- [x] Paid out dividens
- [x] Exports List
- [x] Export csv
- [x] Transaction list

## Disclaimer

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.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jcoelho93/python-trading212",
    "name": "python-trading212",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "python, trading212, api, client, unofficial, finance, stocks, trading",
    "author": "Jos\u00e9 Coelho",
    "author_email": "16445494+jcoelho93@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/b6/9b/6651c16839f7e980b127b664d694fdea29b50f269764031ce723be13aa77/python_trading212-2.0.3.tar.gz",
    "platform": null,
    "description": "# python-trading212\n\n![CICD Status](https://img.shields.io/github/actions/workflow/status/jcoelho93/python-trading212/ci.yml?label=cicd)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/python-trading212?logo=pypi&link=https%3A%2F%2Fpypi.org%2Fproject%2Fpython-trading212%2F)\n![GitHub License](https://img.shields.io/github/license/jcoelho93/python-trading212)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/python-trading212)\n![PyPI - Version](https://img.shields.io/pypi/v/python-trading212?logo=pypi&link=https%3A%2F%2Fpypi.org%2Fproject%2Fpython-trading212%2F)\n\n\nA client for the [Trading212 API](https://t212public-api-docs.redoc.ly/)\n\n## Installation\n\n```bash\npip install python-trading212\n```\n\n## Usage\n\nSet your API key in the environment variable:\n```bash\nexport TRADING_212_KEY=<your-api-key>\n```\n\n```python\nfrom trading212 import Trading212, Pie\n\ntrading212 = Trading212()\npie: Pie = trading212.fetch_pie(123)\npositions: List[Position] = trading212.fetch_all_open_positions()\n\ntrading212.create_pie(\n    Pie(\n        name='My Pie',\n        ...\n    )\n)\n\n```\n\n## Supported Endpoints\n\n### Instruments Metadata\n\n- [x] Exchange List\n- [x] Instrument List\n\n## Pies\n\n- [x] Fetch all pies\n- [x] Create Pie\n- [x] Delete Pie\n- [x] Fetch a Pie\n- [x] Update pie\n\n## Equity Orders\n\n- [x] Fetch all\n- [x] Place Limit order\n- [x] Place Market order\n- [x] Place Stop order\n- [x] Place StopLimit order\n- [x] Cancel by ID\n- [x] Fetch by ID\n\n## Account Data\n\n- [x] Fetch account cash\n- [x] Fetch account metadata\n\n## Personal Portfolio\n\n- [x] Fetch all open positions\n- [x] Fetch a specific position\n\n## Historical Items\n\n- [x] Historical order data\n- [x] Paid out dividens\n- [x] Exports List\n- [x] Export csv\n- [x] Transaction list\n\n## Disclaimer\n\nTHE SOFTWARE IS PROVIDED \u201cAS IS\u201d, 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.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An unofficial client for the official Trading212 API",
    "version": "2.0.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/jcoelho93/python-trading212/issues",
        "Documentation": "https://github.com/jcoelho93/python-trading212",
        "Homepage": "https://github.com/jcoelho93/python-trading212",
        "Repository": "https://github.com/jcoelho93/python-trading212"
    },
    "split_keywords": [
        "python",
        " trading212",
        " api",
        " client",
        " unofficial",
        " finance",
        " stocks",
        " trading"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9015f619cbe5db4ab6740628fe264996e2883d751f7a4c67b1f69c0257ad196",
                "md5": "8ec81ae849d98a762b7b5f9e094a0666",
                "sha256": "52b191bbe97472f7888166aa3824e1eabe5b17ef334c2bafe9253f68c9b65f13"
            },
            "downloads": -1,
            "filename": "python_trading212-2.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ec81ae849d98a762b7b5f9e094a0666",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 7501,
            "upload_time": "2024-05-05T21:03:52",
            "upload_time_iso_8601": "2024-05-05T21:03:52.701053Z",
            "url": "https://files.pythonhosted.org/packages/b9/01/5f619cbe5db4ab6740628fe264996e2883d751f7a4c67b1f69c0257ad196/python_trading212-2.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b69b6651c16839f7e980b127b664d694fdea29b50f269764031ce723be13aa77",
                "md5": "76e0ad35eda45023d78e6accc275e7e1",
                "sha256": "72d2bd70282f2bbd5641c5bcde20e1fc15c5e3d98b0b18836500bfb040ec7024"
            },
            "downloads": -1,
            "filename": "python_trading212-2.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "76e0ad35eda45023d78e6accc275e7e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 6249,
            "upload_time": "2024-05-05T21:03:54",
            "upload_time_iso_8601": "2024-05-05T21:03:54.207594Z",
            "url": "https://files.pythonhosted.org/packages/b6/9b/6651c16839f7e980b127b664d694fdea29b50f269764031ce723be13aa77/python_trading212-2.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-05 21:03:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jcoelho93",
    "github_project": "python-trading212",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "python-trading212"
}
        
Elapsed time: 0.27910s