Skip to content

Commit

Permalink
Update README to reflect the use of Thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
ramnes committed Jan 24, 2018
1 parent c051708 commit 0f5c445
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. _documentation: https://wiki.appnexus.com/display/api/Home
.. _Thingy: https://github.com/numberly/thingy

===============
AppNexus-client
Expand Down Expand Up @@ -86,8 +87,8 @@ Models
A model in AppNexus-client is an abstraction for a service. Most of them are
already declared and you just have to import them.

You can access the fields of an AppNexus just like a dict:
``entity["field_name"]``
You can access the fields of an AppNexus just like any object:
``entity.field_name``

For example, to print the name of each and every city registered in AppNexus,
you could do:
Expand All @@ -97,7 +98,7 @@ you could do:
from appnexus import City
for city in City.find():
print(city["name"])
print(city.name)
You can also retrieve a single result (the first one returned by the API) using
the ``find_one`` method:
Expand All @@ -123,7 +124,7 @@ equal to "FR" and sort them by name:
.. code-block:: python
for city in City.find(country_code="FR", sort="name.desc"):
print(city["name"])
print(city.name)
The parameters you give to the ``find`` and ``find_one`` methods are translated
into query parameters for the requests being send. For example, the snippet
Expand All @@ -137,8 +138,10 @@ each parameter.
Custom data representation
--------------------------

You can hook your own data representation class with AppNexus-client. For this,
you must use a function that exposes this signature:
By default, AppNexus-client relies on Thingy_ to represent data as objects.

But you can also hook your own data representation class. For this, you must
use a function that exposes this signature:

.. code-block:: python
Expand Down

0 comments on commit 0f5c445

Please sign in to comment.