Skip to main content

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, ChartConfig
    • Box, Column
  • Indicators:
    • Indicators, IndicatorConfig
    • MovingAverage, BollingerBands, RSI, OnBalanceVolume
    • SignalDetector, PatternRecognizer, SupportResistance, CongestionDetector
  • Data and enums:
    • OHLC, Signal, Pattern, SupportResistanceLevel, PriceObjective, CongestionZone
    • BoxType, ColumnType, ConstructionMethod, BoxSizeMethod, SignalType, PatternType
  • Utilities:
    • version(), version_major(), version_minor(), version_patch()

Full API reference:

  • docs/bindings/python.md
  • docs/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

Metadata

Release files for pypnf-gregorian09 0.1.0

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

Source distribution (sdist)

Source distribution for pypnf-gregorian09 0.1.0
File Size Uploaded
pypnf_gregorian09-0.1.0.tar.gz 8.0 kB Details

Release files / pypnf_gregorian09-0.1.0.tar.gz

Download URL pypnf_gregorian09-0.1.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dedf92f090eb7a2065ea44b4b3694f391af86c93d66cf07dc08509d9a5a192db
BLAKE2b-256 checksum
How to use checksums
5b5ab8da1f4f11a5c0acb66f3f018999b3e057a602db72714063346559166248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

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