anossov / openrtb Goto Github PK
View Code? Open in Web Editor NEWA set of Python classes implementing OpenRTB 2.2 and OpenRTB Mobile specifications
License: BSD 2-Clause "Simplified" License
A set of Python classes implementing OpenRTB 2.2 and OpenRTB Mobile specifications
License: BSD 2-Clause "Simplified" License
The Enum class expects the incoming value to be an int, even defining a custom int method. However, in the case when a non int is passed in, int will return an error. Other functionality, such as the custom str definition, will also never work unless the value that is passed into the enum class is an int.
Thus, the enum class should only allow integer values as part of its init. This will also allow a ValidationError to be raised in the Field class when an openrtb field that is expected to be an int is instead passed a string.
Curious how much work is required to adhere with open rtb 2.4 and native. Any plans for that?
It would be extremely helpful to be able to choose which API version. Right now a person using this library has to be on the latest version or would just have to revert the API specific commits locally which is not ideal.
https://github.com/anossov/openrtb/blob/master/openrtb/base.py#L126
Why is the values dict instantiated with a None key and value? It is easy to filter out, but could that line be set to params['values'] = {}?
OpenRTB allows for fields with null values. When converted to python dicts they become None values. The deserializer should just skip over the None values.
Hello, I was wondering if you are planning any python3 support? or if you know if there are any issues (aside from syntax) which would be hard to change?
Hey @anossov, I'm thinking about adding support for native ads but I'm not sure if I can just add support for those without adding support for the rest of 2.3 as well. Have you got any recommendations on where to start? Alternatively I can just have a go, submit a pull request, then take feedback from that. Thoughts?
As a developer who already depends on this package I would like it to support serializing and de-serializing notifications so that I don't have to roll my own code to do this.
I have sample of bid response
https://gist.github.com/Derfirm/5bab0dacd280eec09332a37481ad9dfe
This is my test case
class TestResponse(unittest.TestCase):
def test_parse_response(self):
bid_resp = master.bidder.response.BidResponse(**BRP)
self.assertEqual(bid_resp.get_first_price(), 0)
I have an error
return self.seatbid[0].bid[0]
AttributeError: 'dict' object has no attribute 'bid'
Decimal types do not have a 'serialize' method associated with them, so when serialized, decimal fields in an object just get returned as decimal fields, which do not convert to json properly using the standard json library.
If there is no objection I was going to convert the custom enum class to use the Enum that was added in python3 for compatibility.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.