semvec/pypi-packages huggingface dataset:
cribbage 1.2.2
Cribbage for your command line
License: MIT
Keywords: cribbage cards card-games machine-learning ai

Cribbage for your command line
============================== 

Implementation of cribbage_ for two players. Text-based GUI for use on your 
command line (so you can appear to be working). Several kinds of opponents. 

.. _cribbage: https://www.pagat.com/adders/crib6.html

Opponents
---------

- **Random**. This opponent plays a random legal move

- **Expert**. This opponent uses an enumerative strategy to determine the move
  with the greatest possible reward (points), and takes that move. The author
  wrote the optimal policy 

- **Student**. This opponent is a deep neural network that has been trained 
  via self-play using Google Keras_ and OpenAI Gym_ (see ``/train`` for details)
  to execute an optimal policy 

.. _Keras: https://keras.io
.. _Gym: https://gym.openai.com

Installation 
------------

Install using `pip`

.. code-block:: python 

	pip install cribbage 


Or install from the source 

.. code-block:: python

	git clone git@github.com:dacarlin/cribbage.git
	cd cribbage 
	python setup.py install 


How to use 
----------

From the command line, specify the kinds of players you want in the game 

.. code-block:: bash 

	cribbage human random 


You can also name the players  

.. code-block:: bash

	cribbage human random --name1 Osha --name2 Otto


If you would like to try playing one of the AI opponents, you can run with the
following

.. code-block:: bash

	cribbage human expert --name1 Alne --name2 Arin

Both the **Student** and the **Expert** players achieve performance that is 
better than most humans.   

Help
---- 

Run ``cribbage -h`` for an explanation of the command line arguments
lawfactory-utils 0.2.2
Python utils for The Law Factory parsers
License: MIT
Keywords: scraping politics data

lawfactory-utils
================
.. image:: https://travis-ci.org/regardscitoyens/lawfactory_utils.svg?branch=master
    :target: https://travis-ci.org/regardscitoyens/lawfactory_utils

A few utilities for `the-law-factory-parser`_ project, shared by
`senapy`_ and `anpy`_.

-  A simple caching library:

::

    from lawfactory_utils.urls import enable_requests_cache, download
    enable_requests_cache()

    .....

    resp = download(url)
    print(resp.text)

Warning: To be able to download from Légifrance, you must set up a ``LEGIFRANCE_PROXY`` env variable, which is a running instance of legifrance-proxy_.

The cached responses are stored in the directory where this lib is
installed. You can use ``lawfactory_where_is_my_cache`` to print the
path.

-  URL cleaning for senat/AN/legifrance/conseil-constit

::

    >>> from lawfactory_utils.urls import clean_url
    >>> clean_url('https://www.legifrance.gouv.fr/eli/loi/2017/9/15/JUSC1715752L/jo/texte')
    'https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000035567936'

- Parsing of National Assembly URLS

::

    >>> from lawfactory_utils.urls import parse_national_assembly
    >>> parse_national_assembly_url("http://www.assemblee-nationale.fr/dyn/15/dossiers/retablissement_confiance_action_publique")
    (15, 'retablissement_confiance_action_publique')


.. _the-law-factory-parser: https://github.com/regardscitoyens/the-law-factory-parser
.. _senapy: https://github.com/regardscitoyens/senapy
.. _anpy: https://github.com/regardscitoyens/anpy
.. _legifrance-proxy: https://github.com/mdamien/legifrance-proxy