Metadata-Version: 2.4
Name: baybin_sentinel
Version: 2026.6.18.1
Summary: Baybin Sentinel: OpenSearch writer
Author-email: Hsin-Yu Liu <meteorgroup33@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/meteorgroup33/baybin_sentinel
Project-URL: Bug Tracker, https://github.com/meteorgroup33/baybin_sentinel/issues
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/markdown
Requires-Dist: opensearch-py>=2.8.0
Requires-Dist: pyyaml>=6.0.2

# Baybin Sentinel

`baybin_sentinel` is a Python utility package designed for the **Baybin Sentiment Analysis System**. It provides specialized writers to streamline the ingestion of social media data into **OpenSearch**.

## Installation

### (For Crawler Developers) Install Package
```bash
$ pip install -U baybin_sentinel
```

### (For Package Developers) Create Virtual Environment
```bash
$ conda update -n base -c conda-forge conda
$ conda create -n sentinel python=3.13 pip -y
$ conda activate sentinel
$ cd E:\baybin_sentinel
$ pip install -r requirements.txt
```


## Example (Threads)

```python
from baybin_sentinel.platforms.threads import ThreadsWriter

# Initialize writer
writer = ThreadsWriter(
    host="192.168.x.x",
    port=9200,
    user="your_username",
    password="your_password",
    verify_certs=False
)

# Single post
post = crawled_threads(...)
writer.save(post)

# Multiple posts (bulk)
posts = crawled_threads_bulk(...)
writer.save_bulk(posts)
```

## Example (Facebook)
```python
from baybin_sentinel.platforms.facebook import FacebookWriter

# Initialize writer
writer = FacebookWriter(
    host="192.168.x.x",
    port=9200,
    user="your_username",
    password="your_password",
    verify_certs=False
)

# Single post
post = crawled_facebook(...)
writer.save(post)

# Multiple posts (bulk)
posts = crawled_facebook_bulk(...)
writer.save_bulk(posts)
```


## Publishing to PyPI

If you are the maintainer, follow these steps to publish a new version:

1. **Update version** in `pyproject.toml` (e.g., `0.2.0`).
2. **Install build tools**:
   ```bash
   pip install build twine
   ```
3. **Build the package**:
   ```bash
   # Remove old builds
   rmdir /s /q dist build 2>nul
   # Build new artifacts
   python -m build
   ```
4. **Upload to PyPI**:
   ```bash
   python -m twine upload dist/*
   ```
5. **Authentication**:
   When prompted for a username and password:
   * **Username**: `__token__`
   * **Password**: `pypi-your-api-token-here` (including the `pypi-` prefix)

   *Note: You can also configure this in a `.pypirc` file in your home directory to skip manual entry.*


