fortnitepy-edit


Namefortnitepy-edit JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryLibrary for interacting with fortnite services
upload_time2024-06-12 14:41:18
maintainerNone
docs_urlNone
authorklld
requires_python>=3.5.3
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
             # fortnitepy-edit

[![Supported py versions](https://img.shields.io/pypi/pyversions/fortnitepy-edit.svg)](https://pypi.org/project/fortnitepy-edit/)
[![Current pypi version](https://img.shields.io/pypi/v/fortnitepy-edit.svg)](https://pypi.org/project/fortnitepy-edit/)


Asynchronous library for interacting with Fortnite and EpicGames' API and XMPP services.

**Note:** This library is still under developement so breaking changes might happen at any time.

**Some key features:**
- Full support for Friends.
- Support for XMPP events including friend and party messages + many more.
- Support for Parties.
- Support for Battle Royale stats.

# Documentation
https://fortnitepy.readthedocs.io/en/latest/

# Installing
```
# windows
py -3 -m pip install -U git+https://github.com/klldme/fortnitepy-edit
py -3 -m pip install -U fortnitepy-edit

# linux
python3 -m pip install -U git+https://github.com/klldme/fortnitepy-edit
python3 -m pip install -U fortnitepy-edit
```

# Basic usage
```py
import fortnitepy
import json
import os

from fortnitepy.ext import commands

email = 'email@email.com'
password = 'password1'
filename = 'device_auths.json'

def get_device_auth_details():
    if os.path.isfile(filename):
        with open(filename, 'r') as fp:
            return json.load(fp)
    return {}

def store_device_auth_details(email, details):
    existing = get_device_auth_details()
    existing[email] = details

    with open(filename, 'w') as fp:
        json.dump(existing, fp)

device_auth_details = get_device_auth_details().get(email, {})
bot = commands.Bot(
    command_prefix='!',
    auth=fortnitepy.AdvancedAuth(
        email=email,
        password=password,
        prompt_authorization_code=True,
        prompt_code_if_invalid=True,
        delete_existing_device_auths=True,
        **device_auth_details
    )
)

@bot.event
async def event_device_auth_generate(details, email):
    store_device_auth_details(email, details)

@bot.event
async def event_ready():
    print('----------------')
    print('Bot ready as')
    print(bot.user.display_name)
    print(bot.user.id)
    print('----------------')

@bot.event
async def event_friend_request(request):
    await request.accept()

@bot.command()
async def hello(ctx):
    await ctx.send('Hello!')

bot.run()
```

# Authorization
How to get a one time authorization code:
1. Log into the epic games account of your choice [here](https://www.epicgames.com/id/logout?redirectUrl=https%3A//www.epicgames.com/id/login%3FredirectUrl%3Dhttps%253A%252F%252Fwww.epicgames.com%252Fid%252Fapi%252Fredirect%253FclientId%253D3446cd72694c4a4485d81b77adbb2141%2526responseType%253Dcode).
2. Copy the hex part from the url that shows up as showcased by the image below:

![Authorization Code](https://raw.githubusercontent.com/Terbau/fortnitepy/dev/docs/resources/images/authorization_code.png)

# Credit
Thanks to [Kysune](https://github.com/SzymonLisowiec), [iXyles](https://github.com/iXyles), [Vrekt](https://github.com/Vrekt) and [amrsatrio](https://github.com/Amrsatrio) for ideas and/or work that this library is built upon.

Also thanks to [discord.py](https://github.com/Rapptz/discord.py) for much inspiration code-wise.

# Need help?
If you need more help feel free to join this [discord server](https://discord.gg/rnk869s).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fortnitepy-edit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5.3",
    "maintainer_email": null,
    "keywords": null,
    "author": "klld",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b2/d1/bb522072100b1fb19789af57e72794960c84541d8631f6400b3d612cda86/fortnitepy-edit-1.1.0.tar.gz",
    "platform": null,
    "description": " # fortnitepy-edit\n\n[![Supported py versions](https://img.shields.io/pypi/pyversions/fortnitepy-edit.svg)](https://pypi.org/project/fortnitepy-edit/)\n[![Current pypi version](https://img.shields.io/pypi/v/fortnitepy-edit.svg)](https://pypi.org/project/fortnitepy-edit/)\n\n\nAsynchronous library for interacting with Fortnite and EpicGames' API and XMPP services.\n\n**Note:** This library is still under developement so breaking changes might happen at any time.\n\n**Some key features:**\n- Full support for Friends.\n- Support for XMPP events including friend and party messages + many more.\n- Support for Parties.\n- Support for Battle Royale stats.\n\n# Documentation\nhttps://fortnitepy.readthedocs.io/en/latest/\n\n# Installing\n```\n# windows\npy -3 -m pip install -U git+https://github.com/klldme/fortnitepy-edit\npy -3 -m pip install -U fortnitepy-edit\n\n# linux\npython3 -m pip install -U git+https://github.com/klldme/fortnitepy-edit\npython3 -m pip install -U fortnitepy-edit\n```\n\n# Basic usage\n```py\nimport fortnitepy\nimport json\nimport os\n\nfrom fortnitepy.ext import commands\n\nemail = 'email@email.com'\npassword = 'password1'\nfilename = 'device_auths.json'\n\ndef get_device_auth_details():\n    if os.path.isfile(filename):\n        with open(filename, 'r') as fp:\n            return json.load(fp)\n    return {}\n\ndef store_device_auth_details(email, details):\n    existing = get_device_auth_details()\n    existing[email] = details\n\n    with open(filename, 'w') as fp:\n        json.dump(existing, fp)\n\ndevice_auth_details = get_device_auth_details().get(email, {})\nbot = commands.Bot(\n    command_prefix='!',\n    auth=fortnitepy.AdvancedAuth(\n        email=email,\n        password=password,\n        prompt_authorization_code=True,\n        prompt_code_if_invalid=True,\n        delete_existing_device_auths=True,\n        **device_auth_details\n    )\n)\n\n@bot.event\nasync def event_device_auth_generate(details, email):\n    store_device_auth_details(email, details)\n\n@bot.event\nasync def event_ready():\n    print('----------------')\n    print('Bot ready as')\n    print(bot.user.display_name)\n    print(bot.user.id)\n    print('----------------')\n\n@bot.event\nasync def event_friend_request(request):\n    await request.accept()\n\n@bot.command()\nasync def hello(ctx):\n    await ctx.send('Hello!')\n\nbot.run()\n```\n\n# Authorization\nHow to get a one time authorization code:\n1. Log into the epic games account of your choice [here](https://www.epicgames.com/id/logout?redirectUrl=https%3A//www.epicgames.com/id/login%3FredirectUrl%3Dhttps%253A%252F%252Fwww.epicgames.com%252Fid%252Fapi%252Fredirect%253FclientId%253D3446cd72694c4a4485d81b77adbb2141%2526responseType%253Dcode).\n2. Copy the hex part from the url that shows up as showcased by the image below:\n\n![Authorization Code](https://raw.githubusercontent.com/Terbau/fortnitepy/dev/docs/resources/images/authorization_code.png)\n\n# Credit\nThanks to [Kysune](https://github.com/SzymonLisowiec), [iXyles](https://github.com/iXyles), [Vrekt](https://github.com/Vrekt) and [amrsatrio](https://github.com/Amrsatrio) for ideas and/or work that this library is built upon.\n\nAlso thanks to [discord.py](https://github.com/Rapptz/discord.py) for much inspiration code-wise.\n\n# Need help?\nIf you need more help feel free to join this [discord server](https://discord.gg/rnk869s).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Library for interacting with fortnite services",
    "version": "1.1.0",
    "project_urls": {
        "Documentation": "https://fortnitepy.readthedocs.io/en/latest/",
        "Issue tracker": "https://github.com/klldme/fortnitepy-edit/Issue"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8e913d9c08f05f5a4efb2e3613954b3b25d4f4c8cef2a07fb0db51dbae5e0af",
                "md5": "69d740b57344e0c1c5fc055709299ca6",
                "sha256": "c365e99d4a161428ce72e19055feb4c73a57261bbfd02ab8c02a75333e2d459e"
            },
            "downloads": -1,
            "filename": "fortnitepy_edit-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "69d740b57344e0c1c5fc055709299ca6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5.3",
            "size": 179321,
            "upload_time": "2024-06-12T14:41:16",
            "upload_time_iso_8601": "2024-06-12T14:41:16.181563Z",
            "url": "https://files.pythonhosted.org/packages/c8/e9/13d9c08f05f5a4efb2e3613954b3b25d4f4c8cef2a07fb0db51dbae5e0af/fortnitepy_edit-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2d1bb522072100b1fb19789af57e72794960c84541d8631f6400b3d612cda86",
                "md5": "6803ae9d35f3b5516a91913923cf3e63",
                "sha256": "47b9607acd85640af2553940a0095f10ecd30dd5d1f35ed43d0cbb10d35bb68b"
            },
            "downloads": -1,
            "filename": "fortnitepy-edit-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6803ae9d35f3b5516a91913923cf3e63",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5.3",
            "size": 155059,
            "upload_time": "2024-06-12T14:41:18",
            "upload_time_iso_8601": "2024-06-12T14:41:18.909403Z",
            "url": "https://files.pythonhosted.org/packages/b2/d1/bb522072100b1fb19789af57e72794960c84541d8631f6400b3d612cda86/fortnitepy-edit-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-12 14:41:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "klldme",
    "github_project": "fortnitepy-edit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fortnitepy-edit"
}
        
Elapsed time: 0.24217s