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),
    online_only=False,
    seats=420,
    attendees=397,
    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.13.0.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.13.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lanpartydb-0.13.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.13.0.tar.gz
Algorithm Hash digest
SHA256 824a01787d93dded4435fe019af90f3a8073ad3924a4e35a543655b587e4d409
MD5 ceee3e6c167cbd9def877f2584ff5494
BLAKE2b-256 6d0ca81b566631f85f8769e7c2327b49b16f53195cc26601fdee41f229f94b14

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lanpartydb-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0de6194b17172be144da16069c25d51626d32c1297c40155655e88efce438f84
MD5 ccde2ca1c0f0256f0b43d5c231a037af
BLAKE2b-256 d5514d3b10ef0abd4faab579ac9ecc92bd00abaecd89d493af885ad7920f3aef

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