lanpartydb


Namelanpartydb JSON
Version 0.9.2 PyPI version JSON
download
home_pageNone
SummaryPython library for the OrgaTalk LAN Party Database
upload_time2025-01-11 13:26:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT
keywords lanparty
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python library for the OrgaTalk LAN Party Database

This library provides

- party and party series models,
- functionality to deserialize parties and party series from TOML, and
- functionality to serialize parties (but not party series) to TOML

to work with data for and from the public [LAN party database by
OrgaTalk](https://lanpartydb.orgatalk.de/).

Data and code repositories for the project are available at:
https://github.com/lanpartydb


## Status

[![Test](https://github.com/lanpartydb/lib-python/actions/workflows/test.yml/badge.svg)](https://github.com/lanpartydb/lib-python/actions/workflows/test.yml)


## Installation

With pip:

```sh
$ pip install lanpartydb
```

Or with [uv](https://docs.astral.sh/uv/):

```sh
$ uv init
$ uv add lanpartydb
```


## Usage

To serialize a party with only the required attributes to TOML:

```py
from datetime import date

from lanpartydb.models import Party
from lanpartydb.writing import serialize_party

party = Party(
    slug='megalan-2023',
    title='MegaLAN 2023',
    start_on=date(2023, 11, 17),
    end_on=date(2023, 11, 19),
)

toml = serialize_party(party)

print(toml)
```

And to serialize a party with all available attributes to a TOML file:

```py
from datetime import date
from decimal import Decimal
from pathlib import Path

from lanpartydb.models import Links, Location, Party, Resource
from lanpartydb.writing import serialize_party

party = Party(
    slug='superlan-2024',
    title='SuperLAN 2024',
    series_slug='superlan',
    organizer_entity='SuperLAN Association',
    start_on=date(2024, 5, 24),
    end_on=date(2024, 5, 26),
    seats=420,
    attendees=397,
    online=False,
    location=Location(
        name='City Hall',
        country_code='us',
        city='Los Angeles',
        zip_code='90099',
        street='123 North Hill Street',
        latitude=Decimal('34.06101057935884'),
        longitude=Decimal('-118.23974355902666'),
    ),
    links=Links(
        website=Resource(
            url='https://www.superlan.example/',
            offline=False,
        ),
    ),
)

toml = serialize_party(party)

path = Path('./superlan-2024.toml')
path.write_text(toml)
```

Take a look at the code (in `src/`) and the tests (in `tests/`) to learn
more about the library's interface.


## License

MIT


## Author

Jochen Kupperschmidt

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lanpartydb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "lanparty",
    "author": null,
    "author_email": "Jochen Kupperschmidt <homework@nwsnet.de>",
    "download_url": "https://files.pythonhosted.org/packages/00/08/10b1e26cac7fadd6101c931e46dda7a1a909ced4732437b87c1cb830cd65/lanpartydb-0.9.2.tar.gz",
    "platform": null,
    "description": "# Python library for the OrgaTalk LAN Party Database\n\nThis library provides\n\n- party and party series models,\n- functionality to deserialize parties and party series from TOML, and\n- functionality to serialize parties (but not party series) to TOML\n\nto work with data for and from the public [LAN party database by\nOrgaTalk](https://lanpartydb.orgatalk.de/).\n\nData and code repositories for the project are available at:\nhttps://github.com/lanpartydb\n\n\n## Status\n\n[![Test](https://github.com/lanpartydb/lib-python/actions/workflows/test.yml/badge.svg)](https://github.com/lanpartydb/lib-python/actions/workflows/test.yml)\n\n\n## Installation\n\nWith pip:\n\n```sh\n$ pip install lanpartydb\n```\n\nOr with [uv](https://docs.astral.sh/uv/):\n\n```sh\n$ uv init\n$ uv add lanpartydb\n```\n\n\n## Usage\n\nTo serialize a party with only the required attributes to TOML:\n\n```py\nfrom datetime import date\n\nfrom lanpartydb.models import Party\nfrom lanpartydb.writing import serialize_party\n\nparty = Party(\n    slug='megalan-2023',\n    title='MegaLAN 2023',\n    start_on=date(2023, 11, 17),\n    end_on=date(2023, 11, 19),\n)\n\ntoml = serialize_party(party)\n\nprint(toml)\n```\n\nAnd to serialize a party with all available attributes to a TOML file:\n\n```py\nfrom datetime import date\nfrom decimal import Decimal\nfrom pathlib import Path\n\nfrom lanpartydb.models import Links, Location, Party, Resource\nfrom lanpartydb.writing import serialize_party\n\nparty = Party(\n    slug='superlan-2024',\n    title='SuperLAN 2024',\n    series_slug='superlan',\n    organizer_entity='SuperLAN Association',\n    start_on=date(2024, 5, 24),\n    end_on=date(2024, 5, 26),\n    seats=420,\n    attendees=397,\n    online=False,\n    location=Location(\n        name='City Hall',\n        country_code='us',\n        city='Los Angeles',\n        zip_code='90099',\n        street='123 North Hill Street',\n        latitude=Decimal('34.06101057935884'),\n        longitude=Decimal('-118.23974355902666'),\n    ),\n    links=Links(\n        website=Resource(\n            url='https://www.superlan.example/',\n            offline=False,\n        ),\n    ),\n)\n\ntoml = serialize_party(party)\n\npath = Path('./superlan-2024.toml')\npath.write_text(toml)\n```\n\nTake a look at the code (in `src/`) and the tests (in `tests/`) to learn\nmore about the library's interface.\n\n\n## License\n\nMIT\n\n\n## Author\n\nJochen Kupperschmidt\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for the OrgaTalk LAN Party Database",
    "version": "0.9.2",
    "project_urls": {
        "Repository": "https://github.com/lanpartydb/lib-python"
    },
    "split_keywords": [
        "lanparty"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5a5369db74a4fe095b65e3c74bb463b0d0428d8226b429f5cd0dd53d96591e6c",
                "md5": "e8fe971c7ff5ecb5631b309fa472ab7d",
                "sha256": "3cbc55b39235bb1c9cc332953449fa0f77bdbc897eb9ed2d5de3a08e44bb22f1"
            },
            "downloads": -1,
            "filename": "lanpartydb-0.9.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8fe971c7ff5ecb5631b309fa472ab7d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 5223,
            "upload_time": "2025-01-11T13:26:15",
            "upload_time_iso_8601": "2025-01-11T13:26:15.377300Z",
            "url": "https://files.pythonhosted.org/packages/5a/53/69db74a4fe095b65e3c74bb463b0d0428d8226b429f5cd0dd53d96591e6c/lanpartydb-0.9.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "000810b1e26cac7fadd6101c931e46dda7a1a909ced4732437b87c1cb830cd65",
                "md5": "6191b2588121d75ad8d441b165c8aa96",
                "sha256": "c60d62605136fe9dd8dee0b121d1fdd78104c42aff24a957d6a1d05783445046"
            },
            "downloads": -1,
            "filename": "lanpartydb-0.9.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6191b2588121d75ad8d441b165c8aa96",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 9557,
            "upload_time": "2025-01-11T13:26:17",
            "upload_time_iso_8601": "2025-01-11T13:26:17.790516Z",
            "url": "https://files.pythonhosted.org/packages/00/08/10b1e26cac7fadd6101c931e46dda7a1a909ced4732437b87c1cb830cd65/lanpartydb-0.9.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-11 13:26:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lanpartydb",
    "github_project": "lib-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "lanpartydb"
}
        
Elapsed time: 0.43382s