Openrtb
A set of Python classes implementing OpenRTB 2.2 and OpenRTB Mobile specifications
Install / Use
/learn @anossov/OpenrtbREADME
This package contains classes mirroring the OpenRTB 2.2 <http://www.iab.net/media/file/OpenRTBAPISpecificationVersion2_2.pdf>_ and OpenRTB Mobile 1.0 <https://code.google.com/p/openrtb/downloads/detail?name=OpenRTB%20Mobile%20RTB%20API%20-%201.0.pdf&can=2&q=>_ protocol schemas.
Master Build Status
.. image:: https://travis-ci.org/anossov/openrtb.svg?branch=master :target: https://travis-ci.org/anossov/openrtb
Modules
- All classes have a
deserializemethod that creates the appropiate objects from a Python dict (e.g. decoded from JSON). - All objects have a
serializemethod that serializes the object back to a Python dict.
request
Contains the BidRequest class and the bid request subobject classes:
ImpressionBannerVideoSiteAppPublisherDeviceUserGeoContentDataSegmentProducer
response
Contains the BidResponse class and the bid response subobject classes, SeatBid and Bid.
mobile
Contains the OpenRTB Mobile BidRequest classes and its subobjects:
ImpressionDeviceUserSiteAppRestrictionsRegulationsPMPDeal
Also contains the OpenRTB20Adapter class that can be used to deserialize an OpenRTB Mobile bid request into OpenRTB 2.0 objects.
macros
Contains the substitution function that performs substitution macro replacement in a string.
substitution(BidRequest, BidResponse, auction_price, string_with_macros) -> string with expanded macros
constants
Contains enum-like wrappers around the integer constants used in bid requests (see chapter 6 of the OpenRTB 2.0 spec):
AuctionTypeBannerTypeCreativeAttributeCompanionTypeAdPositionConnectionTypeExpandableDirectionContentContextContentDeliveryMethodLocationTypeDeviceTypeAPIFrameworkVideoLinearityVideoProtocolVideoPlaybackMethodVideoQualityQAGMediaRatingNoBidReason
iab
Contains the IAB’s contextual category taxonomy:
CATEGORIES— a list of(category_name, list_of_subcategories)tuples
