Point and Figure Chart Library - Python bindings
Project description
pypnf
pypnf is the official Python binding for the PnF (Point and Figure) chart engine.
It provides:
- High-performance native chart construction (via C++ core).
- Technical indicators (SMA, Bollinger Bands, RSI, OBV, signals, patterns, support/resistance, congestion).
- A lightweight real-time localhost dashboard server (
pypnf_dashboard).
Installation
pip install pypnf-gregorian09
Quick Start
from datetime import datetime
import pypnf
cfg = pypnf.ChartConfig()
cfg.method = pypnf.ConstructionMethod.HighLow
cfg.box_size_method = pypnf.BoxSizeMethod.Traditional
cfg.reversal = 3
chart = pypnf.Chart(cfg)
chart.add_data(5000.0, 4950.0, 4985.0, datetime.utcnow())
chart.add_data(5030.0, 4995.0, 5020.0, datetime.utcnow())
ind = pypnf.Indicators()
ind.calculate(chart)
print(chart.to_ascii())
print(ind.summary())
Real-Time Dashboard
from pypnf_dashboard import DashboardServer
server = DashboardServer(chart, ind)
server.start("127.0.0.1", 8761)
server.publish()
print(server.url()) # http://127.0.0.1:8761/
Main API Surface
- Core:
Chart,ChartConfigBox,Column
- Indicators:
Indicators,IndicatorConfigMovingAverage,BollingerBands,RSI,OnBalanceVolumeSignalDetector,PatternRecognizer,SupportResistance,CongestionDetector
- Data and enums:
OHLC,Signal,Pattern,SupportResistanceLevel,PriceObjective,CongestionZoneBoxType,ColumnType,ConstructionMethod,BoxSizeMethod,SignalType,PatternType
- Utilities:
version(),version_major(),version_minor(),version_patch()
Full API reference:
docs/bindings/python.mddocs/reference/api-symbol-index.md
Data Notes
- Timestamps are Unix or datetime values depending on API overload.
- Prices are floating-point values.
- For high/low construction mode, pass real high/low candle data for best results.
Troubleshooting
- Linux: ensure native shared libraries can be found at runtime.
- If building from source, install CMake and a C++20-capable toolchain.
- Recreate environment after upgrading package major versions.
Links
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
File details
Details for the file pypnf_gregorian09-0.1.0.tar.gz.
File metadata
- Download URL: pypnf_gregorian09-0.1.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dedf92f090eb7a2065ea44b4b3694f391af86c93d66cf07dc08509d9a5a192db
|
|
| MD5 |
874fda1919a37e13fb37c7f138ac8673
|
|
| BLAKE2b-256 |
5b5ab8da1f4f11a5c0acb66f3f018999b3e057a602db72714063346559166248
|