Skip to main content

python-trading212

CICD Status PyPI - Downloads GitHub License PyPI - Python Version PyPI - Version

A client for the Trading212 API

Installation

pip install python-trading212

Usage

Set your API key in the environment variable:

export TRADING212_KEY=<your-api-key>
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

  • Exchange List
  • Instrument List

Pies

  • Fetch all pies
  • Create Pie
  • Delete Pie
  • Fetch a Pie
  • Update pie

Equity Orders

  • Fetch all
  • Place Limit order
  • Place Market order
  • Place Stop order
  • Place StopLimit order
  • Cancel by ID
  • Fetch by ID

Account Data

  • Fetch account cash
  • Fetch account metadata

Personal Portfolio

  • Fetch all open positions
  • Fetch a specific position

Historical Items

  • Historical order data
  • Paid out dividens
  • Exports List
  • Export csv
  • 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.

Metadata

Release files for python-trading212 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-trading212 2.0.4
File Size Uploaded
python_trading212-2.0.4.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-trading212 2.0.4
File Interpreter ABI Platform
python_trading212-2.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / python_trading212-2.0.4.tar.gz

Download URL python_trading212-2.0.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0a670ecf58161600f403e9c6f5017a2d118faf759de3b0947456b9090e37bcbe
BLAKE2b-256 checksum
How to use checksums
d9ecd32bc26991e4c87c414dd0ec24c730707db86a94be6cb61969fc2994dd91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2024.

Transparency log

Release files / python_trading212-2.0.4-py3-none-any.whl

Download URL python_trading212-2.0.4-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2477674104e5434bb9b53863a6dc3e61dca2f6680d811338f2c265bd98ab82cc
BLAKE2b-256 checksum
How to use checksums
a4b7bb16d5e27871df740f91255c1803b9a662ebba4d551b45731bc4c1019d3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.4 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page