Skip to main content

No project description provided

Project description

python-trading-212 (WIP)

This project defines two clients for the Trading 212 api.

Setup

Set the two environment variables:

export T212_API_KEY=123_YOUR_API_KEY
export T212_ENVIRONMENT="live" or "demo"

AsyncTrading212Client

This uses aiohttp to make requests asyncronously.

Usage:

from t212.async_client import AsyncTrading212Client

# To run from synchronous code
import asyncio
asyncio.run(AsyncTrading212Client.fetch_account_cash())

...

# To run from async, simply call
await AsyncTrading212Client.exchange_list()

...

# you can get the response as a python dict by running 
response = await AsyncTrading212Client.exchange_list()
response.model_dump(mode="json")

...

# remember to close the client when you're done
AsyncTrading212Client.close_client()

Roadmap

[x] All get endpoint implemented for async class - done 02/09/2025

[ ] All post endpoints implemented for async class - target 10/09/2025

[ ] All get endpoint implemented for sync class - target 20/09/2025

[ ] All post endpoints implemented for sync class - target 30/09/2025

[ ] Deploy on pypi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trading_212_client-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trading_212_client-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file trading_212_client-0.1.0.tar.gz.

File metadata

  • Download URL: trading_212_client-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for trading_212_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc69251c2d4b40ab70d0ba6c4008f0b40a66b69d1677ce4a722590c4c04daef3
MD5 658a37369f7c2eef2ec8f354d67d6f54
BLAKE2b-256 7b82e1e1bda266ae457aa4edfeb9b87022e6033f22619f29e61e5a44845c6ade

See more details on using hashes here.

Provenance

The following attestation bundles were made for trading_212_client-0.1.0.tar.gz:

Publisher: python-publish.yml on Lancasterg/python-trading-212

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trading_212_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trading_212_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11c8b9441c82a6a195d99f89144f0abd241d4c0cf070d08c5a97e510ead37130
MD5 c7cc73e8119a6693b17df19fab6be6ba
BLAKE2b-256 dd5018ceb18b2ba4ab6afc88c933d8f18debcda6f7fdd782e02240de9841bdd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for trading_212_client-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on Lancasterg/python-trading-212

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page