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 ⚙️

The required packages to run this code can be found in the requirements.txt file. To run this file, execute the following code block after cloning the repository:

pip install -r requirements.txt

or

pip install git+https://github.com/StephanAkkerman/stock-recognizer.git

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.0.tar.gz (5.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.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stock_recognizer-0.1.0.tar.gz
  • Upload date:
  • Size: 5.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.0.tar.gz
Algorithm Hash digest
SHA256 73e574365fc5201cb4038a1ea82b6076b806f737b3267925e76d0581003adcd3
MD5 e8bbdaf0c56cd180d7b76bb89682550f
BLAKE2b-256 078774324df68f4e47b63117188cc803d0f62503ebcb0cce6ed65e3bb8411429

See more details on using hashes here.

Provenance

The following attestation bundles were made for stock_recognizer-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for stock_recognizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28969e26430edf7b5881668103dabde597dda653a98473581a17f18abc5b7bfb
MD5 436809c7d3ff55638f6fae9db0847b8d
BLAKE2b-256 04397db4eadd6f21394fb27fba0459f7b7e8b45e4f9c29b93379ba61282d3c46

See more details on using hashes here.

Provenance

The following attestation bundles were made for stock_recognizer-0.1.0-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