https://github.com/fl1yd/quotes
✨ Service for generating quote images using Jinja2 templates
https://github.com/fl1yd/quotes
fastapi imgkit jinja2 poetry python quotes telegram template
Last synced: about 2 months ago
JSON representation
✨ Service for generating quote images using Jinja2 templates
- Host: GitHub
- URL: https://github.com/fl1yd/quotes
- Owner: Fl1yd
- License: mit
- Created: 2025-02-11T07:18:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-11T07:39:40.000Z (over 1 year ago)
- Last Synced: 2025-04-05T18:13:23.948Z (about 1 year ago)
- Topics: fastapi, imgkit, jinja2, poetry, python, quotes, telegram, template
- Language: Python
- Homepage: https://quotes.readthedocs.io/en/latest/
- Size: 61.5 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Quotes API: Quote Image Generator
What is this?
Quotes API is a FastAPI-based service that allows users to generate visually appealing quote images resembling Telegram messages
Installing
> Before installing Quotes API, ensure you have Poetry installed. You can install Poetry by following the [Poetry installation guide](https://python-poetry.org/docs/#installation)
Once Poetry is installed, clone the repository and install dependencies:
git clone https://github.com/Fl1yd/Quotes
cd Quotes
poetry install
Additionally, ensure wkhtmltopdf version 0.12.5 is installed on your system:
Download the appropriate package for your distribution from the wkhtmltopdf releases page
Install it using your package manager. For example, on Ubuntu:
sudo apt-get install -y wkhtmltopdf=0.12.5
> Note: If the specific version is not available in your package manager, you may need to download the binary directly and follow the installation instructions provided in the release notes
Usage
To use Quotes API, start the FastAPI application:
poetry run python3 -m app
The application will start on the port specified in the config.toml file (default is 1337). You can then access the API documentation at `http://localhost:1337/docs`
API Endpoints
Quotes API provides the following endpoint for generating quote images:
- **Generate quote image:**
Use the POST /generate endpoint to generate a quote image. You need to provide a `Messages` object with the required data
{
"messages": [
{
"text": "This is a quote",
"author": {
"id": 1,
"name": "Author Name"
}
}
],
"quote_color": "#000000",
"text_color": "white"
}
Configuration
Customize your application settings by updating the config.toml file:
[settings]
[settings.quote]
quality = 85
text_color = "white"
background_color = "#162330"
[settings.logging]
level = "INFO"
[settings.server]
port = 1337
License
Quotes API is licensed under the MIT License