Skip to main content

adventurestay-utils

Core business logic for adventure staycation experiences such as trekking, hills staycations, jungle safaris, and rustic lodging. The package centralizes package configuration, booking validation, availability checking, and price calculations so that multiple web or backend apps can share the same rules.

Installation

pip install adventurestay-utils

During local development inside this repo:

pip install -e .

Usage

from datetime import date
from adventurestay_utils import (
    AdventurePackage,
    PackageBookingValidator,
    PackageAvailabilityChecker,
    AdventurePriceCalculator,
    build_itinerary_summary,
    AdventureBooking,
)

package = AdventurePackage(
    package_id="JUNGLE001",
    category="JUNGLE_SAFARI",
    name="2N/3D Jungle Safari",
    location="Kanha",
    base_price_per_person=95.0,
    max_guests=8,
    min_nights=2,
    max_nights=4,
    includes_meals=True,
    includes_guide=True,
)

validator = PackageBookingValidator()
request = validator.create_booking_request(
    package, start_date=date(2025, 3, 10), end_date=date(2025, 3, 13), num_guests=4
)

availability_checker = PackageAvailabilityChecker()
availability_checker.check_availability(request, package, existing_bookings=[])

price = AdventurePriceCalculator().calculate_price(request, package)
booking = AdventureBooking(
    package=package,
    start_date=request.start_date,
    end_date=request.end_date,
    num_guests=request.num_guests,
    nights=(request.end_date - request.start_date).days,
    total_price=price,
)

print(build_itinerary_summary(booking))

Development

  1. Create/activate the provided .venv.

  2. Install dependencies: pip install -e .[dev].

  3. Run tests: python -m pytest.

  4. Build the package when ready for publishing:

    python -m pip install --upgrade build twine
    python -m build
    # twine upload dist/*   # requires credentials via environment variables
    

Features

  • Dataclass-based domain models for packages and bookings.
  • Validators for dates, guest counts, and package configuration.
  • Availability checker that prevents overlapping bookings beyond capacity.
  • Pricing calculator with weekend and peak-season multipliers.
  • Itinerary summary helper for emails and notifications.

Metadata

Release files for adventurestay-u 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adventurestay-u 0.1.0
File Size Uploaded Provenance Actions
adventurestay_u-0.1.0.tar.gz 6.7 kB Without provenance Details for adventurestay_u-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adventurestay-u 0.1.0
File Interpreter ABI Platform Actions
adventurestay_u-0.1.0-py3-none-any.whl Python 3 none any Details for adventurestay_u-0.1.0-py3-none-any.whl

Total release size: 13.7 kB

Release files / adventurestay_u-0.1.0.tar.gz

Download URL adventurestay_u-0.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f7b651a26769c451e1b17679635e5c58527a47671cad12faa25d4477993dadbb
BLAKE2b-256 checksum
How to use checksums
cee276cae463ffe3221258e6e865f3bf2f32bd8112055d120ef2bcb28fc1a415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Release files / adventurestay_u-0.1.0-py3-none-any.whl

Download URL adventurestay_u-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d92fdadb235aab340c2e58788b066806f8f58e521e2e540d94f149821d0faa1b
BLAKE2b-256 checksum
How to use checksums
c2363e84b1b6519bfd01628007dbef1d089e6e3e03258a263e20f7d330198987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Security for adventurestay-u 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page