chyllonge


Namechyllonge JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
SummaryA Python 3.8+ implementation of the challonge.com API.
upload_time2024-05-08 16:33:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords challonge
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # chyllonge

A Python 3.8+ implementation of [the challonge.com API](https://api.challonge.com/v1).

## Prerequisites

`chyllonge` requires that the `CHALLONGE_KEY` and `CHALLONGE_USER` environment variables are set.

* `CHALLONGE_USER` is your `challonge.com` username.
* `CHALLONGE_KEY` is your `challonge.com` API key.  An API key can be generated [here](https://challonge.com/settings/developer).

`chyllonge` also allows a `CHALLONGE_IANA_TZ_NAME` environment variable, which accepts an 
[IANA-compliant time zone name](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab) - for 
example: `Europe/Berlin`.

## Installation

To install `chyllonge`, execute `pip install chyllonge`.

## Usage

Detailed API documentation is available at https://api.challonge.com/v1.

```python
from chyllonge.api import ChallongeAPI
from datetime import datetime, timedelta

api = ChallongeAPI()

# create a basic tournament
tournament = api.tournaments.create(name="My Chyllonge Tournament")
print(tournament["id"])

# create a tournament that starts in an hour
an_hour_from_now = (datetime.now() + timedelta(hours=1)).isoformat() + api.http.tz_utc_offset_string
tournament = api.tournaments.create(name="My Chyllonge Tournament", start_at=an_hour_from_now, check_in_duration=60)
print(tournament["id"])

# create a tournament, add Alice and Bob, process their check-ins, start the tournment, set their match underway,
# score their match (congratulations Alice!), finalize the tournament
an_hour_from_now = (datetime.now() + timedelta(hours=1)).isoformat() + api.http.tz_utc_offset_string
tournament = api.tournaments.create(name="Alice and Bob Play Bingo", start_at=an_hour_from_now, check_in_duration=60)

api.participants.add(tournament["id"], name="Alice")
api.participants.add(tournament["id"], name="Bob")

api.tournaments.process_checkins(tournament["id"])
api.tournaments.start(tournament["id"])

match = api.matches.get_all(tournament_id=tournament["id"])[0]
alice = api.participants.get_all(tournament["id"])[0]

api.matches.set_underway(tournament["id"], match["id"])
api.matches.update(tournament["id"], match["id"], match_scores_csv="3-1,2-2", match_winner_id=alice["id"])

api.tournaments.finalize(tournament["id"])

finished_tournment = api.tournaments.get(tournament["id"])
```

## History

`chyllonge` was inspired by `pychallonge` - developed by Russ Amos - which (in turn) includes `pychal`. 

See `CONTRIBUTORS.txt` for the original authors.

## Testing

To run local tests, run `python -m unittest tests/tests.py`.

Note that the unit tests will create tournaments in your account, called `chyllonge-temp`.  It will try to delete them 
afterward, but automated cleanup is not always guaranteed.

## Contributing

Please feel free to contribute, and to suggest updates to these contribution guidelines!

The current guidelines are:

* Functions should be documented in-line using `reStructuredText` format.
* Support for older Python versions should be dropped as those minor updates approach end-of-life.
* There are no plans to support XML for the time being (although this is a nice-to-have).

## Building

`chyllonge` is built using [`flit`](https://flit.pypa.io/en/stable/) and [`build`](https://build.pypa.io/en/stable/).

## Releases

New versions of `chyllonge` are released to PyPI with the help of a GitHub Action workflow, which:

1. Updates the `pyproject.toml` version
2. Creates a GitHub release
3. Invokes `build`, which publishes to PyPI

### Non-frequently Asked Questions

**Q: How do you pronounce `chyllonge`?**

**A:** Like "chill-ahnge".


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "chyllonge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Alex Fredrickson <alex.q.fredrickson@gmail.com>",
    "keywords": "challonge",
    "author": null,
    "author_email": "Alex Fredrickson <alex.q.fredrickson@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1a/3a/65077553c72fa01062e26dd7dd0ee219311111bfce4651cbeac48be15e3e/chyllonge-1.1.1.tar.gz",
    "platform": null,
    "description": "# chyllonge\n\nA Python 3.8+ implementation of [the challonge.com API](https://api.challonge.com/v1).\n\n## Prerequisites\n\n`chyllonge` requires that the `CHALLONGE_KEY` and `CHALLONGE_USER` environment variables are set.\n\n* `CHALLONGE_USER` is your `challonge.com` username.\n* `CHALLONGE_KEY` is your `challonge.com` API key.  An API key can be generated [here](https://challonge.com/settings/developer).\n\n`chyllonge` also allows a `CHALLONGE_IANA_TZ_NAME` environment variable, which accepts an \n[IANA-compliant time zone name](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab) - for \nexample: `Europe/Berlin`.\n\n## Installation\n\nTo install `chyllonge`, execute `pip install chyllonge`.\n\n## Usage\n\nDetailed API documentation is available at https://api.challonge.com/v1.\n\n```python\nfrom chyllonge.api import ChallongeAPI\nfrom datetime import datetime, timedelta\n\napi = ChallongeAPI()\n\n# create a basic tournament\ntournament = api.tournaments.create(name=\"My Chyllonge Tournament\")\nprint(tournament[\"id\"])\n\n# create a tournament that starts in an hour\nan_hour_from_now = (datetime.now() + timedelta(hours=1)).isoformat() + api.http.tz_utc_offset_string\ntournament = api.tournaments.create(name=\"My Chyllonge Tournament\", start_at=an_hour_from_now, check_in_duration=60)\nprint(tournament[\"id\"])\n\n# create a tournament, add Alice and Bob, process their check-ins, start the tournment, set their match underway,\n# score their match (congratulations Alice!), finalize the tournament\nan_hour_from_now = (datetime.now() + timedelta(hours=1)).isoformat() + api.http.tz_utc_offset_string\ntournament = api.tournaments.create(name=\"Alice and Bob Play Bingo\", start_at=an_hour_from_now, check_in_duration=60)\n\napi.participants.add(tournament[\"id\"], name=\"Alice\")\napi.participants.add(tournament[\"id\"], name=\"Bob\")\n\napi.tournaments.process_checkins(tournament[\"id\"])\napi.tournaments.start(tournament[\"id\"])\n\nmatch = api.matches.get_all(tournament_id=tournament[\"id\"])[0]\nalice = api.participants.get_all(tournament[\"id\"])[0]\n\napi.matches.set_underway(tournament[\"id\"], match[\"id\"])\napi.matches.update(tournament[\"id\"], match[\"id\"], match_scores_csv=\"3-1,2-2\", match_winner_id=alice[\"id\"])\n\napi.tournaments.finalize(tournament[\"id\"])\n\nfinished_tournment = api.tournaments.get(tournament[\"id\"])\n```\n\n## History\n\n`chyllonge` was inspired by `pychallonge` - developed by Russ Amos - which (in turn) includes `pychal`. \n\nSee `CONTRIBUTORS.txt` for the original authors.\n\n## Testing\n\nTo run local tests, run `python -m unittest tests/tests.py`.\n\nNote that the unit tests will create tournaments in your account, called `chyllonge-temp`.  It will try to delete them \nafterward, but automated cleanup is not always guaranteed.\n\n## Contributing\n\nPlease feel free to contribute, and to suggest updates to these contribution guidelines!\n\nThe current guidelines are:\n\n* Functions should be documented in-line using `reStructuredText` format.\n* Support for older Python versions should be dropped as those minor updates approach end-of-life.\n* There are no plans to support XML for the time being (although this is a nice-to-have).\n\n## Building\n\n`chyllonge` is built using [`flit`](https://flit.pypa.io/en/stable/) and [`build`](https://build.pypa.io/en/stable/).\n\n## Releases\n\nNew versions of `chyllonge` are released to PyPI with the help of a GitHub Action workflow, which:\n\n1. Updates the `pyproject.toml` version\n2. Creates a GitHub release\n3. Invokes `build`, which publishes to PyPI\n\n### Non-frequently Asked Questions\n\n**Q: How do you pronounce `chyllonge`?**\n\n**A:** Like \"chill-ahnge\".\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python 3.8+ implementation of the challonge.com API.",
    "version": "1.1.1",
    "project_urls": {
        "Bug Tracker": "https://www.github.com/alexqfredrickson/chyllonge/issues",
        "Homepage": "https://www.github.com/alexqfredrickson/chyllonge",
        "Repository": "https://www.github.com/alexqfredrickson/chyllonge"
    },
    "split_keywords": [
        "challonge"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7eb8da246ad58658db3571a10a29ee33d7ae965fd736957ad02ae4bb80614241",
                "md5": "94f08b7fc70b76f032abe94377d0d493",
                "sha256": "bc1d01bc084cbb2a66194f7d663fea54c03eaafe5865fab6924afb6327e95d77"
            },
            "downloads": -1,
            "filename": "chyllonge-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "94f08b7fc70b76f032abe94377d0d493",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10405,
            "upload_time": "2024-05-08T16:33:45",
            "upload_time_iso_8601": "2024-05-08T16:33:45.759515Z",
            "url": "https://files.pythonhosted.org/packages/7e/b8/da246ad58658db3571a10a29ee33d7ae965fd736957ad02ae4bb80614241/chyllonge-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a3a65077553c72fa01062e26dd7dd0ee219311111bfce4651cbeac48be15e3e",
                "md5": "6f6059def817c36a2a3d97dcb8fea5ec",
                "sha256": "c51a58bce813c92536253dd0dd566783b89a5c566276c700631cf06a99e13464"
            },
            "downloads": -1,
            "filename": "chyllonge-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6f6059def817c36a2a3d97dcb8fea5ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11270,
            "upload_time": "2024-05-08T16:33:47",
            "upload_time_iso_8601": "2024-05-08T16:33:47.288384Z",
            "url": "https://files.pythonhosted.org/packages/1a/3a/65077553c72fa01062e26dd7dd0ee219311111bfce4651cbeac48be15e3e/chyllonge-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 16:33:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexqfredrickson",
    "github_project": "chyllonge",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "chyllonge"
}
        
Elapsed time: 0.22593s