Metadata-Version: 2.1
Name: pytse_filter
Version: 1.42
Summary: A user-friendly project to filter symbols of Tehran Stock Exchange
Home-page: https://github.com/farhad-mohammadi/pytse_filter
Author: Farhad Mohammadi
Author-email: farhad.mohammadi60@gmail.com
License: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: license.md
Requires-Dist: certifi==2024.2.2
Requires-Dist: charset-normalizer==3.3.2
Requires-Dist: colorama==0.4.6
Requires-Dist: et-xmlfile==1.1.0
Requires-Dist: idna==3.6
Requires-Dist: numpy==1.24.4
Requires-Dist: openpyxl==3.1.2
Requires-Dist: pandas==2.2.1
Requires-Dist: pandas-ta==0.3.14b0
Requires-Dist: pyarrow==15.0.0
Requires-Dist: python-dateutil==2.8.2
Requires-Dist: pytz==2024.1
Requires-Dist: requests==2.31.0
Requires-Dist: six==1.16.0
Requires-Dist: tqdm==4.66.2
Requires-Dist: tzdata==2024.1
Requires-Dist: urllib3==2.2.1
Requires-Dist: jalali_core==1.0.0
Requires-Dist: jdatetime==5.0.0
Requires-Dist: lxml==5.2.1

# pytse-filter: Tehran Stock Exchange Data Processing Library

Welcome to the **pytse-filter** library, a Python package designed for processing and analyzing Tehran Stock Exchange (TSE) symbol data through user-defined text filters. This library simplifies the task of filtering TSE data based on various conditions, making it an essential tool for traders and analysts.

## Prerequisites

Before you begin, ensure you have the following:

- **Python 3.x** installed on your system.
- Required packages: **pandas**, **pandas_ta**, **requests**, and **tqdm** installed via `pip`.

## Installation

Install **pytse-filter** easily using pip:

```bash
pip install pytse_filter
```

Or, for the latest version from the repository:

```bash
pip install git+https://github.com/farhad-mohammadi/pytse-filter.git
```

Alternatively, clone and install from the source:

```bash
git clone https://github.com/farhad-mohammadi/pytse-filter
cd pytse_filter
pip install .
```

Dependencies will be automatically resolved and installed.

## Usage

**pytse-filter** is divided into two main components: **Realtime** and **History**. These cater to users ranging from beginners to professionals, providing tools for both real-time data processing and historical data analysis.

### Realtime Filtering

For real-time data filtering, import the `RealTime` class and use it as follows:

```python
from pytse_filter import RealTime

# Define your conditions
conditions = 'pl < py and power_of_demand > 1'

# Filter data based on conditions
df = RealTime().filter_by_text_condition(conditions)
print(df)

# Save results to Excel (optional)
df.to_excel('myfilter.xlsx')
```

## Advanced Realtime Monitoring

Advanced users can continuously monitor symbol status changes:

```python
from pytse_filter import RealTime
from time import sleep
import sys

# Initialize market data
market = RealTime()

# Fetch and monitor sell queue symbols
sell_queue_symbols = market.filter_by_text_condition('pl == tmin')
# ... rest of the advanced monitoring code ...
```

## Historical Data Analysis

The **History** class allows for in-depth historical stock data analysis:

```python
from pytse_filter import History

# Download and update data with the latest market information
History().download_summary()

# Apply filters based on technical indicators and patterns
conditions = 'rsi14 < 30 and macd > 0'
df = History().filter_by_text_condition(conditions)
print(df)

# Save filtered data (optional)
df.to_excel('filtered_symbols.xlsx')
```

## Comprehensive Analysis

Combine realtime and historical data for a complete analysis setup:

```python
from pytse_filter import History, RealTime
# ... code to combine and analyze data ...
```

## Writing Conditions

Define criteria for filtering stock data using a simple text string format. Utilize variables from `RealTimeVariables.xlsx` and `HistoryVariable.xlsx`, and employ comparison and logical operators to create complex conditions.

## License

**pytse-filter** is MIT licensed. See the [LICENSE](https://github.com/farhad-mohammadi/pytse-filter/blob/main/LICENSE) file for more details.

For the full user guide, examples, and advanced usage instructions, please refer to the `user_guide.md` included with this package, or visit the [GitHub repository](https://github.com/farhad-mohammadi/pytse-filter).

Happy trading! ðŸ“ˆðŸ’¹
