Skip to main content

A python script to run SimulationCraft reports for World of Warcraft characters when their gear/stats/level/etc. changes.

Project description

AutoSimulationCraft

https://pypip.in/v/autosimulationcraft/badge.png https://pypip.in/d/autosimulationcraft/badge.png Code Health travis-ci for master branch coverage report for master branch Project Status: Active - The project has reached a stable, usable state and is being actively developed.

A python script to run SimulationCraft reports for World of Warcraft characters when their gear/stats/level/etc. changes.

What It Does

When run, the script will first read in its configuration file (see below).

For each character in the CHARACTERS dictionary, it will use the BattleNet API to request details about the character (currently: appearance, equipment, level, stats and talents) and cache this information locally (in the same directory as the configuration file). The first time a specific character is found in the configuration file, a simc report will be generated for the character, and emailed to a configurable (per-character) list of email addresses.

On subsequent runs, the script will compare BattleNet’s current information for the character with what the script saved to disk during its last run. If the information is the same, that character will be skipped. Otherwise, a report will be generated and sent via email (and also saved to disk).

This script is suitable for running via cron or another job scheduler (say, daily), and it will automatically run SimulationCraft and email the report whenever changes occur on the characters.

Status

I got this working for myself originally as a single self-contained script. The code - especially the tests - desperately need a refactor. If I keep using it, or anyone else starts using it, maybe I’ll try that.

Requirements

  • A working installation of SimulationCraft with (at least) the command line portion.

  • Python 2.7 - The upstream library that I chose to use for the BattleNet API only works with python2. As is the case with all of my current code, I target 2.7 through current (3.4) for development, as the effort to get code that also works with horribly ancient 2.6 isn’t worth it. I’ve cut a branch to start work on solving this problem. Until then, 2.7 is it. Sorry.

  • Python VirtualEnv and pip (recommended installation method; your OS/distribution should have packages for these)

Installation

It’s recommended that you install into a virtual environment (virtualenv / venv). See the virtualenv usage documentation for information on how to create a venv. If you really want to install system-wide, you can (using sudo).

pip install autosimulationcraft

Configuration

Running

autosimc --genconfig

Will generate a default configuration file at ~/.autosimulationcraft/settings.py. Open this with your favorite text editor; the comments should be enough to help you configure it.

Usage

I’d recommend calling autosimc from cron, or some other method of running it automatically on a regular basis. If you want to, you can run it manually.

Bugs and Feature Requests

Bug reports and feature requests are happily accepted via the GitHub Issue Tracker. Pull requests are welcome. Issues that don’t have an accompanying pull request will be worked on as my time and priority allows.

Development

To install for development:

  1. Fork the autosimulationcraft repository on GitHub

  2. Create a new branch off of master in your fork.

$ virtualenv autosimulationcraft
$ cd autosimulationcraft && source bin/activate
$ pip install -e git+git@github.com:YOURNAME/autosimulationcraft.git@BRANCHNAME#egg=autosimulationcraft
$ cd src/autosimulationcraft

The git clone you’re now in will probably be checked out to a specific commit, so you may want to git checkout BRANCHNAME.

Guidelines

  • pep8 compliant with some exceptions (see pytest.ini)

  • 100% test coverage with pytest (with valid tests)

Testing

Testing is done via pytest, driven by tox.

  • testing is as simple as:

    • pip install tox

    • tox

  • If you want to see code coverage: tox -e cov

    • this produces two coverage reports - a summary on STDOUT and a full report in the htmlcov/ directory

  • If you want to pass additional arguments to pytest, add them to the tox command line after “–”. i.e., for verbose pytext output on py27 tests: tox -e py27 -- -v

Release Checklist

  1. Open an issue for the release; cut a branch off master for that issue.

  2. Confirm that there are CHANGES.rst entries for all major changes.

  3. Ensure that Travis tests passing in all environments.

  4. Ensure that test coverage is no less than the last release (ideally, 100%).

  5. Increment the version number in autosimulationcraft/version.py and add version and release date to CHANGES.rst, then push to GitHub.

  6. Confirm that README.rst renders correctly on GitHub.

  7. Upload package to testpypi, confirm that README.rst renders correctly.

    • Make sure your ~/.pypirc file is correct

    • python setup.py register -r https://testpypi.python.org/pypi

    • python setup.py sdist bdist_wheel upload -r https://testpypi.python.org/pypi

    • Check that the README renders at https://testpypi.python.org/pypi/autosimulationcraft

  8. Create a pull request for the release to be merge into master. Upon successful Travis build, merge it.

  9. Tag the release in Git, push tag to GitHub:

    • tag the release. for now the message is quite simple: git tag -a X.Y.Z -m 'X.Y.Z released YYYY-MM-DD'

    • push the tag to GitHub: git push origin X.Y.Z

  10. Upload package to live pypi:

    • python setup.py sdist bdist_wheel upload

  11. make sure any GH issues fixed in the release were closed.

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

autosimulationcraft-0.1.1.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

autosimulationcraft-0.1.1-py2-none-any.whl (36.7 kB view details)

Uploaded Python 2

File details

Details for the file autosimulationcraft-0.1.1.tar.gz.

File metadata

File hashes

Hashes for autosimulationcraft-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c6786cb088809157edf915824e5105987666a77f0d1cc72894a01894d73f1ea
MD5 791f43787ad320222f08eb554b90667a
BLAKE2b-256 08923683509e84dc2a69caadeb54be3b156af660741cf03aa67af1234b630c49

See more details on using hashes here.

File details

Details for the file autosimulationcraft-0.1.1-py2-none-any.whl.

File metadata

File hashes

Hashes for autosimulationcraft-0.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 ff823f1ad2ec2566c70eb9721d6b5ab75f1e3e2e57fbbf1f046bc0ae5a24f3a2
MD5 395caba3c56fe50c45dba89f911913b5
BLAKE2b-256 b872c1760730b2687579931910f7b9cf35ef0c089d2d62f97fae7d2155b5b2a3

See more details on using hashes here.

Supported by

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