Skip to content

Commit

Permalink
project: add versioning, change name to 'pyrubrum' & update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hearot committed Jun 9, 2020
1 parent 4624a2c commit 5174a67
Show file tree
Hide file tree
Showing 29 changed files with 210 additions and 155 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -131,12 +131,12 @@ dmypy.json
# Visual Studio Code
.vscode

# Pyrogram session
# Pyrogram sessions
*.session
*.session-journal
unknown_errors.txt

# Pyroboard private examples
# Pyrubrum private examples
*_private.py

# Assets
Expand Down
18 changes: 9 additions & 9 deletions README.md
@@ -1,14 +1,14 @@
<p align="center">
<a href="https://github.com/hearot/pyroboard">
<img src="https://i.imgur.com/XhInvbp.gif" alt="Pyroboard" width="150"/>
<a href="https://github.com/hearot/pyrubrum">
<img src="https://i.imgur.com/XhInvbp.gif" alt="Pyrubrum" width="150"/>
</a>
<br>
<b>A simple framework based on Pyrogram for creating Telegram bots.</b>
<b>An intuitive framework for creating Telegram bots.</b>
<br>
<i>Create your own bot in less than 100 lines!</i>
<br>
<br>
<a href="https://github.com/hearot/pyroboard/blob/master/LICENSE">
<a href="https://github.com/hearot/pyrubrum/blob/master/LICENSE">
<img src="https://img.shields.io/badge/License-GPL%20v3-red.svg" alt="License: GPLv3"/>
</a>
Expand All @@ -17,11 +17,11 @@
</a>
</p>

## Pyroboard
## Pyrubrum

```python
from pyroboard import transform_dict, TreeHandler, TreeMenu
from pyrogram import Client
from pyrubrum import transform_dict, TreeHandler, TreeMenu

bot = Client(...)

Expand All @@ -39,14 +39,14 @@ handler.setup(bot)
bot.run()
```

**Pyroboard** is an intuitive framework for creating jointly with [Pyrogram](https://github.com/pyrogram/pyrogram) [Telegram](https://telegram.org) [bots](https://core.telegram.org/bots).
**Pyrubrum** is a versatile, charming framework for creating [Telegram](https://telegram.org) [bots](https://core.telegram.org/bots), jointly with [Pyrogram](https://github.com/pyrogram/pyrogram).

### Examples

In order to make use of the proposed examples, you need to create your own environment file by renaming [sample.env](./examples/sample.env) into `.env` and editing all the necessary variables.

- [Calendar](./examples/calendar.py) - Get what day of the week a day is by simply choosing a year, a month and a day while discovering the potential of Pyroboard page menus.
- [Sample](./examples/sample.py) - Interact with inline menus while understanding how Pyroboard works.
- [Calendar](./examples/calendar_bot.py) - Get what day of the week a day is by simply choosing a year, a month and a day while discovering the potential of Pyrubrum page menus.
- [Sample](./examples/sample_bot.py) - Interact with inline menus while understanding how Pyrubrum works.

### Copyright & License

Expand Down
26 changes: 13 additions & 13 deletions examples/calendar.py → examples/calendar_bot.py
@@ -1,32 +1,32 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from calendar import monthrange
from environs import Env # noqa
from environs import Env
from datetime import datetime
from pyroboard import (DictDatabase,
Element, Node,
PageMenu,
ParameterizedTreeHandler,
RedisDatabase,
transform_dict,
TreeMenu) # noqa
from pyrogram import Client
from pyrubrum import (DictDatabase,
Element, Node,
PageMenu,
ParameterizedTreeHandler,
RedisDatabase,
transform_dict,
TreeMenu)
from redis import Redis
from typing import Union

Expand Down
2 changes: 1 addition & 1 deletion examples/requirements.txt
@@ -1,2 +1,2 @@
environs
pyroboard
pyrubrum
12 changes: 6 additions & 6 deletions examples/sample.py → examples/sample_bot.py
@@ -1,24 +1,24 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from environs import Env
from pyroboard import Node, transform_dict, TreeHandler, TreeMenu
from pyrogram import Client
from pyrubrum import Node, transform_dict, TreeHandler, TreeMenu

tree = transform_dict(
{
Expand Down
2 changes: 2 additions & 0 deletions fast-requirements.txt
@@ -0,0 +1,2 @@
orjson
tgcrypto
18 changes: 12 additions & 6 deletions pyroboard/__init__.py → pyrubrum/__init__.py
@@ -1,28 +1,34 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .button import Button # noqa
from .database import DictDatabase, RedisDatabase # noqa
from .element import Element # noqa
from .keyboard import Keyboard # noqa
from .node import Node # noqa
from .page_item_menu import PageItemMenu # noqa
from .page_menu import PageMenu # noqa
from .parameterized_tree_handler import ParameterizedTreeHandler # noqa
from .tree_menu import TreeMenu # noqa
from .tree_handler import TreeHandler, transform_dict # noqa

__author__ = "Hearot"
__author_email__ = "gabriel@hearot.it"
__license__ = "GNU General Public License v3"
__package__ = "pyrubrum"
__url__ = "https://github.com/hearot/pyrubrum"
__version__ = "0.1a0"
10 changes: 5 additions & 5 deletions pyroboard/base_handler.py → pyrubrum/base_handler.py
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .button import Button
from dataclasses import dataclass
Expand Down
10 changes: 5 additions & 5 deletions pyroboard/base_menu.py → pyrubrum/base_menu.py
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .base_handler import BaseHandler
from .button import Button
Expand Down
10 changes: 5 additions & 5 deletions pyroboard/button.py → pyrubrum/button.py
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from dataclasses import dataclass
from typing import Any, Dict
Expand Down
10 changes: 5 additions & 5 deletions pyroboard/database/__init__.py → pyrubrum/database/__init__.py
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .dict_database import DictDatabase # noqa
from .redis_database import RedisDatabase # noqa
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from typing import Optional

Expand Down
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .base_database import BaseDatabase
from .errors import DeleteError
Expand Down
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .delete_error import DeleteError # noqa
from .expire_error import ExpireError # noqa
Expand Down
@@ -1,20 +1,20 @@
# Pyroboard - Keyboard manager for Pyrogram
# Pyrubrum - An intuitive framework for creating Telegram bots
# Copyright (C) 2020 Hearot <https://github.com/hearot>
#
# This file is part of Pyroboard.
# This file is part of Pyrubrum.
#
# Pyroboard is free software: you can redistribute it and/or modify
# Pyrubrum is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyroboard is distributed in the hope that it will be useful,
# Pyrubrum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyroboard. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrubrum. If not, see <http://www.gnu.org/licenses/>.

from .error import DatabaseError

Expand Down

0 comments on commit 5174a67

Please sign in to comment.