An API Wrapper for Neal's Infinite Craft game in Python.
Project description
infinite-craft
An API Wrapper for Neal's Infinite Craft game in Python.
infinite-craft's GitHub Actions Status
Key Features:
- Stores elements in a neatly indented JSON file
- Starts with the four main elements: Water, Fire, Wind, Earth
- Uses
neal.fun's Infinite Craft API to pair elements together - Built-in ratelimiting handler
- Custom API support
- Asynchronous library
- Conveniently access discovered elements
Discord Server
[!TIP] Need help? Join our Discord community!
» https://discord.gg/FF2fSN2sJd
Table of Contents:
Installation
[!IMPORTANT] Python 3.10 or above is required. Any versions below are not guaranteed to work.
To install or update, run:
pip install -U infinite-craft
[!NOTE] If
pipis not on PATH, you can use:
python3 -m pip(for Linux/MacOS) orpython -m pip(for Windows) instead.
Examples
Using async with
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
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 is still in development.
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.
How does it work?
This library contacts the URL:
https://neal.fun/api/infinite-craft/pair?first=Fire&second=Water
Where Fire in first= parameter is the first element you want to pair and the Water in second= parameter is the second element.
Everything is handled in a user-friendly manner and asynchronously, so it should be really easy to use it in your programs.
To-do
-
Release version 1.0.0 on PyPI -
Make a discord server for supportJoin our community! https://discord.gg/FF2fSN2sJd -
Add a runnable and configurable CLI mock API server -
Make a documentation page - Fix 403 Forbidden Error
- Finish todos in code
- Implement better documentation
- Make a playable & interactive Infinite Craft CLI game
License
Click MIT License to view the license that comes with this library.
🌟 Please star the repo and show some love 💖
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infinite_craft-1.2.2.tar.gz.
File metadata
- Download URL: infinite_craft-1.2.2.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc242c5c7603e60fafa2584db8d3716a30634aea5e12b2dffe4290d5b05f5892
|
|
| MD5 |
54c2e7ce26321375388df53be37d0af7
|
|
| BLAKE2b-256 |
2547adbb98a254d305df608341833053ab5ec5e9a0991d504a86bb17e46eabc6
|
Provenance
The following attestation bundles were made for infinite_craft-1.2.2.tar.gz:
Publisher:
publish-package-to-pypi.yml on sqdnoises/infinite-craft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infinite_craft-1.2.2.tar.gz -
Subject digest:
cc242c5c7603e60fafa2584db8d3716a30634aea5e12b2dffe4290d5b05f5892 - Sigstore transparency entry: 1078506582
- Sigstore integration time:
-
Permalink:
sqdnoises/infinite-craft@f85a756649190332f50f1a4d3a21ced76b3a8731 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sqdnoises
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package-to-pypi.yml@f85a756649190332f50f1a4d3a21ced76b3a8731 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file infinite_craft-1.2.2-py3-none-any.whl.
File metadata
- Download URL: infinite_craft-1.2.2-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c5d04d4215d397e55cb8cc4883725030acd32123c87c2be35d4a2ade74af067
|
|
| MD5 |
c8bbe8ec862dc6931a48d16712a7ea10
|
|
| BLAKE2b-256 |
a9fcfe1bc82affb017b11e506cff4423765c96d3f4850281551d02e453bdb451
|
Provenance
The following attestation bundles were made for infinite_craft-1.2.2-py3-none-any.whl:
Publisher:
publish-package-to-pypi.yml on sqdnoises/infinite-craft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infinite_craft-1.2.2-py3-none-any.whl -
Subject digest:
8c5d04d4215d397e55cb8cc4883725030acd32123c87c2be35d4a2ade74af067 - Sigstore transparency entry: 1078506596
- Sigstore integration time:
-
Permalink:
sqdnoises/infinite-craft@f85a756649190332f50f1a4d3a21ced76b3a8731 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sqdnoises
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package-to-pypi.yml@f85a756649190332f50f1a4d3a21ced76b3a8731 -
Trigger Event:
workflow_dispatch
-
Statement type: