cannabis_reports.apis package

Submodules

cannabis_reports.apis.abstract_entity_endpoint module

class cannabis_reports.apis.abstract_entity_endpoint.AbstractEntityEndpoint[source]

Bases: cannabis_reports.base_api.BaseApi

This represents an abstract entity endpoint.

The Dispensaries and Producers API inherit from this.

classmethod get_available(session, ucpc, lat, lng, radius=10, path_prefix=None, limit=None)[source]

Get information about the availability of everything from a producer using latitude and longitude.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) – UCPC for the cannabis object you want the children from.
  • lat (float) – Latitude for the center of your availability search.
  • lng (float) – Longitude for the center of your availability search.
  • radius (int) – Radius to search for in miles, max 25.
  • path_prefix (str, optional) – A URI path to prefix with, which is useful for dispensary hierarchies. This will override the endpoint prefix, so it should include it if necessary.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

An iterator of child objects.

Return type:

RequestPaginator(output_type=cls.__object__)

classmethod get_edibles(session, ucpc, path_prefix=None, limit=None)[source]

Gets a paginated list of edibles for a producer with the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis producer you want the edibles for.

  • path_prefix (str, optional) – A URI path to prefix with, which is useful for dispensary hierarchies. This will override the endpoint prefix, so it should include it if necessary.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

The edibles for this producer.

Return type:

RequestPaginator(output_type=Edible)

classmethod get_extracts(session, ucpc, path_prefix=None, limit=None)[source]

Gets a paginated list of extracts for a producer with the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis producer you want the extracts for.

  • path_prefix (str, optional) – A URI path to prefix with, which is useful for dispensary hierarchies. This will override the endpoint prefix, so it should include it if necessary.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

The extracts for this producer.

Return type:

RequestPaginator(output_type=Extract)

classmethod get_products(session, ucpc, path_prefix=None, limit=None)[source]

Gets a paginated list of products for a producer with the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis producer you want the products for.

  • path_prefix (str, optional) – A URI path to prefix with, which is useful for dispensary hierarchies. This will override the endpoint prefix, so it should include it if necessary.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

The products for this producer.

Return type:

RequestPaginator(output_type=Product)

cannabis_reports.apis.abstract_item_endpoint module

class cannabis_reports.apis.abstract_item_endpoint.AbstractItemEndpoint[source]

Bases: cannabis_reports.base_api.BaseApi

This represents an abstract item endpoint.

The Strains API and AbstractProductEndpoint inherit from this.

classmethod get_available(session, ucpc, lat, lng, radius=10, limit=None)[source]

Get information about the availability of the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis object you want the children from.

  • lat (float) – Latitude for the center of your availability search.
  • lng (float) – Longitude for the center of your availability search.
  • radius (int) – Radius to search for in miles, max 25.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

An iterator of child objects.

Return type:

RequestPaginator(output_type=cls.__object__)

classmethod get_effects_flavors(session, ucpc)[source]

Get the average effects and flavors from reviews for this object.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis object you want the effect and flavor profile from.

Returns:

The effect and flavor

profile for this object.

Return type:

cannabis_reports.models.EffectsFlavors

classmethod get_reviews(session, ucpc, limit=None)[source]

Get the reviews for a cannabis object.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis object you want the reviews from.

  • limit (int, optional) – Stop after iterating this many pages.
Returns:

Reviews iterator.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Review)

classmethod get_user(session, ucpc)[source]

Get the user who added the object to the database.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis object you want the user from.

Returns:

The user who added the object

to the database.

Return type:

cannabis_reports.models.User

classmethod search(session, query, sort='created_at', path='type', limit=None)[source]

