Skip to content

Commit

Permalink
Merge pull request #7 from peunsu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
peunsu authored Mar 5, 2024
2 parents 1a2fef2 + e32b067 commit 9c12a51
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

on: push

jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: ci-wheels-${{ strategy.job-index }}
path: ./dist/*.whl
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
release:
types: [published]

jobs:
deploy:
name: Build wheel
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ This is the example of the FTB snbt tag:

**This library is only for the FTB snbt tag**. If you are finding the snbt library for the "vanilla" snbt tag, use [nbtlib](https://github.com/vberlier/nbtlib) by [vberlier](https://github.com/vberlier).

## Installation
The package can be installed with ``pip``.
```bash
$ pip install ftb_snbt_lib
```

## Getting Started
* Import the library.
```python
Expand All @@ -29,7 +35,7 @@ This is the example of the FTB snbt tag:
>>> some_snbt = ftb_snbt_lib.load(open("tests/some_file.snbt", "r", encoding="utf-8"))
```
* The type of returned value is ``Compound``, a dictionary-like object.<br>
The ``Compound`` is containing values with **custom data types** provided by this library.
The ``Compound`` is containing values with **[tag data types](#data-types)** provided by this library.
```python
>>> type(some_snbt)
<class 'ftb_snbt.tag.Compound'>
Expand Down Expand Up @@ -63,7 +69,7 @@ Compound({'some_tag': String('some_value'), 'another_tag': Byte(1)})
```

* Edit the snbt tag. As its type is ``Compound``, it can be edited like a dictionary.<br>
The inserted or replace values should be any of **custom data types** provided by this library.
The inserted or replace values should be any of **[tag data types](#data-types)** provided by this library.
```python
>>> another_snbt["some_tag"] = ftb_snbt_lib.String("another_value")
```
Expand Down

0 comments on commit 9c12a51

Please sign in to comment.