Skip to main content

Python library for the OrgaTalk LAN Party Database

Project description

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 and party series to TOML

to work with data for and from the public LAN party database by OrgaTalk.

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

Status

Test

Installation

With pip:

$ pip install lanpartydb

Or with uv:

$ uv init
$ uv add lanpartydb

Usage

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

from datetime import date

from lanpartydb.models import Party
from lanpartydb.serialization import serialize_party_to_toml

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

toml = serialize_party_to_toml(party)

print(toml)

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

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

from lanpartydb.models import Location, Party, PartyLinks, Resource
from lanpartydb.serialization import serialize_party_to_toml

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',
        postal_code='90099',
        street='123 North Hill Street',
        latitude=Decimal('34.06101057935884'),
        longitude=Decimal('-118.23974355902666'),
    ),
    links=PartyLinks(
        website=Resource(
            url='https://www.superlan.example/',
            offline=False,
        ),
    ),
)

toml = serialize_party_to_toml(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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lanpartydb-0.12.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lanpartydb-0.12.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file lanpartydb-0.12.2.tar.gz.

File metadata

  • Download URL: lanpartydb-0.12.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lanpartydb-0.12.2.tar.gz
Algorithm Hash digest
SHA256 5c1eb2cc6e27436166e423fe1e7fb4726089f675112f136f27ea80eeadd7a3ae
MD5 fa9f5666007a49d817ce3d7f5a905199
BLAKE2b-256 30b057b64ac4e1b269285d4bc67ffb43955800266ad41e8c3a7696d376a2612b

See more details on using hashes here.

File details

Details for the file lanpartydb-0.12.2-py3-none-any.whl.

File metadata

  • Download URL: lanpartydb-0.12.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lanpartydb-0.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e44d3bd987dce6dcbc5174bf8f36500e353b798d4dc22f72a715a44d718bc45
MD5 e2106ffe6096977e1c54b9d3d54fc517
BLAKE2b-256 3de70ecdddf23a9b0e4c7ba84138edf5b521256a19c71385db3c7ed1cd1276fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page