Skip to main content

chen-signatures

Fast rough path signatures for Python, powered by a high-performance Julia backend.

PyPI Python

chen-signatures brings the speed and numerical stability of Julia’s ChenSignatures.jl to Python via juliacall, offering a modern, actively maintained alternative to existing signature libraries.

It has been benchmarked against both iisignature and pysiglib, showing:

  • Comparable performance to pysiglib, a modern C++/Python implementation
  • Consistently faster performance than iisignature across typical configurations

Full benchmark notebooks and articles will be published separately.


Installation

pip install chen-signatures

On first import, juliacall will automatically install a lightweight Julia runtime. This happens once per environment.


Quick Start

import chen
import numpy as np

path = np.random.randn(1000, 10)

# Compute signature
signature = chen.sig(path, m=5)

# Compute log-signature (requires prepare step)
basis = chen.prepare_logsig(d=10, m=5)  # d must match path dimension
logsignature = chen.logsig(path, basis)

# Path augmentations (time/lead–lag) with convenience wrappers
augmented = chen.time_augment(path, Tspan=1.0)
leadlag = chen.lead_lag(path)
sig_time = chen.sig_time(path, m=5)
sig_leadlag = chen.sig_leadlag(path, m=5)

API

sig(path, m)

Compute a truncated signature up to level m.

signature = chen.sig(path, m=3)

Args:

  • path: (N, d) array-like where N is path length, d is dimension
  • m: truncation level (positive integer)

Returns: 1D numpy array of signature coefficients


prepare_logsig(d, m)

Precompute and cache the Lyndon basis for log-signature computation.

basis = chen.prepare_logsig(d=10, m=5)

Args:

  • d: path dimension (positive integer)
  • m: truncation level (positive integer)

Returns: Basis cache object (reusable across multiple paths)


logsig(path, basis)

Compute log-signatures using a precomputed Lyndon basis.

basis = chen.prepare_logsig(d=10, m=5)
logsig = chen.logsig(path, basis)

Args:

  • path: (N, d) array-like where N is path length, d is dimension
  • basis: Basis object from prepare_logsig(d, m)

Returns: 1D numpy array of log-signature coefficients (Lyndon basis projection)

Note: The basis object should match the dimension of your path. Prepare it once and reuse for multiple paths of the same dimension.

Path Augmentations

augmented = chen.time_augment(path, Tspan=1.0)   # add time as first coordinate
leadlag = chen.lead_lag(path)                    # standard lead–lag transform

sig_time = chen.sig_time(path, m=3)              # = chen.sig(time_augment(path), 3)
sig_leadlag = chen.sig_leadlag(path, m=3)        # = chen.sig(lead_lag(path), 3)

Supported Types

  • float32, float64
  • Any NumPy array-like input
  • Contiguous arrays recommended (handled automatically)

Use Cases

  • Financial time series and derivatives pricing
  • Neural CDEs and machine learning
  • Feature engineering and representation learning

Limitations

  • First import is slow (Julia installation)
  • CPU-only execution
  • Uses more memory than minimal C++ libraries

Requirements

  • Python ≥ 3.9
  • NumPy ≥ 1.20
  • ~500MB disk space for Julia runtime

Citation

@software{chen_signatures,
  author = {Combi, Alessandro},
  title = {chen-signatures: Fast rough path signatures for Python},
  year = {2025},
  url = {https://github.com/aleCombi/ChenSignatures.jl}
}

Contributing

Issues and feedback are welcome at https://github.com/aleCombi/ChenSignatures.jl/issues

However, pull requests are not being accepted at this time.

Metadata

Release files for chen-signatures 0.6.1

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

Source distribution (sdist)

Source distribution for chen-signatures 0.6.1
File Size Uploaded Provenance Actions
chen_signatures-0.6.1.tar.gz 14.3 kB Without provenance Details for chen_signatures-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chen-signatures 0.6.1
File Interpreter ABI Platform Actions
chen_signatures-0.6.1-py3-none-any.whl Python 3 none any Details for chen_signatures-0.6.1-py3-none-any.whl

Total release size: 23.4 kB

Release files / chen_signatures-0.6.1.tar.gz

Download URL chen_signatures-0.6.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
adae1ce3c2d982970932de978b6695d616985e900ecc43935ef3774620f29c11
BLAKE2b-256 checksum
How to use checksums
46f2a67f6afbde6af95445db3e11bf0147b1412ceef62699d3442def7b1a7876
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / chen_signatures-0.6.1-py3-none-any.whl

Download URL chen_signatures-0.6.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
622eeb14745fbea62f6b243824ca908af0942ed19fe2af841c912f782a07e271
BLAKE2b-256 checksum
How to use checksums
d7b79a213d74fce8ccb66eb804fd0f1bde06987993dd97bb5035272607f81514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for chen-signatures 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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