semvec/pypi-packages huggingface dataset:
gambling 1.0.0.dev2
A gambling package for Cards, Dice, and Blackjack
Requires Python: >=3.6

# Gambling Python Package
####A project to create the necessary tools for gambling, such as cards and dice

| Author | CJ Stein |
| ------ | ------- |
| Version | 1.0.0.dev2 |
|Python Version| Only Tested on Python 3|

Currently supports creation of:

- Dice
- Cards
##Installation
    pip install gambling
##Usage
###Dice

Input for Dice:
Numbers shown are the default
- num=1         # This is the number of dice to use
- sides=6       # This is the number of sides on each dice

For 5 6-sided dice for something such as Yahtzee here would be the command:

    from gambling import Dice
    dice = Dice(num=5)

For one 20 sided dice for something like D&D:

    from gambling import Dice
    dice = Dice(sides=20)
For 3 20 sided dice:

    from gambling import Dice
    dice = Dice(num=3, sides=20)

Methods for Dice:

    dice.roll()   # This causes the list under the Dice.values to simulate a new roll.
    dice.values  # This will show the list of the values on the dice. The list is equal in length to the number of dice
    # ouput example: [1, 2, 3, 4, 5]

###Cards

There are two objects in the Cards package:

- Card
- Deck

A Deck builds a list of Card objects.  Cards rank and suits can be called, along with value if needed for arithmetic needs such as blackjack or war.
The input needed for a card is a single letter rank as a string and a single letter suit.

Some things you can get from card:

    from gambling import Card, Deck
    AceOfSpades = Card('A','S')
    TenOfHearts = Card('10','H')
    TenOfHearts.rank  # This will return 10
    TenOfHearts.suit  # This will return 'H'
    AceOfSpades.rank  # This will return 'A'
    AceOfSpades.value # This will return 14, 'J' : 11, 'Q':12, 'K':13, 'A':14

Making cards by themselves isn't very useful, but making decks will be useful and you can use the Card object to get a value
There is one optional input for Deck:

- num = 1  #  It defaults to using one deck, but you can change that to multiple decks if needed for something like blackjack


    PokerDeck = Deck()
    PokerDeck.order  # This returns a new deck with the cards in order
    PokerDeck.shuffle()  # This shuffles the deck to randomize the order
    next(PokerDeck)  # This calls the next card in the deck, the deck can be used as an iterator as such
pymetrc 0.2.2
For interacting with the Metrc API
Requires Python: >=3.7

# Pymetrc

**Only the Montana endpoints are tested at this time. Each state dictates the subset of features Metrc exposes. As such, this may not work as intended with other state API endpoints.**

This project is intended to provide abstraction and easy integration with the Metrc REST API. It provides easily digestible output for use with Pandas and data analysis, storage, etc.

AIOHTTP is used to make concurrent calls to the API as the time-based query limitations can make necessary many individual GET requests, especially when initializing a database with all packages, sales receipts, etc.

Currently, only GET endpoints are implemented. Once these are covered, POST and PUT functionality is planned.

## Installation

Pymetrc is available via pip:

```sh
pip install pymetrc
```

## Usage

Upon instantiation of a Metrc object, an initial GET request is made to populate the facility list stored by the object. These facilities are those the given user has access to. This does not currently guarantee that the given user has permission to access the endpoints specified -- this is planned for future implementations.

Date/time strings passed must be in ISO 8601 format.

It is ill-advised to use API keys directly in code. It is recommended to use environment variables or other more secure means to store your API credentials:

```py
import os

vendor_api_key = os.environ['METRC_VENDOR_API_KEY']
user_api_key = os.environ['METRC_USER_API_KEY']
```

### Employees

```py
from pymetrc import Metrc

state = 'mt'
m = Metrc(vendor_api_key, user_api_key, state)

data = m.get_basic("employees_v1")
```

### Packages

```py
from pymetrc import Metrc

state = 'mt'
m = Metrc(vendor_api_key, user_api_key, state)

data = m.get_last_modified("packages_v1_active", "D-12345", "2020-01-01T00:00:00+00:00", "2021-01-01T00:00:00+00:00")
```

This returns a list of dictionary objects, each representing an entity of the type requested. In the above example, we get back a list of packages.

### Sales Transactions

```py
from pymetrc import Metrc

state = 'mt'
m = Metrc(vendor_api_key, user_api_key, state)

data = m.get_sales_transactions("D-12345", "2020-01-01T00:00:00+00:00", "2021-01-01T00:00:00+00:00")
```

In the above example, we get a list of receipts each containing a sub-list of per-package transactions. Requesting sales transactions via Pymetrc prompts a request first for the sales receipts in this time period. The receipt ids are parsed and then the sales transactions can be queried using these ids. Sales receipts can be requested if only high-level sales information is needed.

## Technologies
- Python 3.7+
- [aiohttp](https://github.com/aio-libs/aiohttp)
- [tqdm](https://github.com/tqdm/tqdm)