django-telegram-objects


Namedjango-telegram-objects JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/ramiboutas/django-telegram-objects
Summarydjango-telegram-objects is a Django application that creates Telegram objects of a bot in a Postgres Database.
upload_time2022-12-06 04:48:54
maintainerRami Boutassghount
docs_urlNone
authorRami Boutassghount
requires_python>=3.7
licenseMIT License
keywords django telegram telegram-bot bot postgres
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======================
django-telegram-objects
=======================

.. image:: https://img.shields.io/github/workflow/status/ramiboutas/django-telegram-objects/CI/master?style=for-the-badge
   :target: https://github.com/ramiboutas/django-telegram-objects/actions?workflow=CI

.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
  :target: https://github.com/ramiboutas/django-telegram-objects/actions?workflow=CI

.. image:: https://img.shields.io/pypi/v/django-telegram-objects.svg?style=for-the-badge
    :target: https://pypi.org/project/django-telegram-objects/

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge
    :target: https://github.com/psf/black

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge
   :target: https://github.com/pre-commit/pre-commit
   :alt: pre-commit



About
-----

A Django App that creates Telegram objects of a bot in a Postgres Database.
The bot has to have permission to read the messages of the Chat objects where is the member of.


Requirements
------------

Python 3.7 to 3.11 supported.

Django 3.2 to 4.1 supported.


----

Setup
-----

Install from **pip**:

.. code-block:: sh

    python -m pip install django-telegram-objects

Add it to your installed apps:

.. code-block:: python

    INSTALLED_APPS = [
        ...,
        "telegram_objects",
        ...,
    ]


Make sure you are using a Postgres database and migrate the tables:

.. code-block:: sh

    python manage.py migrate



Set up
------

In you project settings:

Add your bot token: ``TELEGRAM_BOT_API_KEY``

Recommendation: save your bot token a .env file

.. code-block:: text

    TELEGRAM_BOT_API_KEY=<your-token>


Load your secrets keys and tokens using,
for example, [python-dotenv](https://pypi.org/project/python-dotenv/)
and access to the key using ``os.environ.get`` method:

.. code-block:: python

    TELEGRAM_BOT_API_KEY = os.environ.get("TELEGRAM_BOT_API_KEY")


Add models you would like to see in your Django admin:

Example:

.. code-block:: python

    TELEGRAM_MODELS_IN_ADMIN_SITE = (
        "Chat",
        "Message",
        "Document",
    )


How to use
----------

Once the app is set up, you can get updates by running the command:

.. code-block:: sh

    python manage.py get_updates



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ramiboutas/django-telegram-objects",
    "name": "django-telegram-objects",
    "maintainer": "Rami Boutassghount",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "ramiboutas@protonmail.com",
    "keywords": "django,telegram,telegram-bot,bot,postgres",
    "author": "Rami Boutassghount",
    "author_email": "ramiboutas@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/72/99/a615eb2b6730d30c29f55ef9fa4fa1a2c46869b20187d4759359c554f34d/django-telegram-objects-0.0.2.tar.gz",
    "platform": null,
    "description": "=======================\ndjango-telegram-objects\n=======================\n\n.. image:: https://img.shields.io/github/workflow/status/ramiboutas/django-telegram-objects/CI/master?style=for-the-badge\n   :target: https://github.com/ramiboutas/django-telegram-objects/actions?workflow=CI\n\n.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge\n  :target: https://github.com/ramiboutas/django-telegram-objects/actions?workflow=CI\n\n.. image:: https://img.shields.io/pypi/v/django-telegram-objects.svg?style=for-the-badge\n    :target: https://pypi.org/project/django-telegram-objects/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\n    :target: https://github.com/psf/black\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge\n   :target: https://github.com/pre-commit/pre-commit\n   :alt: pre-commit\n\n\n\nAbout\n-----\n\nA Django App that creates Telegram objects of a bot in a Postgres Database.\nThe bot has to have permission to read the messages of the Chat objects where is the member of.\n\n\nRequirements\n------------\n\nPython 3.7 to 3.11 supported.\n\nDjango 3.2 to 4.1 supported.\n\n\n----\n\nSetup\n-----\n\nInstall from **pip**:\n\n.. code-block:: sh\n\n    python -m pip install django-telegram-objects\n\nAdd it to your installed apps:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        ...,\n        \"telegram_objects\",\n        ...,\n    ]\n\n\nMake sure you are using a Postgres database and migrate the tables:\n\n.. code-block:: sh\n\n    python manage.py migrate\n\n\n\nSet up\n------\n\nIn you project settings:\n\nAdd your bot token: ``TELEGRAM_BOT_API_KEY``\n\nRecommendation: save your bot token a .env file\n\n.. code-block:: text\n\n    TELEGRAM_BOT_API_KEY=<your-token>\n\n\nLoad your secrets keys and tokens using,\nfor example, [python-dotenv](https://pypi.org/project/python-dotenv/)\nand access to the key using ``os.environ.get`` method:\n\n.. code-block:: python\n\n    TELEGRAM_BOT_API_KEY = os.environ.get(\"TELEGRAM_BOT_API_KEY\")\n\n\nAdd models you would like to see in your Django admin:\n\nExample:\n\n.. code-block:: python\n\n    TELEGRAM_MODELS_IN_ADMIN_SITE = (\n        \"Chat\",\n        \"Message\",\n        \"Document\",\n    )\n\n\nHow to use\n----------\n\nOnce the app is set up, you can get updates by running the command:\n\n.. code-block:: sh\n\n    python manage.py get_updates\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "django-telegram-objects is a Django application that creates Telegram objects of a bot in a Postgres Database.",
    "version": "0.0.2",
    "split_keywords": [
        "django",
        "telegram",
        "telegram-bot",
        "bot",
        "postgres"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "97826e0e58c7217b88d220c95cafa425",
                "sha256": "abc0d750e7725ddd34c2cae49a8b9919b60e479fc651dc33edbcee45b08ff574"
            },
            "downloads": -1,
            "filename": "django_telegram_objects-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "97826e0e58c7217b88d220c95cafa425",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 69116,
            "upload_time": "2022-12-06T04:48:52",
            "upload_time_iso_8601": "2022-12-06T04:48:52.746643Z",
            "url": "https://files.pythonhosted.org/packages/62/88/f82f1f0644059533c93c3ad9f63568ca350c9085c0c3cf9f0d2fb1660b00/django_telegram_objects-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "91c88dcfb25c83260b037be26c087de5",
                "sha256": "59782ff58cfcdfed92b38298ee722f9b0db5eabdb08714cc63982e5ea7e664b5"
            },
            "downloads": -1,
            "filename": "django-telegram-objects-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "91c88dcfb25c83260b037be26c087de5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 66882,
            "upload_time": "2022-12-06T04:48:54",
            "upload_time_iso_8601": "2022-12-06T04:48:54.569767Z",
            "url": "https://files.pythonhosted.org/packages/72/99/a615eb2b6730d30c29f55ef9fa4fa1a2c46869b20187d4759359c554f34d/django-telegram-objects-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-06 04:48:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ramiboutas",
    "github_project": "django-telegram-objects",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-telegram-objects"
}
        
Elapsed time: 0.04127s