Giter VIP home page Giter VIP logo

rmsfact's Introduction

rmsfact

A port of the R package rmsfact by Dirk Edelbuettel.

Display a randomly selected quote about Richard M. Stallman based on the collection in the 'GNU Octave' function 'fact()' which was aggregated by Jordi Gutiérrez Hermoso based on the (now defunct) site stallmanfacts.com (which is accessible only via http://archive.org).

Installation

python -m pip install rmsfact

Usage

The package exports a single function rmsfact() which returns a single randomly-chosen "fact" as a str.

import rmsfact

rmsfact.rmsfact()

You can also run python -m rmsfact from a shell.

Building from source

In the event you want to build the package from source, clone the repository...

git clone https://github.com/lewinfox/rmsfact.git

... cd into the project directory...

cd rmsfact

...and install with make

make install

This builds the package and then runs python -m pip install .

Making changes

To add a new fact you can edit rmsfact/data/rmsfact.txt.

echo "A new fact" >> rmsfact/data/rmsfact.txt

The Makefile provides a couple of useful targets, one of which is make build_binary_data which executes the script rmsfact/data/build_rms_fact.py to convert rmsfact/data/rmsfact.txt into a .dat file using pickle. This .dat file is then read when the package is loaded.

Executing make build will rebuild the data file and produce the source and binary packages under a dist/ directory. You may need to python -m pip install build first.

make build

Other makefile targets

  • make install_dev: Install with pip -e
  • make test: Run unit tests
  • make clean: Remove build artifacts

rmsfact's People

Contributors

lewinfox avatar

Watchers

 avatar  avatar  avatar

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.