|
| 1 | +# CodeCombat Python Library |
| 2 | + |
| 3 | +[](https://pypi.python.org/pypi/codecombat) |
| 4 | +[](https://github.com/fern-api/fern) |
| 5 | + |
| 6 | +## Documentation |
| 7 | + |
| 8 | +API documentation is available at https://codecombat.com/api-docs. |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +Add this dependency to your project's build file: |
| 13 | + |
| 14 | +```bash |
| 15 | +pip install codecombat |
| 16 | +# or |
| 17 | +poetry add codecombat |
| 18 | +``` |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +```python |
| 23 | +from codecombat.client import CodeCombatApi |
| 24 | + |
| 25 | +client = CodeCombatApi( |
| 26 | + username="CLIENT_ID", password="CLIENT_SECRET") |
| 27 | + |
| 28 | +const response = client.users.set_ace_config( |
| 29 | + document_id="document_id", |
| 30 | + live_completion=True, |
| 31 | + language="python" |
| 32 | +); |
| 33 | + |
| 34 | +print('Received response from Code Combat', response); |
| 35 | +``` |
| 36 | + |
| 37 | +## Async client |
| 38 | + |
| 39 | +This SDK also includes an async client, which supports the `await` syntax: |
| 40 | + |
| 41 | +```python |
| 42 | +from codecombat.client import AsyncCodeCombatApi |
| 43 | + |
| 44 | +raven = AsyncRavenApi( |
| 45 | + username="CLIENT_ID", password="CLIENT_SECRET") |
| 46 | + |
| 47 | +async def set_ace_config() -> None: |
| 48 | + await client.users.set_ace_config( |
| 49 | + document_id="document_id", |
| 50 | + live_completion=True, |
| 51 | + language="python" |
| 52 | + ); |
| 53 | +``` |
| 54 | + |
| 55 | +## Beta status |
| 56 | + |
| 57 | +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your build.gradle file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version. |
| 58 | + |
| 59 | +## Contributing |
| 60 | + |
| 61 | +While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest [opening an issue](https://github.com/ravenappdev/raven-java) first to discuss with us! |
| 62 | + |
| 63 | +On the other hand, contributions to the README are always very welcome! |
0 commit comments