fortnitepy-edit


Namefortnitepy-edit JSON
Version 1.0.8 PyPI version JSON
download
home_page
SummaryLibrary for interacting with fortnite services
upload_time2024-02-14 19:20:04
maintainer
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": "",
    "name": "fortnitepy-edit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5.3",
    "maintainer_email": "",
    "keywords": "",
    "author": "klld",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/03/ff/3b777594dae8f6985af36fdf6f75cc3f5753e55fe533e10aa494107a9272/fortnitepy-edit-1.0.8.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.0.8",
    "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": "c73b4a565256a084a47dd970f2e0b361496607d6f407f177208601008a531849",
                "md5": "bc5f2596182f73c656e68ec960cf0f48",
                "sha256": "afc6a73f8464891678f77b6be31ae8e91c954042548418e453194c60f617cc89"
            },
            "downloads": -1,
            "filename": "fortnitepy_edit-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bc5f2596182f73c656e68ec960cf0f48",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5.3",
            "size": 179328,
            "upload_time": "2024-02-14T19:20:01",
            "upload_time_iso_8601": "2024-02-14T19:20:01.163497Z",
            "url": "https://files.pythonhosted.org/packages/c7/3b/4a565256a084a47dd970f2e0b361496607d6f407f177208601008a531849/fortnitepy_edit-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03ff3b777594dae8f6985af36fdf6f75cc3f5753e55fe533e10aa494107a9272",
                "md5": "792456e0e1d044e2f31ea26c798e0ad9",
                "sha256": "2d260fae7b3f08868cf7a29d196758c1a4cdf20a5b361ee31f035d5b0cfd103c"
            },
            "downloads": -1,
            "filename": "fortnitepy-edit-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "792456e0e1d044e2f31ea26c798e0ad9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5.3",
            "size": 154927,
            "upload_time": "2024-02-14T19:20:04",
            "upload_time_iso_8601": "2024-02-14T19:20:04.313803Z",
            "url": "https://files.pythonhosted.org/packages/03/ff/3b777594dae8f6985af36fdf6f75cc3f5753e55fe533e10aa494107a9272/fortnitepy-edit-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-14 19:20:04",
    "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.22636s