semvec/pypi-packages huggingface dataset:
queupy 0.2.5
A queuing library based on Peewee
Requires Python: >=3.6

# Queupy

Queupy is a Python library designed to provide a fast and safe message queuing system using PostgreSQL. It creates a dedicated table `_queupy_event` to handle event messages efficiently with both producer and consumer functionalities.

## Features

- Simple initialization and setup (no need for additional services)
- Efficient event queuing using PostgreSQL
- Easy-to-use producer and consumer interfaces for event handling

## Installation

To install Queupy, use pip:

```bash
pip install queupy
```

## Usage

### Consumer Example

Below is an example of how to use Queupy to consume events from the queue.

```python
from queupy import init_queue

event_queue = init_queue(
    database_name='queupy',
    host='localhost',
    user='queupy',
    password='queupy',
)

for event in event_queue.consume('test', frequency=0.01):
    print(f"Consuming event {event}")

```

### Producer Example

Here is an example of how to use Queupy to push events to the queue.

```python
from queupy import init_queue


event_queue = init_queue(
    database_name='queupy',
    host='localhost',
    user='queupy',
    password='queupy',
)

for i in range(1000):
    event_queue.push('test', {'i': i})

```

## Configuration

### Database Configuration

Ensure that your PostgreSQL database is properly configured and accessible. Queupy requires the following parameters for initialization:

- `database_name`: The name of your PostgreSQL database.
- `host`: The host address of your PostgreSQL server.
- `user`: The username to access your PostgreSQL database.
- `password`: The password for the PostgreSQL user.

### Table Schema

Queupy will automatically create the `_queupy_event` table in your specified database. Ensure your database user has the necessary permissions to create and modify tables.

| id   | event | state | payload   | transaction_id                        | created_at                | updated_at                |
|------|-------|-------|-----------|---------------------------------------|---------------------------|---------------------------|
| 7148 | test  | 0     | {"i": 58} |                                       | 2024-07-26 17:20:51.34825 | 2024-07-26 17:20:51.34825 |
| 2    | test  | 1     | {"i": 1}  | 8000142a-42b9-4656-8518-81e3ee6bd20b  | 2024-07-26 14:06:22.596648| 2024-07-26 16:15:56.322857|
| 3    | test  | 1     | {"i": 2}  | a6e8b353-c53d-48fb-b8b0-5a972648b384  | 2024-07-26 14:06:22.598692| 2024-07-26 16:15:57.381679|


Not consumed events have a `state` of `0`, while consumed events have a `state` of `1`. The `transaction_id` is used to ensure that events are consumed only once.

## Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your improvements.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Contact

For any questions or issues, please open an issue on the GitHub repository or contact the author at [enzo.the@gmail.com]

---

Happy queuing with Queupy!
pdf-rss-dl 0.0.2
A tool to download and export RSS feed entries as PDFs
Requires Python: >=3.7

# PDF RSS Downloader

This Python script downloads and exports RSS feed entries into PDF files. It checks if the entries have already been exported by referencing a `downloaded.dat` file to avoid duplicates. The script handles multiple date formats and ensures that the generated filenames are compatible with the filesystem.

## Features

- **RSS Feed Parsing:** Parses RSS feeds from a list of URLs.
- **PDF Export:** Converts RSS entries (including title, link, publication date, and description) into PDF files.
- **Duplicate Check:** Keeps track of downloaded entries using `downloaded.dat` to prevent duplicate downloads.
- **Filename Sanitization:** Ensures filenames are safe and do not exceed OS limits by truncating and sanitizing them.
- **Multiple Date Formats:** Supports parsing of multiple date formats commonly found in RSS feeds.
- **UTF-8 Character Handling:** Handles special characters in RSS entries to avoid encoding issues.

## Requirements

- Python 3.7 or higher
- [fpdf](https://pypi.org/project/fpdf/) library

You can install the required dependencies using pip:

```bash
pip install fpdf feedparser
```

## Usage
1. Clone the repository:
```
git clone https://github.com/thisisawesome1994/pdf-rss-downloader.git
cd pdf-rss-downloader
```
2. Prepare the RSS Feeds:
   
    -  Create a rss_feeds.txt file in the root directory of the project.
    -  Add the RSS feed URLs, one per line. Example:
```
https://example.com/rss
https://anotherexample.com/feed
```
3. Run the Script:
```
python app.py
```
4. Output:
  
  -  PDFs will be saved in the downloaded_pdfs directory, organized by feed title and year of publication.
5. Check Duplicates:
  -  The script logs downloaded entries in downloaded.dat to avoid processing the same entry multiple times.

## Customization
  -  Filename Length:
    -  The sanitize_filename function truncates filenames to a default of 100 characters. You can modify this value in the script if needed.
  -  Adding New Date Formats:
    -  You can add more date formats to the parse_published_date function if your RSS feed uses a format not covered by the script.

## Contributing

Feel free to submit issues or pull requests. Contributions are welcome!