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.1.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.1.tar.gz.

File metadata

File hashes

Hashes for juancobo6_marco_polo_timeseries-0.1.1.tar.gz
Algorithm Hash digest
SHA256 110474e78a35b603ce8211e1e4d1c7e6f21f832670db7cf18d4e8c9e534a61a5
MD5 d40f93475d4264653fc9ae92999db13d
BLAKE2b-256 4a8e32d606463284675848de2c1458f009d1d1b7bfaf2c39a383e0751527c5c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for juancobo6_marco_polo_timeseries-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ce71b5c19df9dcf987d283fb19872b1fec750dbd58a7a930be9eecd8a92033e
MD5 62a68822d869e6a9a4a03739a48c8b39
BLAKE2b-256 367c754c92cc7199eb7b7e17934c1b1516b7e17c86f2a0d6a37262b60e37d2eb

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