trakt.py


Nametrakt.py JSON
Version 4.4.0 PyPI version JSON
download
home_pagehttps://github.com/fuzeman/trakt.py
SummaryPython interface for the Trakt.tv API
upload_time2021-03-19 04:19:51
maintainer
docs_urlNone
authorDean Gardiner
requires_python
licenseMIT
keywords trakt.tv api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            trakt.py
========

.. image:: https://img.shields.io/pypi/v/trakt.py.svg?style=flat-square
   :target: https://pypi.python.org/pypi/trakt.py

.. image:: https://img.shields.io/travis/fuzeman/trakt.py.svg?style=flat-square
   :target: https://travis-ci.org/fuzeman/trakt.py

.. image:: https://img.shields.io/codeclimate/github/fuzeman/trakt.py.svg?style=flat-square
   :target: https://codeclimate.com/github/fuzeman/trakt.py

.. image:: https://img.shields.io/coveralls/fuzeman/trakt.py.svg?style=flat-square
   :target: https://coveralls.io/r/fuzeman/trakt.py?branch=master

Python interface for the Trakt.tv API.

Install
-------

.. code-block:: shell

    pip install trakt.py

Examples
--------

**Configure the client**

.. code-block:: python

    from trakt import Trakt


    Trakt.configuration.defaults.client(
        id='<client-id>',
        secret='<client-secret>'
    )


**Scrobble an episode**

.. code-block:: python

    show = {
        'title': 'Community',
        'year': 2009
    }

    episode = {
        'season': 5,
        'number': 13
    }

    # Send "start" event
    Trakt['scrobble'].start(
        show=show,
        episode=episode,

        progress=1
    )

    # [...] (watching episode)

    # Send "stop" event (scrobble)
    Trakt['scrobble'].stop(
        show=show,
        episode=episode,

        progress=93
    )

**Add a movie to your collection**

.. code-block:: python

    Trakt['sync/collection'].add({
        'movies': [
            {
                'title': "Twelve Monkeys",
                'year': 1995,

                'ids': {
                    'imdb': "tt0114746"
                }
            }
        ]
    })

**Retrieve shows that a user has watched**

.. code-block:: python

    # `watched` = {<key>: <Show>} dictionary
    watched = Trakt['sync/watched'].movies()

    for key, show in watched.items():
        print '%s (%s)' % (show.title, show.year)

License
-------

  The MIT License (MIT)

  Copyright (c) 2014 Dean Gardiner

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fuzeman/trakt.py",
    "name": "trakt.py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "trakt.tv,api,client",
    "author": "Dean Gardiner",
    "author_email": "me@dgardiner.net",
    "download_url": "https://files.pythonhosted.org/packages/42/2e/372d116e18f94d7c94d4f479eab073d0acabcd08e9f36dc337802c02ff0c/trakt.py-4.4.0.tar.gz",
    "platform": "any",
    "description": "trakt.py\n========\n\n.. image:: https://img.shields.io/pypi/v/trakt.py.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/trakt.py\n\n.. image:: https://img.shields.io/travis/fuzeman/trakt.py.svg?style=flat-square\n   :target: https://travis-ci.org/fuzeman/trakt.py\n\n.. image:: https://img.shields.io/codeclimate/github/fuzeman/trakt.py.svg?style=flat-square\n   :target: https://codeclimate.com/github/fuzeman/trakt.py\n\n.. image:: https://img.shields.io/coveralls/fuzeman/trakt.py.svg?style=flat-square\n   :target: https://coveralls.io/r/fuzeman/trakt.py?branch=master\n\nPython interface for the Trakt.tv API.\n\nInstall\n-------\n\n.. code-block:: shell\n\n    pip install trakt.py\n\nExamples\n--------\n\n**Configure the client**\n\n.. code-block:: python\n\n    from trakt import Trakt\n\n\n    Trakt.configuration.defaults.client(\n        id='<client-id>',\n        secret='<client-secret>'\n    )\n\n\n**Scrobble an episode**\n\n.. code-block:: python\n\n    show = {\n        'title': 'Community',\n        'year': 2009\n    }\n\n    episode = {\n        'season': 5,\n        'number': 13\n    }\n\n    # Send \"start\" event\n    Trakt['scrobble'].start(\n        show=show,\n        episode=episode,\n\n        progress=1\n    )\n\n    # [...] (watching episode)\n\n    # Send \"stop\" event (scrobble)\n    Trakt['scrobble'].stop(\n        show=show,\n        episode=episode,\n\n        progress=93\n    )\n\n**Add a movie to your collection**\n\n.. code-block:: python\n\n    Trakt['sync/collection'].add({\n        'movies': [\n            {\n                'title': \"Twelve Monkeys\",\n                'year': 1995,\n\n                'ids': {\n                    'imdb': \"tt0114746\"\n                }\n            }\n        ]\n    })\n\n**Retrieve shows that a user has watched**\n\n.. code-block:: python\n\n    # `watched` = {<key>: <Show>} dictionary\n    watched = Trakt['sync/watched'].movies()\n\n    for key, show in watched.items():\n        print '%s (%s)' % (show.title, show.year)\n\nLicense\n-------\n\n  The MIT License (MIT)\n\n  Copyright (c) 2014 Dean Gardiner\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python interface for the Trakt.tv API",
    "version": "4.4.0",
    "project_urls": {
        "Homepage": "https://github.com/fuzeman/trakt.py"
    },
    "split_keywords": [
        "trakt.tv",
        "api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7eae0f355442ad923725814687104f6ea94b1d38357bbb4df783e5f7ae13a212",
                "md5": "d4c0a73025427962bc3c22f3b400edc6",
                "sha256": "bc0953fbd01e553fe99fe7534cf3e901fa53d94ed23acb28641ce79bc117578b"
            },
            "downloads": -1,
            "filename": "trakt.py-4.4.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4c0a73025427962bc3c22f3b400edc6",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 77671,
            "upload_time": "2021-03-19T04:19:50",
            "upload_time_iso_8601": "2021-03-19T04:19:50.306925Z",
            "url": "https://files.pythonhosted.org/packages/7e/ae/0f355442ad923725814687104f6ea94b1d38357bbb4df783e5f7ae13a212/trakt.py-4.4.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "422e372d116e18f94d7c94d4f479eab073d0acabcd08e9f36dc337802c02ff0c",
                "md5": "7b1311e0ab0587bc99e716ce64f39f67",
                "sha256": "760ae97dcea8781e00a31a4f0b790f4fae63f15a2b03480fad872eaa668dc4cc"
            },
            "downloads": -1,
            "filename": "trakt.py-4.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7b1311e0ab0587bc99e716ce64f39f67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 438221,
            "upload_time": "2021-03-19T04:19:51",
            "upload_time_iso_8601": "2021-03-19T04:19:51.805150Z",
            "url": "https://files.pythonhosted.org/packages/42/2e/372d116e18f94d7c94d4f479eab073d0acabcd08e9f36dc337802c02ff0c/trakt.py-4.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-03-19 04:19:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fuzeman",
    "github_project": "trakt.py",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "trakt.py"
}
        
Elapsed time: 0.06434s