Skip to main content

EcoNuker

EcoNuker is a Python library for interacting with the EcoNuker API, which provides routes for items, servers, and more!

The base URLs are: https://econuker.xyz/api and https://beta.econuker.xyz/api (beta version)

PyPi: https://pypi.org/project/econuker/

Installation

You can install the EcoNuker-API library using pip:

pip install econuker

Usage

Initialize a Client or AsyncClient class. Make sure to pass auth_token and beta if needed.

You can now use the client to make requests.

Example

# Python Example
from econuker import Client
beta = True # False
authtoken = None # "your auth token here"

if __name__ == "__main__":
    client = Client(auth_token=authtoken, beta=beta)
    status = client.status()
    print(status.name)

Async Example

# Python Async Example
from econuker import AsyncClient
beta = True # False
authtoken = None # "your auth token here"

if __name__ == "__main__":
    client = AsyncClient(auth_token=authtoken, beta=beta)
    async def asyncfunction():
        status = await client.status()
        print(status.name)
        return status
    asyncio.run(asyncfunction())

Downtime Notifier Example

# Python Downtime Notifier Example
import econuker
from econuker import AsyncClient
beta = True # get notified about downtime of our Beta bot.
authtoken = None

down = False

import guilded # pip install guilded.py
import asyncio
client = guilded.Client()
channelid = "" # the channel you want downtime notifications to be sent to! Make sure your bot has permissions.

async def monitorbot(client:AsyncClient):
    global down
    bot_name = await client.status().name
    while True:
        check = await client.ping()
        if not check:
            if not down:
                channel = await bot.fetch_channel(channelid)
                await channel.send(f'{bot_name} is down!')
                down = True
        if check and down:
            down = False
            channel = await bot.fetch_channel(channelid)
            await channel.send(f'{bot_name} is online!')
        await asyncio.sleep(10)

@bot.event
async def on_ready():
    print(f'Ready! Logged in as {bot.user.name}')
    try:
        client
    except:
        client = AsyncClient(beta=beta, auth_token=authtoken)
        bot.loop.create_task(monitorbot(client))

bot.run('guilded bot token here')

Documentation

For detailed documentation on the EcoNuker API, read https://docs.econuker.xyz/

For detailed documentation on how to use the EcoNuker-API library, please wait while we write it lol.

Methods

A list of methods you can call with either Client or AsyncClient.

  • .status() (class StatusData)
    • .name (string)
    • .status (string)
    • .servers (integer)
    • .latency (float)
    • ._raw (dict)
  • .ping() (bool)
  • .verify(auth_token) (Union(class Token, False))
    • .authtoken (string)
    • .authlevel (string)
    • ._raw (dict)
  • .fetch_servers() (class ServersResult)
    • .count (integer)
    • .server_ids (list)
    • ._raw (dict)
  • .fetch_server(id) (class ServerResult)
    • .name (string)
    • .id (string)
    • .owner (class Owner)
      • .name (string)
      • .id (string)
      • .nick (Union(string, None))
      • .profile (string)
      • ._raw (dict)
    • .url (Union(string, None))
    • .verified (bool)
    • .created_at (integer)
    • .timezone (string)
    • .slug (Union(string, None))
    • .about (Union(string, None))
    • ._raw (dict)
  • .fetch_items(hidden=True) (class ItemsResult)
    • ._raw (dict)
  • .fetch_item(id, name) (class ItemResult)
    • .id (string)
    • .name (string)
    • .rarity (string)
    • .description (string)
    • .desc (string)
    • .aliases (list)
    • .price (class ItemPrice)
      • .sell (str)
      • .buy (str)
      • .worth (str)
      • ._raw (dict)
      • ._price_parts (list) ([sell, buy])
    • ._raw (dict)
    • ._data (list)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Release files for econuker 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for econuker 1.0.9
File Size Uploaded
econuker-1.0.9.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for econuker 1.0.9
File Interpreter ABI Platform
econuker-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / econuker-1.0.9.tar.gz

Download URL econuker-1.0.9.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
50eae9180cb62da98f47bbc1147e6245c2d2bc4e2354aedb6a809a30b93615e8
BLAKE2b-256 checksum
How to use checksums
1796efc8a457bb0eab577fbf6b33fce770c145f4b95111a41db799348b075872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / econuker-1.0.9-py3-none-any.whl

Download URL econuker-1.0.9-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0daec2419672b5a3006394a87477b3f67171c3fce4faead5118de55d421ac877
BLAKE2b-256 checksum
How to use checksums
1610af5b0e7f564394c9157bd94415b2e244a9a764d126c902abd00e91f30d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page