Provides access to real-time and historical financial data from various exchanges
Project description
enext-exchange-py
Provides access to real-time and historical financial data from various exchanges.
Features
- Detailed Quotes: Get real-time price, change percentages, and last traded time.
- Intraday Quotes: Fetch intraday price and volume data.
- Historical Quotes: Access historical price and volume data.
- Factsheets: Retrieve instrument information such as ISIN, code, instrument type, and trading details.
- Asynchronous: Built on
httpx
Installation
Install the package using pip:
pip install enext-exchange-py
Quick Start
The library uses asyncio for its operations. Below is a simple example of how to use the ExchangeClient.
import asyncio
from enext_exchange_py import ExchangeClient
async def main():
async with ExchangeClient() as client:
# 1. Get a detailed quote for a symbol (e.g., Lyxor MSCI World ETF)
symbol = "LU0290358497-ETFP"
quote = await client.get_detailed_quote(symbol)
print(f"Name: {quote.name}")
print(f"Last Price: {quote.last_traded_price.value} {quote.last_traded_price.currency}")
print(f"Change: {quote.since_previous_close_percentage}%")
# 2. Get intraday quotes
print("\nIntraday Quotes (first 5):")
async for q in client.get_intraday_quotes(symbol):
print(f"{q.time}: {q.price} (Vol: {q.volume})")
# Limit for demonstration
break
# 3. Get a factsheet
factsheet = await client.get_factsheet(symbol)
print(f"\nISIN: {factsheet.isin}")
print(f"Instrument Type: {factsheet.instrument_type}")
print(f"Trading Currency: {factsheet.trading_currency}")
if __name__ == "__main__":
asyncio.run(main())
Usage
API Methods
await get_detailed_quote(symbol: str) -> DetailedQuote: Returns aDetailedQuoteobject containing the latest market data.get_intraday_quotes(symbol: str) -> AsyncGenerator[Quote, None]: An async generator yieldingQuoteobjects for the current trading day.get_historical_quotes(symbol: str) -> AsyncGenerator[Quote, None]: An async generator yielding historicalQuoteobjects.await get_factsheet(symbol: str) -> Factsheet: Returns aFactsheetobject with instrument metadata.
Development
To set up the development environment, you can use uv:
# Install dependencies
uv sync --all-extras --group dev
# Run tests
uv run pytest
License
This project is licensed under the terms of the license included in the repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enext_exchange_py-0.1.2.tar.gz.
File metadata
- Download URL: enext_exchange_py-0.1.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d07b1a410f161727a53f8f59222855131bd84e0e85f63258c0343cc856d7aed0
|
|
| MD5 |
373e58cbe2f784b25faf2f9aee82b8d5
|
|
| BLAKE2b-256 |
34e135c1e3e32e7aaa4ddc1852c5d15278d24afee2d1114d9c65df80f9c9bb77
|
Provenance
The following attestation bundles were made for enext_exchange_py-0.1.2.tar.gz:
Publisher:
publish.yml on jotonedev/enext-exchange-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
enext_exchange_py-0.1.2.tar.gz -
Subject digest:
d07b1a410f161727a53f8f59222855131bd84e0e85f63258c0343cc856d7aed0 - Sigstore transparency entry: 985041286
- Sigstore integration time:
-
Permalink:
jotonedev/enext-exchange-py@e2f782bd10d0cb8c3db02a6d7809ae959af82822 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jotonedev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2f782bd10d0cb8c3db02a6d7809ae959af82822 -
Trigger Event:
push
-
Statement type:
File details
Details for the file enext_exchange_py-0.1.2-py3-none-any.whl.
File metadata
- Download URL: enext_exchange_py-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
303be21841f53d5d995585e4cc4d2c6b92660ba76e2f1a6a7e5f74874911c209
|
|
| MD5 |
ec4f6fe170445fc2e6d14907f6e0b4ab
|
|
| BLAKE2b-256 |
92c6f1fa711dc2d2d30dfeacf731c5b91bbf690bb5de5163153e16df7de3b1f2
|
Provenance
The following attestation bundles were made for enext_exchange_py-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on jotonedev/enext-exchange-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
enext_exchange_py-0.1.2-py3-none-any.whl -
Subject digest:
303be21841f53d5d995585e4cc4d2c6b92660ba76e2f1a6a7e5f74874911c209 - Sigstore transparency entry: 985041291
- Sigstore integration time:
-
Permalink:
jotonedev/enext-exchange-py@e2f782bd10d0cb8c3db02a6d7809ae959af82822 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jotonedev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2f782bd10d0cb8c3db02a6d7809ae959af82822 -
Trigger Event:
push
-
Statement type: