Skip to main content

ESI celery task queues for distributed API access using RabbitMQ and Redis.

Project description

ESICelery

ESI API requests library using RabbitMQ, celery tasks queues, and Redis caching.

Installation

pip install ESICelery

Usage

Starting the Celery worker server

From CLI

Set the following environmental variables and then run ESICelery from the CLI. Variables: BrokerUser, BrokerPassword, BrokerHost, BrokerPort, BrokerVhost, ResultBackendUser, ResultBackendPassword, ResultBackendHost, ResultBackendPort, ResultBackendDb

python ESICelery

From your code

From your worker code start the Celery worker server that handles running tasks:

from ESICelery.CeleryApps import CeleryWorker

c = CeleryWorker(broker_user="user", broker_password="pass", broker_host="host", broker_port=5672, broker_vhost="esi",
                 result_user="user", result_password="pass", result_host="host", result_port=6379, result_db=0,
                 header_email="youremail@example.com")

c.start(
    max_concurrency=10)  # Start celery app - equivalent to running "celery worker -l WARNING --autoscale 10,1 -Q queues"

Using ESICelery in your code

From another Python script you can send tasks to the queues and receive results:

from ESICelery.CeleryApps import CeleryWorker
from ESICelery.tasks.Universe import *

c = CeleryWorker(broker_user="user", broker_password="pass", broker_host="host", broker_port=5672, broker_vhost="esi",
                 result_user="user", result_password="pass", result_host="host", result_port=6379, result_db=0,
                 header_email="youremail@example.com")  # only need to call this once in our code to init the tasks
r = SystemInfo().get_sync(timeout=5, system_id=30000142)
print(r)

Current supported endpoints

ESI Route ESICelery Task
/alliances/{alliance_id}/ AllianceInfo()
/characters/{character_id}/ CharacterPublicInfo()
/corporations/{corporation_id}/ CorporationInfo()
/markets/prices/ PricesList()
/universe/categories/{category_id}/ CategoryInfo()
/universe/constellations/{constellation_id}/ ConstellationInfo()
/universe/factions/ FactionsList()
/universe/groups/{group_id}/ GroupInfo()
/universe/regions/{region_id}/ RegionInfo()
/universe/systems/{system_id}/ SystemInfo()
/universe/types/{type_id}/ TypeInfo()

Examples

See the included example scripts under docs/examples

Copyright Notice

See CCP.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ESICelery-0.12.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ESICelery-0.12-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file ESICelery-0.12.tar.gz.

File metadata

  • Download URL: ESICelery-0.12.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ESICelery-0.12.tar.gz
Algorithm Hash digest
SHA256 5b5e08b132646c3b939c6d23044ec814ba30fb4c495294aa129846dbba0ddddd
MD5 7f45b92fc56897bae5c9c51e84335d48
BLAKE2b-256 ff0b2e54ab12d56250c80a6fba1f8f93f7ab8b5e2e8861873b1702b01a35be9e

See more details on using hashes here.

File details

Details for the file ESICelery-0.12-py3-none-any.whl.

File metadata

  • Download URL: ESICelery-0.12-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ESICelery-0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 24fe3d461cf7335e9cbf0648454a7c6528fab9c940258d54ba0ddc9da4fddd83
MD5 1afb66194a188cd777fb982efe250c6d
BLAKE2b-256 8430323fd8137e2a0c65aa72eb7fe0781447206112cfd0db03f39c94149f0374

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page