tornapi


Nametornapi JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/nikkel/tornapi
SummaryA Python library for interacting with the Torn API
upload_time2024-07-15 23:50:04
maintainerNone
docs_urlNone
authorRyan Clark
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TornAPI

TornAPI is a Python library for interacting with the Torn API. This library provides easy access to Torn's various API endpoints, including user, city, and faction endpoints. It supports rate limiting and allows users to set custom API keys.

- Easy-to-use API client.
- Rate limiting to avoid exceeding the API request limits.
- Custom exceptions for error handling.
- Comprehensive support for user selection endpoints.

## Features

- Access to multiple Torn API endpoints
- Rate limiting to prevent exceeding API request limits
- Customizable API key and rate limit settings
- Optional user ID parameter for user-related endpoints
- Exception handling for API errors
- Deprecation warnings for deprecated functions

## Installation

To install TornAPI, simply use pip:

```bash
pip install tornapi
```

## Usage

Here's an example of how to use the TornAPI library:

```python
from tornapi import TornAPI

# Initialize the API client
api = TornAPI('your-api-key', rate_limit=100)

# Fetch basic user data
user_data = api.user.basic()
print(user_data)

# Fetch user icons
icons_data = api.user.icons()
print(icons_data)

# Fetch your profile
profile_data = api.user.profile()
print(profile_data)

# Fetch another user's profile by user ID
profile_data = api.user.profile(user_id=123456)
print(profile_data)

# Fetch stock data
stock_data = api.torn.stocks()
print(stock_data)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nikkel/tornapi",
    "name": "tornapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Ryan Clark",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/17/ab/26f0fd5e708e7594950deabaf6c9cc2ae4fb6f1a566ce6f74d623561645f/tornapi-0.2.0.tar.gz",
    "platform": null,
    "description": "# TornAPI\n\nTornAPI is a Python library for interacting with the Torn API. This library provides easy access to Torn's various API endpoints, including user, city, and faction endpoints. It supports rate limiting and allows users to set custom API keys.\n\n- Easy-to-use API client.\n- Rate limiting to avoid exceeding the API request limits.\n- Custom exceptions for error handling.\n- Comprehensive support for user selection endpoints.\n\n## Features\n\n- Access to multiple Torn API endpoints\n- Rate limiting to prevent exceeding API request limits\n- Customizable API key and rate limit settings\n- Optional user ID parameter for user-related endpoints\n- Exception handling for API errors\n- Deprecation warnings for deprecated functions\n\n## Installation\n\nTo install TornAPI, simply use pip:\n\n```bash\npip install tornapi\n```\n\n## Usage\n\nHere's an example of how to use the TornAPI library:\n\n```python\nfrom tornapi import TornAPI\n\n# Initialize the API client\napi = TornAPI('your-api-key', rate_limit=100)\n\n# Fetch basic user data\nuser_data = api.user.basic()\nprint(user_data)\n\n# Fetch user icons\nicons_data = api.user.icons()\nprint(icons_data)\n\n# Fetch your profile\nprofile_data = api.user.profile()\nprint(profile_data)\n\n# Fetch another user's profile by user ID\nprofile_data = api.user.profile(user_id=123456)\nprint(profile_data)\n\n# Fetch stock data\nstock_data = api.torn.stocks()\nprint(stock_data)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for interacting with the Torn API",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/nikkel/tornapi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "885c74e9c6efef6f4012020ef7f9c53f6fcb25945a9edf33d8fe15569a4ea3f1",
                "md5": "d4057c61ccef6c6f7999025bf7ad9cc2",
                "sha256": "f98fffbc5a7306f8836fd35fd97aa2254d2717d841c9fa7f6155af2a4b0d65b6"
            },
            "downloads": -1,
            "filename": "tornapi-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4057c61ccef6c6f7999025bf7ad9cc2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7251,
            "upload_time": "2024-07-15T23:50:03",
            "upload_time_iso_8601": "2024-07-15T23:50:03.435527Z",
            "url": "https://files.pythonhosted.org/packages/88/5c/74e9c6efef6f4012020ef7f9c53f6fcb25945a9edf33d8fe15569a4ea3f1/tornapi-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17ab26f0fd5e708e7594950deabaf6c9cc2ae4fb6f1a566ce6f74d623561645f",
                "md5": "97f5e03a260017c7d42740ca257a1970",
                "sha256": "0e6a42eed8a261751c7d9beacd521d8438a4aa860e6d607557013edcbf7b7412"
            },
            "downloads": -1,
            "filename": "tornapi-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "97f5e03a260017c7d42740ca257a1970",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 6424,
            "upload_time": "2024-07-15T23:50:04",
            "upload_time_iso_8601": "2024-07-15T23:50:04.804507Z",
            "url": "https://files.pythonhosted.org/packages/17/ab/26f0fd5e708e7594950deabaf6c9cc2ae4fb6f1a566ce6f74d623561645f/tornapi-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-15 23:50:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nikkel",
    "github_project": "tornapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "tornapi"
}
        
Elapsed time: 0.26582s