Return search results for objects.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • query (str) – Search query to find objects in our system. Must be at least 2 characters.
  • sort (str) – Snake cased field name to sort on. Prefix with a - for descending.
  • path (str) – The path for the search (eg for strains it is search and for flowers it is type.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

Objects iterator.

Return type:

RequestPaginator(output_type=cls.__object__)

cannabis_reports.apis.abstract_product_endpoint module

class cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint[source]

Bases: cannabis_reports.apis.abstract_item_endpoint.AbstractItemEndpoint

This represents an abstract product endpoint.

The Edibles, Extracts, Flowers, Products APIs inherit from this.

classmethod get_producer(session, ucpc)[source]

Gets the producer for a given product.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis product you want the seed company from.

Returns:

The producer that was

responsible for this product.

Return type:

cannabis_reports.models.SeedCompany

classmethod get_strain(session, ucpc)[source]

Gets the information about a strain for a product with the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis product you want the strain from.

Returns:

The strain for the product.

Return type:

cannabis_reports.models.Strain

cannabis_reports.apis.dispensaries module

class cannabis_reports.apis.dispensaries.Dispensaries[source]

Bases: cannabis_reports.apis.abstract_entity_endpoint.AbstractEntityEndpoint

This represents the Dispensaries Endpoint.

https://developers.cannabisreports.com/docs/dispensaries

classmethod get_available(*args, **kwargs)[source]
classmethod get_strains(session, slug, limit=None)[source]

Gets a paginated list of strains for a dispensary with the given slug.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • slug (str) – Slug for the name of the dispensary (includes city/state slug).
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

The strains for this dispensary.

Return type:

RequestPaginator(output_type=Strain)

cannabis_reports.apis.edibles module

class cannabis_reports.apis.edibles.Edibles[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Edibles Endpoint.

https://developers.cannabisreports.com/docs/edibles

cannabis_reports.apis.extracts module

class cannabis_reports.apis.extracts.Extracts[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Extracts Endpoint.

https://developers.cannabisreports.com/docs/extracts

cannabis_reports.apis.flowers module

class cannabis_reports.apis.flowers.Flowers[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Flowers Endpoint.

https://developers.cannabisreports.com/docs/flowers

cannabis_reports.apis.producers module

class cannabis_reports.apis.producers.Producers[source]

Bases: cannabis_reports.apis.abstract_entity_endpoint.AbstractEntityEndpoint

This represents the Producers Endpoint.

https://developers.cannabisreports.com/docs/producers

cannabis_reports.apis.products module

class cannabis_reports.apis.products.Products[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Products Endpoint.

https://developers.cannabisreports.com/docs/products

cannabis_reports.apis.strains module

class cannabis_reports.apis.strains.Strains[source]

Bases: cannabis_reports.apis.abstract_item_endpoint.AbstractItemEndpoint

This represents the Strains Endpoint.

https://developers.cannabisreports.com/docs/strains

classmethod get_children(session, ucpc, limit=None)[source]

Get the child strains that this one has been bred into.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis strain you want the children from.

  • limit (int, optional) – Stop after iterating this many pages.
Returns:

An iterator of child strains.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Strain)

classmethod get_genetics(session, ucpc)[source]

Gets the strains that were the parent material for the strain with the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis strain you want the genetics from.

Returns:

An iterator of parent strains.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Strain)

classmethod get_seed_company(session, ucpc)[source]

Get the seed company that was responsible for a cannabis strain.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis strain you want the seed company from.

Returns:

The seed company that was

responsible for this strain.

Return type:

cannabis_reports.models.SeedCompany

classmethod search(session, query, sort='name', path='search', limit=None)[source]

Gets products for a given strain with optional sorting.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • query (str) – The search query.
  • sort (str) – Snake cased field name to sort on. Prefix with a - for descending.
  • path (str) – The path for the search (eg for strains it is search and for extracts it is type.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

An iterator of parent extracts.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Extract)

Module contents

class cannabis_reports.apis.Dispensaries[source]

Bases: cannabis_reports.apis.abstract_entity_endpoint.AbstractEntityEndpoint

This represents the Dispensaries Endpoint.

https://developers.cannabisreports.com/docs/dispensaries

classmethod get_available(*args, **kwargs)[source]
classmethod get_strains(session, slug, limit=None)[source]

Gets a paginated list of strains for a dispensary with the given slug.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • slug (str) – Slug for the name of the dispensary (includes city/state slug).
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

The strains for this dispensary.

Return type:

RequestPaginator(output_type=Strain)

class cannabis_reports.apis.Edibles[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Edibles Endpoint.

https://developers.cannabisreports.com/docs/edibles

class cannabis_reports.apis.Extracts[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Extracts Endpoint.

https://developers.cannabisreports.com/docs/extracts

class cannabis_reports.apis.Flowers[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Flowers Endpoint.

https://developers.cannabisreports.com/docs/flowers

class cannabis_reports.apis.Producers[source]

Bases: cannabis_reports.apis.abstract_entity_endpoint.AbstractEntityEndpoint

This represents the Producers Endpoint.

https://developers.cannabisreports.com/docs/producers

class cannabis_reports.apis.Products[source]

Bases: cannabis_reports.apis.abstract_product_endpoint.AbstractProductEndpoint

This represents the Products Endpoint.

https://developers.cannabisreports.com/docs/products

class cannabis_reports.apis.Strains[source]

Bases: cannabis_reports.apis.abstract_item_endpoint.AbstractItemEndpoint

This represents the Strains Endpoint.

https://developers.cannabisreports.com/docs/strains

classmethod get_children(session, ucpc, limit=None)[source]

Get the child strains that this one has been bred into.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis strain you want the children from.

  • limit (int, optional) – Stop after iterating this many pages.
Returns:

An iterator of child strains.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Strain)

classmethod get_genetics(session, ucpc)[source]

Gets the strains that were the parent material for the strain with the given UCPC.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis strain you want the genetics from.

Returns:

An iterator of parent strains.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Strain)

classmethod get_seed_company(session, ucpc)[source]

Get the seed company that was responsible for a cannabis strain.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • ucpc (str) –

    UCPC for the cannabis strain you want the seed company from.

Returns:

The seed company that was

responsible for this strain.

Return type:

cannabis_reports.models.SeedCompany

classmethod search(session, query, sort='name', path='search', limit=None)[source]

Gets products for a given strain with optional sorting.

Parameters:
  • session (requests.sessions.Session) – Authenticated session.
  • query (str) – The search query.
  • sort (str) – Snake cased field name to sort on. Prefix with a - for descending.
  • path (str) – The path for the search (eg for strains it is search and for extracts it is type.
  • limit (int, optional) – Stop after iterating this many pages.
Returns:

An iterator of parent extracts.

Return type:

RequestPaginator(output_type=cannabis_reports.models.Extract)