Name | fortnitepy-edit JSON |
Version |
1.1.2
JSON |
| download |
home_page | None |
Summary | Library for interacting with fortnite services |
upload_time | 2024-09-15 14:10:25 |
maintainer | None |
docs_url | None |
author | klld |
requires_python | >=3.5.3 |
license | MIT |
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/9a/d3/843dcbc407588d80e8b723951d99c10af0cbbaf2261c91e2836090fd6535/fortnitepy-edit-1.1.2.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.2",
"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": "8c207caf09a44daeeeb98a210fbe36ccb85b8569f24f4f8c7846f9850273aaa1",
"md5": "319af80623d41ebdc9ab2ad78297f3d5",
"sha256": "4c1c9abe1dd62ec4e45d10c8d7015665bf5f46e2cc39510942b27d90d5989542"
},
"downloads": -1,
"filename": "fortnitepy_edit-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "319af80623d41ebdc9ab2ad78297f3d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5.3",
"size": 181019,
"upload_time": "2024-09-15T14:10:22",
"upload_time_iso_8601": "2024-09-15T14:10:22.231476Z",
"url": "https://files.pythonhosted.org/packages/8c/20/7caf09a44daeeeb98a210fbe36ccb85b8569f24f4f8c7846f9850273aaa1/fortnitepy_edit-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9ad3843dcbc407588d80e8b723951d99c10af0cbbaf2261c91e2836090fd6535",
"md5": "855ecf40d48e9b7e270ba8d394e60366",
"sha256": "c1383e927a2595916f38d83ba9994a402c7f6e8c9f0e67497d7812d08743fa9e"
},
"downloads": -1,
"filename": "fortnitepy-edit-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "855ecf40d48e9b7e270ba8d394e60366",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5.3",
"size": 156604,
"upload_time": "2024-09-15T14:10:25",
"upload_time_iso_8601": "2024-09-15T14:10:25.916338Z",
"url": "https://files.pythonhosted.org/packages/9a/d3/843dcbc407588d80e8b723951d99c10af0cbbaf2261c91e2836090fd6535/fortnitepy-edit-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-15 14:10:25",
"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"
}