Skip to main content

A small example package

Project description

Fabrica de bere

The library is a wrapper for the Punk API.

Installation

pip install fabrica_de_bere

Functionalities

  • Get a beer by ID
  • Get a random beer
  • Get all beers
  • Get beers

Create a new object

punk_api = FabricaDeBere("https://api.punkapi.com/v2/beers/")
Parameters:
  • url: string, optional. If not given, it will try to use the environment variable PUNK_API_URL

Get a beer by ID

Returns a Beer object with the given ID.

punk_api.get_beer_by_id(id)
Parameters:
  • id: int

Get a random beer

Returns a Beer object with a random beer.

punk_api.get_random_beer()

Get all beers

Returns an iterator that stores all the beers from the API as Beer objects.

punk_api.get_all_beers()

Get a beer by ID

Returns an iterator that stores the beers from the API as Beer objects, filtered base on the given parameters.

beers = punk_api.get_beers(
        abv_gt=5,
        abv_lt=9,
        ibu_gt=55,
        ibu_lt=90,
        ebc_gt=18,
        ebc_lt=25,
        beer_name="Buzz",
        yeast="American_Ale",
        brewed_before=datetime.datetime(2014, 9, 5),
        brewed_after=datetime.datetime(2011, 3, 12),
        hops="Fuggles",
        malt="Caramalt",
        food="chicken",
        ids=[1, 2, 9],
    )
Parameters:
  • abv_gt: int
  • abv_lt: int
  • ibu_gt: int
  • ibu_lt: int
  • ebc_gt: int
  • ebc_lt: int
  • beer_name: string
  • yeast: string
  • brewed_before: datetime; only looks at the month and year
  • brewed_after: datetime; only looks at the month and year
  • hops: string
  • malt: string
  • food: string
  • ids: list of int

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabrica_de_bere-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabrica_de_bere-0.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file fabrica_de_bere-0.0.2.tar.gz.

File metadata

  • Download URL: fabrica_de_bere-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for fabrica_de_bere-0.0.2.tar.gz
Algorithm Hash digest
SHA256 151b26191d6682d89f50ac151fde9b0a3173bd7c0fc66162e89e04058916e542
MD5 49bb8f92a1f54347d6c120c3c964cf2d
BLAKE2b-256 a7f636a928f7c24519973b41ffb2377095c73e387f3ba1158e292aaa69c632f1

See more details on using hashes here.

File details

Details for the file fabrica_de_bere-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fabrica_de_bere-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4dbb55d8b037ce0ee2a3b38e7c1bce4506cc5457ba23bfb63a5ab3abb7f18b08
MD5 7bf9196858e31aff5aa7bacbffcbc005
BLAKE2b-256 717faa5a12d824aef8546f979795cb41689aaea14276a841a14859e4dbfeec39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page