Skip to main content

A lightweight Python wrapper for the IG Markets API

Project description

Latest Version Supported Python versions Wheel format License Development Status Downloads monthly Documentation Status Test Coverage https://img.shields.io/badge/code%20style-black-000000.svg

trading-ig

A lightweight Python wrapper for the IG Markets API. Simplifies access to the IG REST and Streaming APIs.

What is it?

IG Markets provides financial spread betting and CFD platforms for trading equities, forex, commodities, indices, cryptocurrencies, bonds, rates, options and more.

IG provide APIs so that developers can access their platforms programmatically. Using the APIs you can get live and historical data, automate your trades, or create apps. For details about the IG APIs please see their site:

https://labs.ig.com/

NOTE: this is not an IG project. Use it at your own risk

Dependencies

A number of dependencies in this project are marked as ‘optional’, this is by design. There is a brief explanation in this FAQ item.

For full details, see pyproject.toml

Installation

Installing with pip:

$ pip install trading-ig

Installing with all optional dependencies:

$ pip install "trading-ig[pandas, munch, tenacity]"

What if I need help?

This library is maintained by one busy developer in his spare time, with very little time for support.

If you have a problem using this library, the first thing to do is to try to isolate where the problem is. The IG platform is a complex application, and there are many ways to make mistakes using it. Just because you see an error, it does not necessarily mean there is a problem with this library. If you encounter an issue, you should follow these steps, in order:

1 - Check if there a problem with the IG platform. From time to time the IG platform itself has issues, especially the DEMO environment. If you see a message like ConnectionRefusedError, or a 500 Server error, then it could be an issue with the IG platform. IG provide a status page, though its accuracy is questionable. You can also check the IG Community forums. If there are platform issues, its likely someone will have already posted a message there.

2 - Check if there is a problem with your code. Most of the API endpoints have multiple options, multiple versions, multiple ways of accessing them, and multiple interdependent parameters. Incoming data is validated on the server, and problems will be reported back in the response. You should

  • check the documentation (REST, Streaming) to make sure you are calling the APIs correctly

  • look at the sample code and unit and integration tests. There are example snippets for most API endpoints.

  • repeat the API call using the IG companion tools (REST, Streaming). If you get the same result, then it is likely that you are using the API incorrectly.

In this case you should:

3 - If you’re sure that the problem is with this library, please:

  • provide everything necessary to reproduce the problem

  • include the full script that produces the error, including import statements

  • ideally this should be a minimal example - the shortest possible script that reproduces the problem

  • dependencies and their versions

  • the full output trace including the error messages

An issue without all this information may be ignored and/or closed without response

Docs

https://trading-ig.readthedocs.io/

License

BSD (See LICENSE)

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_ig-0.0.24.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

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

trading_ig-0.0.24-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file trading_ig-0.0.24.tar.gz.

File metadata

  • Download URL: trading_ig-0.0.24.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for trading_ig-0.0.24.tar.gz
Algorithm Hash digest
SHA256 f13d251fe78922394d12fde8a31be5dced41a9ea0cda6cfc569c8af91c0d9ce6
MD5 3fa4c01efc1479616dee1f1864a53dd2
BLAKE2b-256 137ade8b332100271299f97067d6a5f379e17bcece4f9dcd631572b79e3cef42

See more details on using hashes here.

File details

Details for the file trading_ig-0.0.24-py3-none-any.whl.

File metadata

  • Download URL: trading_ig-0.0.24-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for trading_ig-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 f8d2389c6dcf8667f7d893e226b621190b80c23dab45bbb032f809a54033ca62
MD5 6d84ca9eb72bcb6f6c375efcc8920744
BLAKE2b-256 98b7de1efd9fc0624da91e229961322d3642a4b55d51c3d4db74be3dac52e3d6

See more details on using hashes here.

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