Giter VIP home page Giter VIP logo

onthisday's Introduction

onthisday

DeepSource DeepSource

Code style: black Imports: isort

Simple library that retrieves the historical events that happened on current day.

At the moment the events do not include birth/death of famous people.

Event sources

  • Wikipedia ๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ต๐Ÿ‡น (other countries may work, not tested)
  • Accadde Oggi ๐Ÿ‡ฎ๐Ÿ‡น

Install

pip install onthisday

Usage

As a standalone script

In the root directory:

> python -m onthisday --help

Usage: main.py [OPTIONS] COMMAND [ARGS]...

Commands:
  all     Print all the events of today
  last    Print last n events of today
  list    List the available sources (valid shorter names in brackets)
  random  Print random event of today

For the specific command options:

> python -m onthisday all --help

Usage: main.py all [OPTIONS]

  Print all the events of today

Options:
  --source TEXT  [default: wiki]
  --locale TEXT
  --help         Show this message and exit.

As a library

see the example file provided

Possible usages

Shell greeting

Display a random event as the terminal emulator loads up.

For example, for the fish shell, one can add the following greeting function:

> function fish_greeting
      python -m onthisday random
  end

> funcsave fish_greeting

Close and reopen the terminal emulator and

[2005]  In Iraq inizia il processo all'ex-dittatore Saddam Hussein

~ via ๐Ÿ v3.9.7 
โžœ 

known issue: the script is not optimized and makes no use of caches. The user experience with this kind of greeting message might not be the best as the command will take around 1 second to run.

Issues

Please open issue on this GitHub repository for any error, suggestion or feature request.

onthisday's People

Contributors

bit97 avatar deepsource-autofix[bot] avatar deepsourcebot avatar

Stargazers

 avatar  avatar

Watchers

 avatar

onthisday's Issues

Unsupported locales

Some spoken languages are not supported in multilanguages sources, as Wikipedia, since the parser is not able to decode properly the body of the webpage.

ToDo list

To be done:

  • Add tests
  • Cache downloaded pages
  • Better division of event sources
  • Add other event sources
  • Handle different languages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.