Metadata-Version: 2.1
Name: infinite-craft
Version: 1.1.4
Summary: An API Wrapper of Neal's Infinite Craft game in Python for people to implement in their programs.
Author: sqdnoises
License: MIT License
        
        Copyright (c) 2024-present SqdNoises, Neal Agarwal
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/sqdnoises/infinite-craft
Project-URL: Discord, https://discord.gg/9BhN3BrE6n
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp
Requires-Dist: fastapi
Requires-Dist: uvicorn
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: pip-tools; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

[![](https://github.com/sqdnoises/infinite-craft/raw/main/docs/.gitbook/assets/cover.png)](https://github.com/sqdnoises/infinite-craft)

# infinite-craft `1.1.4`
[![](https://img.shields.io/badge/infinite--craft_version-1.1.4-red)](https://github.com/sqdnoises/infinite-craft)
[![](https://img.shields.io/pypi/v/infinite-craft.svg)](https://pypi.org/project/infinite-craft/)
[![](https://img.shields.io/pypi/dm/infinite-craft.svg)](https://pypi.org/project/infinite-craft/)
[![](https://img.shields.io/badge/License-MIT-red?labelColor=black)](LICENSE)
[![](https://img.shields.io/badge/Python_Version-3.10_|_3.11_|_3.12-blue)](https://python.org)
\
An API Wrapper of Neal's Infinite Craft game in Python for people to implement in their programs.

### `infinite-craft`'s GitHub Actions Status
[![](https://github.com/sqdnoises/infinite-craft/actions/workflows/pytest.yml/badge.svg)](https://github.com/sqdnoises/infinite-craft/actions/workflows/pytest.yml)
[![](https://github.com/sqdnoises/infinite-craft/actions/workflows/publish-package-to-pypi.yml/badge.svg)](https://github.com/sqdnoises/infinite-craft/actions/workflows/publish-package-to-pypi.yml)

# Key Features:
- Stores elements in a neatly indented JSON file
- Starts with the four main elements: Water, Fire, Wind, Earth
- Uses [`neal.fun`](https://neal.fun/)'s [Infinite Craft](https://neal.fun/infinite-craft/) API to pair elements together
- Built-in ratelimiting handler
- Custom API support
- Asynchronous library
- Conveniently access discovered elements

# Discord Server
Need help? Join our community!\
-> https://discord.gg/FF2fSN2sJd

# Table of Contents:
- **[Key Features](#key-features)**
- **[Discord Server](#discord-server)**
- **[Installation](#installation)**
- **[Examples](#examples)**
- **[Documentation](#documentation-)**
- **[How does it work?](#how-does-it-work)**
- **[To-do](#to-do)**
- **[License](#license)**

# Installation
Requires **Python 3.10** or above.\
To install, run:
```
pip install infinite-craft
```

To update, run:
```
pip install -U infinite-craft
```

**NOTE:** If `pip` is not on PATH, you can use:
- `python3 -m pip` (for Linux/MacOS) or
- `python -m pip` (for Windows) instead.

[**View `infinite-craft` on PyPI.**](https://pypi.org/project/infinite-craft/)

# Examples
### Using `async with`
```py
import asyncio
from infinitecraft import InfiniteCraft

async def main():
    async with InfiniteCraft() as game: # automatically start session and end session on async with end
        print(f"Pairing elements: {game.discoveries[0]} and {game.discoveries[1]}")
        result = await game.pair(game.discoveries[0], game.discoveries[1]) # Pair Water and Fire
        print(f"Result: {result}")

asyncio.run(main())
```

### Manually controlling
```py
import asyncio
from infinitecraft import InfiniteCraft

game = InfiniteCraft()

async def main():
    await game.start() # Start InfiniteCraft Session
    
    print(f"Pairing elements: {game.discoveries[0]} and {game.discoveries[1]}")
    result = await game.pair(game.discoveries[0], game.discoveries[1]) # Pair Water and Fire
    print(f"Result: {result}")

    await game.close() # Close InfiniteCraft Session

asyncio.run(main())
```

You can find more examples in the **[documentation](#documentation-)**.

# Documentation 📚
Documentation is *coming soon™️*

While the documentation is not ready, everything is documented well in the code with docstrings which you can see in an IDE like Visual Studio Code.

*You can also see the in-development documentation page [here](https://sqdnoises.gitbook.io/infinite-craft).*

# How does it work?
This library basically contacts the URL:
https://neal.fun/api/infinite-craft/pair?first=element+name&second=element+name \
Tricks it with some headers, and handles everything accordingly.

Everything is handled in a user-friendly manner and asynchronously, so it should be really easy to use it in your programs.

# To-do
- [x] ~~Release version 1.0.0 on PyPI~~
- [x] ~~Make a discord server for support~~ Join our community! https://discord.gg/FF2fSN2sJd
- [x] ~~Add a runnable and configurable CLI mock API server~~
- [ ] Make docs
- [ ] Make a playable Infinite Craft CLI game (interactive, probably)

<div align="center">

# License
[![](https://img.shields.io/badge/LICENSE-MIT-red?style=for-the-badge&labelColor=black)](LICENSE)\
View the **[MIT License](LICENSE)** license that comes with this library.

</div>

---

<div align="center">

### 🌟 Please [star the repo](https://github.com/sqdnoises/infinite-craft/stargazers) and show some love 💖

</div>
