Skip to main content

stockcheck-valuation

Small, dependency-free tools for answering one question:

"Is this valuation metric (PE, PB, PS, dividend yield, ...) currently cheap or expensive relative to its own history?"

This is the same historical-percentile calculation behind most valuation screeners and "cheap vs. its own history" dashboards, extracted into a tiny standalone utility so you don't have to re-derive it every time you want a quick answer.

Built by the team behind StockCheck, a valuation and quant-factor screener for stocks across the A-share, HK, and US markets.

Install

pip install stockcheck-valuation

Usage

As a library

from stockcheck_valuation import historical_percentile, rolling_percentile

# Where does a PE of 15 sit versus 5 years of trailing daily PE values?
pct = historical_percentile(current=15, history=historical_pe_values)
print(f"Current PE percentile: {pct:.1f}")

# Build a full time series of rolling percentiles for charting.
percentile_series = rolling_percentile(historical_pe_values, window=252 * 3)

From the command line

stockcheck-valuation 15 --history "12,13,14,15,16,20,22,9,10"
# Current value 15.0 is at the 66.7th percentile of 9 historical observations.

stockcheck-valuation 15 --history-file pe_history.csv

Why percentile instead of raw ratio?

A PE of 15 means very different things for a utility company and a growth tech stock. Comparing today's ratio to the same company's own trading history (or to its industry / market peers) gives a much more useful signal than comparing raw ratios across unrelated businesses.

License

MIT

Metadata

Release files for stockcheck-valuation 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 stockcheck-valuation 0.1.0
File Size Uploaded Provenance Actions
stockcheck_valuation-0.1.0.tar.gz 4.8 kB Without provenance Details for stockcheck_valuation-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stockcheck-valuation 0.1.0
File Interpreter ABI Platform Actions
stockcheck_valuation-0.1.0-py3-none-any.whl Python 3 none any Details for stockcheck_valuation-0.1.0-py3-none-any.whl

Total release size: 10.6 kB

Release files / stockcheck_valuation-0.1.0.tar.gz

Download URL stockcheck_valuation-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
560d32252b47a7602b1acd023e5369bd5353452c5300561b255f872706f3936e
BLAKE2b-256 checksum
How to use checksums
230811d2b14b546fd8fd405618c23b1e824c21510ea0736c6266b3083fc6c5ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.4

Release files / stockcheck_valuation-0.1.0-py3-none-any.whl

Download URL stockcheck_valuation-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6520ff42b996b99bc03d8af3831bd0d94768d48694e5ebd1cf75531866050c92
BLAKE2b-256 checksum
How to use checksums
7e84030de0227f7ccbb0ccdc5dc51769614f3c4a75c6c562f05364646516b8c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.4

Security for stockcheck-valuation 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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