summaryrefslogtreecommitdiff
path: root/python-kutana.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-kutana.spec')
-rw-r--r--python-kutana.spec373
1 files changed, 373 insertions, 0 deletions
diff --git a/python-kutana.spec b/python-kutana.spec
new file mode 100644
index 0000000..4b6ac30
--- /dev/null
+++ b/python-kutana.spec
@@ -0,0 +1,373 @@
+%global _empty_manifest_terminate_build 0
+Name: python-kutana
+Version: 5.2.0
+Release: 1
+Summary: The library for developing systems for messengers and social networks
+License: MIT License
+URL: https://github.com/ekonda/kutana
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0c/58/99b315005650f01a1ee29425bba4679e58d61f98cebaf659cc7f22020651/kutana-5.2.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-sortedcontainers
+Requires: python3-aiohttp
+Requires: python3-motor
+Requires: python3-pyyaml
+
+%description
+# Kutana
+
+![Kutana logo](docs/_static/kutana-logo-512.png)
+
+[![Documentation Status](https://readthedocs.org/projects/kutana/badge/?version=latest)](https://kutana.readthedocs.io/en/latest/?badge=latest)
+[![CodeFactor](https://www.codefactor.io/repository/github/ekonda/kutana/badge)](https://www.codefactor.io/repository/github/ekonda/kutana)
+[![Coverage Status](https://coveralls.io/repos/github/ekonda/kutana/badge.svg?branch=master)](https://coveralls.io/github/ekonda/kutana?branch=master)
+[![Codebeat Badge](https://codebeat.co/badges/fd698be3-d0f9-4e3c-b235-1c3a3cdb98a9)](https://codebeat.co/projects/github-com-ekonda-kutana-master)
+[![PyPI version](https://badge.fury.io/py/kutana.svg)](https://badge.fury.io/py/kutana)
+
+The library for developing systems for messengers and social networks. Great
+for developing bots. Refer to [example](https://github.com/ekonda/kutana/tree/master/example)
+for the showcase of the library abilities.
+
+This library uses generalized attachment types, possible actions e.t.c. for flexibility
+to use plugins with different backends.
+
+## Installation
+
+```bash
+python -m pip install kutana
+```
+
+## Running
+
+### From CLI
+
+Following command will populate application's config, add specified backends and
+load plugins from specified folder.
+
+```bash
+python3 -m kutana --config example/config.yml --plugins example/plugins
+
+# usage: python3 -m kutana [-h] [--config CONFIG] [--plugins PLUGINS] [--debug]
+
+# Run kutana application instance using provided config.
+
+# optional arguments:
+# -h, --help show this help message and exit
+# --config CONFIG file with config in yaml format (default: config.yml
+# --plugins PLUGINS folder with plugins to load (default: plugins)
+# --debug set logging level to debug
+```
+
+Refer to the example [config.yml](https://github.com/ekonda/kutana/tree/master/example/config.example.yml)
+for the configuration details.
+
+### From python
+
+```py
+import json
+from kutana import Kutana, load_plugins
+from kutana.backends import Vkontakte
+
+# Import configuration
+with open("config.json") as fh:
+ config = json.load(fh)
+
+# Create application
+app = Kutana()
+
+# Add manager to application
+app.add_backend(Vkontakte(token=config["vk_token"]))
+
+# Load and register plugins
+app.add_plugins(load_plugins("plugins/"))
+
+if __name__ == "__main__":
+ # Run application
+ app.run()
+```
+
+> Token for Vkontakte is loaded from the file "config.json"
+> and plugins are loaded from folder "plugins/"
+
+## Example plugin (`plugins/echo.py`)
+
+```py
+from kutana import Plugin, t
+
+plugin = Plugin(name=t("Echo"))
+
+@plugin.on_commands(["echo"])
+async def __(msg, ctx):
+ await ctx.reply(ctx.body, attachments=msg.attachments)
+```
+
+> If your function exists only to be decorated, you can use `_` to avoid
+> unnecessary names. Use `__` if you use something like pydash.
+
+## Available backends
+
+- Vkontakte (for [vk.com](https://vk.com) groups)
+- Telegram (for [telegram.org](https://telegram.org) bots)
+
+## Authors
+
+- **Michael Krukov** - [@michaelkrukov](https://github.com/michaelkrukov)
+- [Other contributors](CONTRIBUTORS.md)
+
+
+%package -n python3-kutana
+Summary: The library for developing systems for messengers and social networks
+Provides: python-kutana
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-kutana
+# Kutana
+
+![Kutana logo](docs/_static/kutana-logo-512.png)
+
+[![Documentation Status](https://readthedocs.org/projects/kutana/badge/?version=latest)](https://kutana.readthedocs.io/en/latest/?badge=latest)
+[![CodeFactor](https://www.codefactor.io/repository/github/ekonda/kutana/badge)](https://www.codefactor.io/repository/github/ekonda/kutana)
+[![Coverage Status](https://coveralls.io/repos/github/ekonda/kutana/badge.svg?branch=master)](https://coveralls.io/github/ekonda/kutana?branch=master)
+[![Codebeat Badge](https://codebeat.co/badges/fd698be3-d0f9-4e3c-b235-1c3a3cdb98a9)](https://codebeat.co/projects/github-com-ekonda-kutana-master)
+[![PyPI version](https://badge.fury.io/py/kutana.svg)](https://badge.fury.io/py/kutana)
+
+The library for developing systems for messengers and social networks. Great
+for developing bots. Refer to [example](https://github.com/ekonda/kutana/tree/master/example)
+for the showcase of the library abilities.
+
+This library uses generalized attachment types, possible actions e.t.c. for flexibility
+to use plugins with different backends.
+
+## Installation
+
+```bash
+python -m pip install kutana
+```
+
+## Running
+
+### From CLI
+
+Following command will populate application's config, add specified backends and
+load plugins from specified folder.
+
+```bash
+python3 -m kutana --config example/config.yml --plugins example/plugins
+
+# usage: python3 -m kutana [-h] [--config CONFIG] [--plugins PLUGINS] [--debug]
+
+# Run kutana application instance using provided config.
+
+# optional arguments:
+# -h, --help show this help message and exit
+# --config CONFIG file with config in yaml format (default: config.yml
+# --plugins PLUGINS folder with plugins to load (default: plugins)
+# --debug set logging level to debug
+```
+
+Refer to the example [config.yml](https://github.com/ekonda/kutana/tree/master/example/config.example.yml)
+for the configuration details.
+
+### From python
+
+```py
+import json
+from kutana import Kutana, load_plugins
+from kutana.backends import Vkontakte
+
+# Import configuration
+with open("config.json") as fh:
+ config = json.load(fh)
+
+# Create application
+app = Kutana()
+
+# Add manager to application
+app.add_backend(Vkontakte(token=config["vk_token"]))
+
+# Load and register plugins
+app.add_plugins(load_plugins("plugins/"))
+
+if __name__ == "__main__":
+ # Run application
+ app.run()
+```
+
+> Token for Vkontakte is loaded from the file "config.json"
+> and plugins are loaded from folder "plugins/"
+
+## Example plugin (`plugins/echo.py`)
+
+```py
+from kutana import Plugin, t
+
+plugin = Plugin(name=t("Echo"))
+
+@plugin.on_commands(["echo"])
+async def __(msg, ctx):
+ await ctx.reply(ctx.body, attachments=msg.attachments)
+```
+
+> If your function exists only to be decorated, you can use `_` to avoid
+> unnecessary names. Use `__` if you use something like pydash.
+
+## Available backends
+
+- Vkontakte (for [vk.com](https://vk.com) groups)
+- Telegram (for [telegram.org](https://telegram.org) bots)
+
+## Authors
+
+- **Michael Krukov** - [@michaelkrukov](https://github.com/michaelkrukov)
+- [Other contributors](CONTRIBUTORS.md)
+
+
+%package help
+Summary: Development documents and examples for kutana
+Provides: python3-kutana-doc
+%description help
+# Kutana
+
+![Kutana logo](docs/_static/kutana-logo-512.png)
+
+[![Documentation Status](https://readthedocs.org/projects/kutana/badge/?version=latest)](https://kutana.readthedocs.io/en/latest/?badge=latest)
+[![CodeFactor](https://www.codefactor.io/repository/github/ekonda/kutana/badge)](https://www.codefactor.io/repository/github/ekonda/kutana)
+[![Coverage Status](https://coveralls.io/repos/github/ekonda/kutana/badge.svg?branch=master)](https://coveralls.io/github/ekonda/kutana?branch=master)
+[![Codebeat Badge](https://codebeat.co/badges/fd698be3-d0f9-4e3c-b235-1c3a3cdb98a9)](https://codebeat.co/projects/github-com-ekonda-kutana-master)
+[![PyPI version](https://badge.fury.io/py/kutana.svg)](https://badge.fury.io/py/kutana)
+
+The library for developing systems for messengers and social networks. Great
+for developing bots. Refer to [example](https://github.com/ekonda/kutana/tree/master/example)
+for the showcase of the library abilities.
+
+This library uses generalized attachment types, possible actions e.t.c. for flexibility
+to use plugins with different backends.
+
+## Installation
+
+```bash
+python -m pip install kutana
+```
+
+## Running
+
+### From CLI
+
+Following command will populate application's config, add specified backends and
+load plugins from specified folder.
+
+```bash
+python3 -m kutana --config example/config.yml --plugins example/plugins
+
+# usage: python3 -m kutana [-h] [--config CONFIG] [--plugins PLUGINS] [--debug]
+
+# Run kutana application instance using provided config.
+
+# optional arguments:
+# -h, --help show this help message and exit
+# --config CONFIG file with config in yaml format (default: config.yml
+# --plugins PLUGINS folder with plugins to load (default: plugins)
+# --debug set logging level to debug
+```
+
+Refer to the example [config.yml](https://github.com/ekonda/kutana/tree/master/example/config.example.yml)
+for the configuration details.
+
+### From python
+
+```py
+import json
+from kutana import Kutana, load_plugins
+from kutana.backends import Vkontakte
+
+# Import configuration
+with open("config.json") as fh:
+ config = json.load(fh)
+
+# Create application
+app = Kutana()
+
+# Add manager to application
+app.add_backend(Vkontakte(token=config["vk_token"]))
+
+# Load and register plugins
+app.add_plugins(load_plugins("plugins/"))
+
+if __name__ == "__main__":
+ # Run application
+ app.run()
+```
+
+> Token for Vkontakte is loaded from the file "config.json"
+> and plugins are loaded from folder "plugins/"
+
+## Example plugin (`plugins/echo.py`)
+
+```py
+from kutana import Plugin, t
+
+plugin = Plugin(name=t("Echo"))
+
+@plugin.on_commands(["echo"])
+async def __(msg, ctx):
+ await ctx.reply(ctx.body, attachments=msg.attachments)
+```
+
+> If your function exists only to be decorated, you can use `_` to avoid
+> unnecessary names. Use `__` if you use something like pydash.
+
+## Available backends
+
+- Vkontakte (for [vk.com](https://vk.com) groups)
+- Telegram (for [telegram.org](https://telegram.org) bots)
+
+## Authors
+
+- **Michael Krukov** - [@michaelkrukov](https://github.com/michaelkrukov)
+- [Other contributors](CONTRIBUTORS.md)
+
+
+%prep
+%autosetup -n kutana-5.2.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-kutana -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 5.2.0-1
+- Package Spec generated