<div style="user-select: none;" align="center">

</div>
<h1 align="center">Aberoth Ephemeris</h1>
<p>A Python module that provides information about upcoming scroll events and moon phases in the MMORPG <a href="https://www.aberoth.com" target="_blank">Aberoth</a>. If you're looking for an easy way to get the predictions from this module in a more human readable form without creating having to your own application, check out the <a href="https://github.com/aberoth-community/ephemeris-discord-bot" target="_blank">Ephemeris Discord Bot</a>.</p>
#### Installing
The module can be downloaded from PyPI using
```bash
pip install aberoth-ephemeris
```
or you can download [the latest release](https://github.com/jvandag/aberoth-ephemeris/releases) from GitHub
#### Use Example
Once you've installed the module, it can be used like so
```python
from aberoth_ephemeris import Ephemeris
import time
# number of milliseconds in a day
ms_1day = 86400000
# four days before the current time
startTime = round((time.time() * 1000) + -4 * ms_1day)
# 35 days after the current time
endTime = round((time.time() * 1000) + 35 * ms_1day)
ephemeris = Ephemeris(
# the epoch time in ms that prediction calculations will start from
start=round((time.time() * 1000) + -4 * 86400000),
# the epoch time in ms that scroll prediction calculations will stop at
end=round((time.time() * 1000) + 35 * 86400000),
# the number of cycles into the future that the moon phases are calculated for
numMoonCycles=8,
# adds discord timestamp to ephemeris event information if True
discordTimestamps=False,
# indicates that calculations should be split between multiple processes/cores
multiProcess=True,
# indicates number of cores to use, automatically uses all cores if None
numCores = None,
# None indicates that the built in orb variables should be used
varFile = None
)
```
The start and stop times are just examples and any time may be used so long as the start time is before the stop time.
By default, built in orb variables are used for predictions. If you wish to use your own variables you can pass the path to your own variables file into varFile as a string. See the [gathering your own variables](#gathering-your-own-variables) section for details on how you might gather your own variables.
Optionally, a web server may be run to intake auto-calibration data from a separate script. To do so, run the following code on a separate thread or process
```python
from waitress import serve
from aberoth_ephemeris import app
# serve on separate thread or process
serve(app, host="0.0.0.0", port=5000, threads=1)
```
When valid calibration data is received over HTTP request, the variables used to predict alignments are updated and used the next time an ephemeris object is created or the ephemeris event cache is recreated.
Make sure to configure a .env file containing a pass key named `UPDATE_KEY` for the http server request.
Example .env
```
UPDATE_KEY={verification key for HTTP server}
```
An excellent separate script that can be used to gather and send live calibration data to this module is the [Ephemeris Overheard Hook](https://github.com/aberoth-community/ephemeris-overheard-hook/tree/main) made by GitHub user [jvandag](https://github.com/jvandag). It is built on GitHub user [ashnel3's](https://github.com/ashnel3) [Overheard Scraper](https://github.com/aberoth-community/overheard) which scrapes the [Aberoth overheard page](https://aberoth.com/highscore/overheard.html) to find changes in scroll state, moon phase, time of day, and number of players online.
For formatting of this HTTP message refer to this [example fetch request](https://github.com/jvandag/aberoth-ephemeris/blob/main/aberoth_ephemeris/UpdateWebServer/exampleCalibrationMsg.js).
#### Event Structure
The calculated scroll events are stored in the `Ephemeris.scrollEventsCache` property which is formatted as follows
```python
[
(
timestamp,
{
"newGlows": glowList, # list of orb names
"newDarks": darkList, # list of orb names
"returnedToNormal": returnedToNormal, # list of orb names
"discordTS": f"<t:{int(np.floor(timestamp/1000))}:D> <t:{int(np.floor(timestamp/1000))}:T>"
}
),
...
]
# Possible orb names: ["Shadow", "White", "Black", "Green", "Red", "Purple", "Yellow", "Cyan", "Blue"]
# discordTS is only present if enabled when creating the Ephemeris instance
```
The calculated moon phases are stored in the `Ephemeris.moonCyclesCache` property which is formatted as follows
```python
[
(
currentTime,
{
"phase": phase,
"discordTS": f"<t:{int(np.floor(currentTime/1000))}:D> <t:{int(np.floor(currentTime/1000))}:t>",
},
),
...
]
# Possible phases: ["new", "waxing_crescent", "first_quarter", "waxing_gibbous", "full", "waning_gibbous", "third_quarter", "waning_crescent"]
# discordTS is only present if enabled when creating the Ephemeris instance
```
#### Gathering your own variables
If you do not already have a moderate understanding of how Aberoth events happen, it would be helpful to read the wiki page on the [Aberoth solar system](https://bookofaberoth.fandom.com/wiki/Solar_System).
Most variables are close to the real-life [values provided by NASA](https://nssdc.gsfc.nasa.gov/planetary/factsheet/) but not exact. These make a good starting point for calibrating variables. Conversely, you could also gather experimental data from the Aberoth orb room as well as some reference points using the [Ephemeris Overheard Hook](https://github.com/aberoth-community/ephemeris-overheard-hook/tree/main) or something similar. Some notes on how to do this with experimental data can be found [here](https://docs.google.com/document/d/1Zm3-20HE9L-DPRuTaEgN9hdeDa8B2-0iSYuh6M82Rs8/edit?usp=sharing). When it comes to refining/calibrating these variables, it is important to create a system that can tell you how a change affects the whole system, not just the specific alignment event you're looking at. [Here is an example spreadsheet](https://docs.google.com/spreadsheets/d/1QrP-_moAXsK96srTq3BXStWcX4WGAzbLB_idEUgXuy4/edit?usp=sharing) that shows how you might set up such a system. To help better your understanding of this spreadsheet, it would still be useful to read the notes on [gathering the variables with experimental data](https://docs.google.com/document/d/1Zm3-20HE9L-DPRuTaEgN9hdeDa8B2-0iSYuh6M82Rs8/edit?usp=sharing) as it covers some of the more in-depth details on how the solar system works that aren't mentioned elsewhere.
Raw data
{
"_id": null,
"home_page": "https://github.com/jvandag/aberoth-ephemeris",
"name": "aberoth-ephemeris",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "aberoth, solar system, orbs, ephemeris",
"author": "Jeremiah Vandagrift",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/82/fc/fa866fbb5f3782bb203d65bda7b6bd07fa18113f707cea12bb3dd41519ca/aberoth-ephemeris-1.0.2.tar.gz",
"platform": null,
"description": "<div style=\"user-select: none;\" align=\"center\">\r\n \r\n\r\n \r\n</div>\r\n\r\n<h1 align=\"center\">Aberoth Ephemeris</h1>\r\n\r\n<p>A Python module that provides information about upcoming scroll events and moon phases in the MMORPG <a href=\"https://www.aberoth.com\" target=\"_blank\">Aberoth</a>. If you're looking for an easy way to get the predictions from this module in a more human readable form without creating having to your own application, check out the <a href=\"https://github.com/aberoth-community/ephemeris-discord-bot\" target=\"_blank\">Ephemeris Discord Bot</a>.</p>\r\n\r\n#### Installing\r\nThe module can be downloaded from PyPI using\r\n\r\n```bash\r\npip install aberoth-ephemeris\r\n```\r\nor you can download [the latest release](https://github.com/jvandag/aberoth-ephemeris/releases) from GitHub\r\n#### Use Example\r\nOnce you've installed the module, it can be used like so\r\n```python\r\nfrom aberoth_ephemeris import Ephemeris\r\nimport time\r\n\r\n# number of milliseconds in a day\r\nms_1day = 86400000\r\n# four days before the current time\r\nstartTime = round((time.time() * 1000) + -4 * ms_1day)\r\n# 35 days after the current time\r\nendTime = round((time.time() * 1000) + 35 * ms_1day)\r\n\r\nephemeris = Ephemeris(\r\n # the epoch time in ms that prediction calculations will start from\r\n start=round((time.time() * 1000) + -4 * 86400000),\r\n # the epoch time in ms that scroll prediction calculations will stop at\r\n end=round((time.time() * 1000) + 35 * 86400000),\r\n # the number of cycles into the future that the moon phases are calculated for\r\n numMoonCycles=8, \r\n # adds discord timestamp to ephemeris event information if True\r\n discordTimestamps=False,\r\n # indicates that calculations should be split between multiple processes/cores\r\n multiProcess=True,\r\n # indicates number of cores to use, automatically uses all cores if None\r\n numCores = None,\r\n # None indicates that the built in orb variables should be used\r\n varFile = None\r\n )\r\n```\r\nThe start and stop times are just examples and any time may be used so long as the start time is before the stop time.\r\n\r\nBy default, built in orb variables are used for predictions. If you wish to use your own variables you can pass the path to your own variables file into varFile as a string. See the [gathering your own variables](#gathering-your-own-variables) section for details on how you might gather your own variables.\r\n\r\nOptionally, a web server may be run to intake auto-calibration data from a separate script. To do so, run the following code on a separate thread or process\r\n\r\n```python\r\nfrom waitress import serve\r\nfrom aberoth_ephemeris import app\r\n\r\n# serve on separate thread or process\r\nserve(app, host=\"0.0.0.0\", port=5000, threads=1)\r\n```\r\nWhen valid calibration data is received over HTTP request, the variables used to predict alignments are updated and used the next time an ephemeris object is created or the ephemeris event cache is recreated.\r\n\r\nMake sure to configure a .env file containing a pass key named `UPDATE_KEY` for the http server request. \r\nExample .env\r\n```\r\nUPDATE_KEY={verification key for HTTP server}\r\n```\r\n\r\nAn excellent separate script that can be used to gather and send live calibration data to this module is the [Ephemeris Overheard Hook](https://github.com/aberoth-community/ephemeris-overheard-hook/tree/main) made by GitHub user [jvandag](https://github.com/jvandag). It is built on GitHub user [ashnel3's](https://github.com/ashnel3) [Overheard Scraper](https://github.com/aberoth-community/overheard) which scrapes the [Aberoth overheard page](https://aberoth.com/highscore/overheard.html) to find changes in scroll state, moon phase, time of day, and number of players online.\r\n\r\nFor formatting of this HTTP message refer to this [example fetch request](https://github.com/jvandag/aberoth-ephemeris/blob/main/aberoth_ephemeris/UpdateWebServer/exampleCalibrationMsg.js).\r\n\r\n#### Event Structure\r\nThe calculated scroll events are stored in the `Ephemeris.scrollEventsCache` property which is formatted as follows\r\n```python\r\n[\r\n (\r\n timestamp,\r\n {\r\n \"newGlows\": glowList, # list of orb names\r\n \"newDarks\": darkList, # list of orb names\r\n \"returnedToNormal\": returnedToNormal, # list of orb names\r\n \"discordTS\": f\"<t:{int(np.floor(timestamp/1000))}:D> <t:{int(np.floor(timestamp/1000))}:T>\"\r\n }\r\n ),\r\n ...\r\n]\r\n\r\n# Possible orb names: [\"Shadow\", \"White\", \"Black\", \"Green\", \"Red\", \"Purple\", \"Yellow\", \"Cyan\", \"Blue\"]\r\n# discordTS is only present if enabled when creating the Ephemeris instance\r\n```\r\n\r\nThe calculated moon phases are stored in the `Ephemeris.moonCyclesCache` property which is formatted as follows\r\n\r\n```python\r\n[\r\n (\r\n currentTime,\r\n {\r\n \"phase\": phase,\r\n \"discordTS\": f\"<t:{int(np.floor(currentTime/1000))}:D> <t:{int(np.floor(currentTime/1000))}:t>\",\r\n },\r\n ),\r\n ...\r\n]\r\n\r\n# Possible phases: [\"new\", \"waxing_crescent\", \"first_quarter\", \"waxing_gibbous\", \"full\", \"waning_gibbous\", \"third_quarter\", \"waning_crescent\"]\r\n# discordTS is only present if enabled when creating the Ephemeris instance\r\n```\r\n\r\n#### Gathering your own variables\r\nIf you do not already have a moderate understanding of how Aberoth events happen, it would be helpful to read the wiki page on the [Aberoth solar system](https://bookofaberoth.fandom.com/wiki/Solar_System).\r\n\r\n Most variables are close to the real-life [values provided by NASA](https://nssdc.gsfc.nasa.gov/planetary/factsheet/) but not exact. These make a good starting point for calibrating variables. Conversely, you could also gather experimental data from the Aberoth orb room as well as some reference points using the [Ephemeris Overheard Hook](https://github.com/aberoth-community/ephemeris-overheard-hook/tree/main) or something similar. Some notes on how to do this with experimental data can be found [here](https://docs.google.com/document/d/1Zm3-20HE9L-DPRuTaEgN9hdeDa8B2-0iSYuh6M82Rs8/edit?usp=sharing). When it comes to refining/calibrating these variables, it is important to create a system that can tell you how a change affects the whole system, not just the specific alignment event you're looking at. [Here is an example spreadsheet](https://docs.google.com/spreadsheets/d/1QrP-_moAXsK96srTq3BXStWcX4WGAzbLB_idEUgXuy4/edit?usp=sharing) that shows how you might set up such a system. To help better your understanding of this spreadsheet, it would still be useful to read the notes on [gathering the variables with experimental data](https://docs.google.com/document/d/1Zm3-20HE9L-DPRuTaEgN9hdeDa8B2-0iSYuh6M82Rs8/edit?usp=sharing) as it covers some of the more in-depth details on how the solar system works that aren't mentioned elsewhere.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Provides predictions for scroll and lunar events in the MMO Aberoth",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/jvandag/aberoth-ephemeris"
},
"split_keywords": [
"aberoth",
" solar system",
" orbs",
" ephemeris"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e46eb46c0921b5ee85868dded47998ca0f4951cad9cc0ee7053f1969b4fcb1c",
"md5": "153735d12611a37ae9936facb023ca45",
"sha256": "a101155123973dee6b758df79f5d28c424a46ea495ee00a551d2b0f94e5c06b8"
},
"downloads": -1,
"filename": "aberoth_ephemeris-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "153735d12611a37ae9936facb023ca45",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20260,
"upload_time": "2024-10-07T07:58:18",
"upload_time_iso_8601": "2024-10-07T07:58:18.896798Z",
"url": "https://files.pythonhosted.org/packages/9e/46/eb46c0921b5ee85868dded47998ca0f4951cad9cc0ee7053f1969b4fcb1c/aberoth_ephemeris-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "82fcfa866fbb5f3782bb203d65bda7b6bd07fa18113f707cea12bb3dd41519ca",
"md5": "360544484bd66b16c33175455dad95f8",
"sha256": "c466ff1f82dad02e4bc150ec63dd23b24f5d12c852722a482fa2fd4a1246d851"
},
"downloads": -1,
"filename": "aberoth-ephemeris-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "360544484bd66b16c33175455dad95f8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 21135,
"upload_time": "2024-10-07T07:58:20",
"upload_time_iso_8601": "2024-10-07T07:58:20.489601Z",
"url": "https://files.pythonhosted.org/packages/82/fc/fa866fbb5f3782bb203d65bda7b6bd07fa18113f707cea12bb3dd41519ca/aberoth-ephemeris-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-07 07:58:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jvandag",
"github_project": "aberoth-ephemeris",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aberoth-ephemeris"
}