Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 114 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,114 @@
__pycache__
!*.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyderworkspace

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Sppq provides the following powerful functions:
- `printt(text, speed)`: ⌨️ Slow printing to console

### 🤖 AI and Content Processing
- `retell(url)`: 📚 Summarizes or retells content from a given URL
- `retell(url, api_key)`: 📚 Summarizes or retells content from a given URL. **Note:** This function requires a Yandex 300 API key. You can obtain one by following the instructions [here](https://yandex.ru/dev/300/).
- `ask_gpt(prompt)`: 🤔 Interacts with GPT for responses

### 📊 Utilities
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
packages=find_packages(),
install_requires=[
"requests>=2.31.0",
"asciitext>=1.1.1",
"asciitext>=0.0.5", # Pinned to 0.0.5, as 1.1.1 is not available on PyPI
"tqdm>=4.66.1",
"discord-webhook>=1.3.0",
"matplotlib>=3.8.0",
"colorama>=0.4.6",
"g4f>=6.8.5",
],
python_requires=">=3.9",
author="sppq",
Expand All @@ -26,4 +27,9 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
entry_points={
"console_scripts": [
"sppq=sppq.cli:main",
],
},
)
3 changes: 2 additions & 1 deletion sppq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
pbarupdate,
color2rgb,
get_decimal_color,
send_webhook
send_webhook,
create_embed
)

__version__ = '0.1.0'
34 changes: 34 additions & 0 deletions sppq/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import argparse
from sppq import bigtext, ask_gpt, retell, printt

def main():
parser = argparse.ArgumentParser(description="Sppq command-line interface")
subparsers = parser.add_subparsers(dest="command")

# bigtext command
bigtext_parser = subparsers.add_parser("bigtext", help="Generate ASCII art text")
bigtext_parser.add_argument("text", type=str, help="The text to convert")
bigtext_parser.add_argument("--font_url", type=str, default="https://raw.githubusercontent.com/yasserbdj96/asciitext/main/fonts/ANSI_Shadow.txt", help="The URL of the font to use")
bigtext_parser.add_argument("--color", type=str, default="#ff0000", help="The color of the text")

# ask_gpt command
ask_gpt_parser = subparsers.add_parser("ask_gpt", help="Ask a question to GPT")
ask_gpt_parser.add_argument("prompt", type=str, help="The prompt to send to GPT")
ask_gpt_parser.add_argument("--model", type=str, default="g4f.models.gpt_35_turbo", help="The GPT model to use")

# retell command
retell_parser = subparsers.add_parser("retell", help="Summarize a URL")
retell_parser.add_argument("url", type=str, help="The URL to summarize")
retell_parser.add_argument("api_key", type=str, help="Your Yandex 300 API key")

args = parser.parse_args()

if args.command == "bigtext":
printt(bigtext(args.text, args.font_url, args.color))
elif args.command == "ask_gpt":
printt(ask_gpt(args.prompt, args.model))
elif args.command == "retell":
printt(retell(args.url, args.api_key))

if __name__ == "__main__":
main()
Loading
Loading