Python dailydose Package
Boredom kills. Here's a package that gives you a daily dose of fun!
Team Members
Installation
Install the dailydose module with pip.
Usage
Once installed, dailydose gives access to the package's 4 special features: today's news in different fields (per Vox Media), random fun facts, and the games of hangman and battleship. The variety of the collection is inspired by the traditional newspaper/magazine experience, in which both information and thought-provoking entertainment is regularly provided. This package is ideal for any program that operates on changing content or stimulating applications.
dailydose supports a command-line interface (CLI). To choose one of the above options, simply call:
$ python3 -m dailydose
Upon running the package, a main menu is displayed in which your options are listed. Access each feature by entering their corresponding menu number.
Fun Stuffs To Do
Fun Facts
-
To see a fun fact, press 1 when the main menu is prompted. A random fun fact from TheFactSite will be printed.
-
After that, you will be redirected to the main menu.
Newsfeed
-
To see today's news, press 2 when the main menu is prompted. Immediately after, you will be given a list of options to read about: Culture, Politics, Science, World, Technology, Environment, and Business. You also have the option to return to the main menu.
-
Select a field by entering the corresponding listed number. Today's top headlines in the chosen field, as published by Vox Media, as well as a link to read more are printed.
-
The content is sourced from their website and therefore changes accordingly.
-
Upon receiving the headlines, you will be redirected to the main menu.
Hangman Game
-
To play the hangman game, press 3 when the main menu is prompted.
-
You will then be asked to enter the length of the word you want to guess.
-
Upon guessing the correct word or losing the game, you will be redirected to the main menu.
Battleship Game
-
To play the battleship game, press 4 when the main menu is prompted.
-
You will then be asked to enter the board dimensions and ship size. You can also choose to use the default settings.
-
The game creates a dimension*dimension size board and keeps track of how many turns it takes for you to win! What do you think is the optimal strategy?
-
Upon winning or exiting the game, you will be redirected to the main menu.
Importing the Package
For example usage of the package, see example.py.
1. fact.get -- generate a list of random fun fact objects
fact.get(count=1, include_details=True)
Parameters
-
count: how many non-duplicate fun fact objects to return- default: 1
- possible values: [1, 100], inclusive
-
include_details: whether to return the detailed contents of the facts or only the headings- default: True
2. news.get_headlines -- generate a list of headlines
news.get_headlines(subject, titular)
Parameters
-
subject: category name in url slug format on Vox.com- possible values:
"culture","policy-and-politics","science-and-health","world","technology","energy-and-environment","business-and-finance"
- possible values:
-
titular: a user-friendly display name for the category name- possible values: any
str
- possible values: any
3. hang.hangman -- start an interactive hangman game
hang.hangman(num_letter=number_of_letters)
Parameters
num_letter: the length of word you want to guess- possible values: a string make up of numbers, the length of word acceptable is in between [
"4","10"], inclusive
- possible values: a string make up of numbers, the length of word acceptable is in between [
4. battleship.main -- start an interactive battleship game
battleship.main(ship_size="4", dimension="10")
Parameters
-
dimension: the size of the board (dimension * dimension)- default:
"10" - possible values: a string make up of numbers, the board dimension acceptable is in between [
"1","10"], inclusive
- default:
-
ship_size: the size of the hidden battleship- default:
"4" - possible values: a string make up of numbers, the ship size acceptable is in between [
"1",dimension], inclusive
- default:
Contribute
Source Code
Clone the package source code from GitHub repository.
Setup Virtual Environment
- Create a
pipenv-managed virtual environment and install all required dependencies by running the following command in the main project directory where thePipfileis:
pipenv install
- Activate the virtual environment:
pipenv shell
- Then you can test and modify the package!
Test the Package
- Run the tests from the main project directory:
python3 -m pytest
Build the Package
-
Delete the autogenerated
distdirectory if it exists. -
Delete the autogenerated
src/*.egg-infodirectory if it exists. -
Build the package by running the following command in the main project directory:
python3 -m build
Metadata
Release files for dailydose 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dailydose-0.1.1.tar.gz | 43.4 kB | Without provenance | Details for dailydose-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dailydose-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for dailydose-0.1.1-py3-none-any.whl |
Total release size: 85.7 kB
Release files / dailydose-0.1.1.tar.gz
| Download URL | dailydose-0.1.1.tar.gz |
|---|---|
| Size | 43.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07964be959212443b3d7a694c2e67d1dd0fb8760ea33f0ea1ab49eb9b949be3a
|
|
BLAKE2b-256 checksum How to use checksums |
a4a0c0683b88e21586591c017aed1b74da69b11c25e6a1d09ed4fb7bb071f1e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|
Release files / dailydose-0.1.1-py3-none-any.whl
| Download URL | dailydose-0.1.1-py3-none-any.whl |
|---|---|
| Size | 42.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3474fe2a559cd86233f1bbe64f5da38421f1334e3054cd23900ad925364699d
|
|
BLAKE2b-256 checksum How to use checksums |
c7a22c22a7307885335bd461f0244a43c5db3e5e7cf8e9a0fc6c25d157c96823
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|
Security for dailydose 0.1.1
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.