Update requirements.txt and improve README.md
This commit is contained in:
parent
8052feb6ca
commit
84eeeb02a6
62
README.md
62
README.md
|
@ -1,36 +1,48 @@
|
|||
# Что это?
|
||||
# What's this?
|
||||
|
||||
Это репозиторий с базой данных цитатника bash.im и готовым fastapi.
|
||||
|
||||
Создавалось т.к. c февраля 2022 года цитатник отключили.
|
||||
|
||||
Цитаты взяты методом парсинга веб архива
|
||||
This repository contains database of all quotes from the famous website bash.im as well as the API that allows self-hosting your own quotes website.
|
||||
All of this started in February 2022 when bash.im was shut down.
|
||||
Quotes were parsed from the web archive.
|
||||
# Requirements
|
||||
- Python 3.8+ (Python 3.11 is recommended)
|
||||
- Git LFS for fetching the quotes DB
|
||||
|
||||
# Quickstart
|
||||
```
|
||||
# Clone this repository and enter it:
|
||||
git clone https://git.darkn.space/Darkn/bash-fastapi.git
|
||||
# Download the quotes.sqlite3 using Git LFS and replace the pointer file with the actual database:
|
||||
git lfs pull
|
||||
# Configure virtualenv:
|
||||
python3 -m venv .venv
|
||||
# Activate virtualenv:
|
||||
. .venv/bin/activate
|
||||
# Install dependencies:
|
||||
python3 -m pip install -r requirements.txt
|
||||
# Start main.py
|
||||
python main.py
|
||||
```
|
||||
|
||||
Требуется установленный Python 3.8+ в системе, охуенно если Python 3.10
|
||||
|
||||
1. Настроить virtualenv:
|
||||
`python -m venv .venv`
|
||||
|
||||
2. Активировать virtualenv:
|
||||
`. .venv/bin/activate`
|
||||
|
||||
3. Установить зависимости:
|
||||
`pip install -r requirements.txt`
|
||||
|
||||
4. Запустить main.py
|
||||
`python main.py`
|
||||
|
||||
# Прочая инфа
|
||||
|
||||
Стандартный порт 8001, он должен быть открыт для tcp соедений.
|
||||
Порт можно поправить в main.py, последние строчки:
|
||||
# FAQ
|
||||
### How do I change the port on which API runs?
|
||||
Default port is 8001, but you can change it inside of main.py by modifying those lines at the very end:
|
||||
|
||||
```python3
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, port=8001, host="0.0.0.0")
|
||||
```
|
||||
|
||||
### Why is quotes.sqlite3 so small and has no quotes inside of it after I cloned your repository?
|
||||
You probably forgot to install and/or use Git LFS. Go to the repository directory and run following commands:
|
||||
```
|
||||
git lfs install
|
||||
git lfs fetch
|
||||
git lfs checkout
|
||||
```
|
||||
You can read more about using Git LFS [here](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage) and [here](https://stackoverflow.com/questions/72610494/what-is-the-difference-between-git-lfs-fetch-git-lfs-fetch-all-and-git).
|
||||
### Do you really have all quotes from bash.im?
|
||||
As long as it was indexed by the web archive, it's there.
|
||||
|
||||
# Credits:
|
||||
|
||||
gameeroor за то что сделал fastapi и помогал с парсингом
|
||||
Thanks to ~~The Man, the Myth, the Legend~~ the Darkn member gameeroor for helping with parsing and making such a nice API.
|
||||
|
|
|
@ -3,7 +3,7 @@ click==8.1.3
|
|||
fastapi==0.79.0
|
||||
h11==0.13.0
|
||||
idna==3.3
|
||||
pydantic==1.9.2
|
||||
pydantic==1.10.2
|
||||
sniffio==1.2.0
|
||||
starlette==0.19.1
|
||||
typing-extensions==4.3.0
|
||||
|
|
Loading…
Reference in New Issue