Skip to main content

Python implementation of the game of marco polo with time dependencies.

Project description

Marco Polo

A Python implementation of the classic game of Marco Polo.

Description

This library provides a simple Python function that implements the Marco Polo game logic. When you call "Marco", it responds with "Polo"!

Installation

Install the package using pip:

pip install juancobo6-marco-polo-timeseries

Or if you're using uv:

uv add juancobo6-marco-polo-timeseries

Requirements

  • Python 3.12 or higher
  • pandas >= 2.3.1

Usage

from juancobo6_marco_polo_timeseries import marco_polo

# Basic usage
result = marco_polo("Marco", pd.Timestamp("2025-01-01 11:00:00"))
print(result)  # Output: "Polo"

# Other inputs return None
result = marco_polo("Hello", pd.Timestamp("2025-01-01 11:00:00"))
print(result)  # Output: None

API Reference

marco_polo(name: str, time: pd.Timestamp) -> str | None

Returns "Polo" if the name is "Marco", otherwise returns None.

Parameters:

  • name (str): The name to check
  • time (pd.Timestamp): The time to check

Returns:

  • str | None: "Polo" if the name is "Marco", otherwise None

Example:

from juancobo6_marco_polo_timeseries import marco_polo

assert marco_polo("Marco", pd.Timestamp("2025-01-01 11:00:00")) == "Polo"
assert marco_polo("Polo", pd.Timestamp("2025-01-01 11:00:00")) is None
assert marco_polo("John", pd.Timestamp("2025-01-01 11:00:00")) is None

Development

This project uses:

  • Build system: Hatchling
  • Dependencies: pandas
  • Type hints: Fully typed with py.typed marker

License

This project is open source. See the license file for details.

Author

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

juancobo6_marco_polo_timeseries-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file juancobo6_marco_polo_timeseries-0.1.0.tar.gz.

File metadata

File hashes

Hashes for juancobo6_marco_polo_timeseries-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe8a307ccd0984d7a795ea25c06b48d0a455d8727a7c48d7513d89d1888a50f9
MD5 660aa88a41dabbf314a40f638e4b6ed8
BLAKE2b-256 553f48e55c3982536e2e698b90bd3e8e444b88a1792a377a299ee5c12988720e

See more details on using hashes here.

File details

Details for the file juancobo6_marco_polo_timeseries-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juancobo6_marco_polo_timeseries-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f34f5877fe9a98c3c30c705a94232120712ee52824c5c23829068aaa07b8709a
MD5 d7eda915ea489b13792456bb4da60e87
BLAKE2b-256 fa48c33d3ca9840e25efafaf9f69cc8a0cbc07caa818c973e36eca60f5854ea8

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