semvec/pypi-packages huggingface dataset:
twitchobserver 0.8.0
Turn Twitch chatter into Python events.
License: MIT
Keywords: twitch.tv

twitch-observer
===============

twitchobserver makes interacting with Twitch chat super easy. It is
built and tuned for realtime applications. You can make chatbots chat.
You can build *Twitch Plays* video games.

Features
--------

-  *Pure Python:* No extra dependencies. Just plain and simple Python.
-  *Small API:* With a few classes and a handful of methods, you can
   learn it over a coffee break.
-  *Event Based:* Makes writing apps easy and straightforward.
-  *Context Manager:* Further simplifies working with observers.

Installation
------------

``$ pip install twitchobserver``

Usage
-----

.. code:: python

    from twitchobserver import Observer

    observer = Observer('Nick', 'oauth:abcdefghijklmnopqrstuvwxyz0123')
    observer.start()
    observer.join_channel('channel')
    observer.send_message('Hello and goodbye', 'channel')
    observer.leave_channel('channel')

Documentation
-------------

API documentation can be found over on `ReadtheDocs.org`_.

Tests
-----

``$ python -m unittest discover -s tests``

Examples
--------

Echo bot
^^^^^^^^

Whenever a message is sent, echo it back. The ``Observer`` is created as
a `context manager object`_ which will implicitly handle calling
``start()`` and ``stop()``.

.. code:: python

    import time
    from twitchobserver import Observer

    with Observer('Nick', 'oauth:abcdefghijklmnopqrstuvwxyz0123') as observer:
        observer.join_channel('channel')

        while True:
            try:
                for event in observer.get_events():
                    if event.type == 'TWITCHCHATMESSAGE':
                        observer.send_message(event.message, event.channel)

                time.sleep(1)

            except KeyboardInterrupt:
                observer.leave_channel('channel')
                break

More examples can be found in the `Cookbook`_.

License
-------

MIT

.. _ReadtheDocs.org: http://twitch-observer.readthedocs.io/en/latest
.. _context manager object: https://docs.python.org/3/reference/datamodel.html#context-managers
.. _Cookbook: https://github.com/JoshuaSkelly/twitch-observer/wiki/Cookbook
pydavis 0.1.1
Tools to stream weather data from Davis weather stations.
License: MIT
Keywords: data science,data analytics,web scraping,database,weather data,data collection,davis

Installation_ | Usage_ | License_


##################
pydavis
##################

A package intended the logging of weather data parameters monitored by
Davis weather stations. The parameters are obtained through the reports
generated at Davis WeatherLink websites, and can be streamed to a *MySQL*
database or a specified file.


************
Installation
************

The package can be installed with `pip <https://pypi.python.org/pypi/pip>`_

.. code-block:: bash

   pip install pydavis


*****
Usage
*****

Through the ``data_logging.py`` module, the weather parameters are
streamed from `WeatherLink <https://www.weatherlink.com/>`__ websites::

   >>> from data_logging import DataLogger

By instantiating the ``DataLogger`` with an URL, the logging sequence can then
be initiated and data stored according to specified format. Any logging
sequence is aborted with ``CTRL + C``.

**Storing data in a MySQL database**

.. code-block:: python

    >>> logger = DataLogger(url)
    >>> logger.initiate_logging(to_table=True,
                                user='user',
                                password='password',
                                database='pydavis',
                                table='weather_data')

The necessary arguments are *MySQL* login credentials, the name of the database
and the table. The ``logger`` will create the database and the table if
necessary.

**Storing data in a file**

.. code-block:: python

    >>> logger = DataLogger(url)
    >>> logger.initiate_logging(to_file=True,
                                path_to_file='./weather_data.csv')

The location including the name of the file must be passed as argument.
The ``logger`` will create a new file if necessary.

*******
License
*******

MIT, see `MIT license <https://opensource.org/licenses/MIT>`_.