Skip to main content

High-precision stock ticker and company recognition for social media.

Project description

Stock Recognizer 📈


GitHub Actions Workflow Status License Code style: black

Introduction

A lightweight, hybrid Python library for extracting stock tickers and company names from messy social media text (Reddit, Twitter, etc.).

Table of Contents 🗂

Key Features 🔑

  • Hybrid Engine: Combines Regex, financedatabase (Market Data), and GLiNER2 (AI).
  • Context Aware: Distinguishes between "DD" (Due Diligence) and "DD" (DuPont).
  • Yelling Protection: Smart filters for posts written in ALL CAPS.
  • Auto-Mapping: Automatically converts "Apple" or "TSMC" to AAPL and TSM.

Installation ⚙️

Installation can be done via pip:

pip install stock-recognizer

Usage ⌨️

from stock_recognizer import StockRecognizer

# Initialize (Market Data only for speed)
recognizer = StockRecognizer(use_ai=False)

text = "$PLAB DD: easy to understand TSMC supplier"
tickers = recognizer.recognize(text)
print(tickers) # ['PLAB'] (TSMC needs AI mapping)

# Initialize with AI for deep extraction
recognizer_ai = StockRecognizer(use_ai=True)
tickers_ai = recognizer_ai.recognize_ai(text)
print(tickers_ai) # ['PLAB', 'TSM']

Citation ✍️

If you use this project in your research, please cite as follows:

@misc{project_name,
  author  = {Stephan Akkerman},
  title   = {Stock Recognizer},
  year    = {2026},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/StephanAkkerman/stock-recognizer}}
}

Contributing 🛠

Contributions are welcome! If you have a feature request, bug report, or proposal for code refactoring, please feel free to open an issue on GitHub. We appreciate your help in improving this project.
https://github.com/StephanAkkerman/stock-recognizer/graphs/contributors

License 📜

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stock_recognizer-0.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stock_recognizer-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file stock_recognizer-0.1.1.tar.gz.

File metadata

  • Download URL: stock_recognizer-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stock_recognizer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 09a128017efd48137a5c86db952f86d3aff34a80ba08625f853028bc23a1302f
MD5 ac3249746604aea5bf95f7266f507c3d
BLAKE2b-256 4281b8e0c9b7c6c6db2b9dff549489a0e7a44a94ba0885cd0502c1c83ab7c96f

See more details on using hashes here.

Provenance

The following attestation bundles were made for stock_recognizer-0.1.1.tar.gz:

Publisher: publish.yml on StephanAkkerman/stock-recognizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stock_recognizer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stock_recognizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b972aa892e6ff0a34ba98625aaf1bfee0a81bbb42e149f3cb83b872d854b84af
MD5 9eaa63f407f9511a6caaa3658260ed67
BLAKE2b-256 ca4848cef15235e3ca033e0cae580de45ffbd7c9ded2cfe28fdfeca686e330f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for stock_recognizer-0.1.1-py3-none-any.whl:

Publisher: publish.yml on StephanAkkerman/stock-recognizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page